Pijush2023 commited on
Commit
c92f69a
·
verified ·
1 Parent(s): 20ac8ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -824,6 +824,12 @@ hardcoded_prompt_2="A vibrant and dynamic football game scene in the style of Pe
824
  hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
825
 
826
 
 
 
 
 
 
 
827
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
828
 
829
  with gr.Row():
@@ -861,6 +867,10 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
861
  image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=400, height=400)
862
  image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
863
 
 
 
 
 
864
  demo.queue()
865
  demo.launch(share=True)
866
 
 
824
  hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
825
 
826
 
827
+ def update_images():
828
+ image_1 = generate_image(hardcoded_prompt_1)
829
+ image_2 = generate_image(hardcoded_prompt_2)
830
+ image_3 = generate_image(hardcoded_prompt_3)
831
+ return image_1, image_2, image_3
832
+
833
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
834
 
835
  with gr.Row():
 
867
  image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=400, height=400)
868
  image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
869
 
870
+
871
+ refresh_button = gr.Button("Refresh Images")
872
+ refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
873
+
874
  demo.queue()
875
  demo.launch(share=True)
876