Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,10 +39,17 @@ with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
|
| 39 |
with gr.Row():
|
| 40 |
t2p_image_output = gr.Image(label="Generated Image")
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
t2p_generate.click(
|
| 43 |
-
|
| 44 |
inputs=[t2p_input, t2p_upscale],
|
| 45 |
-
outputs=[t2p_output, t2p_image_output]
|
| 46 |
)
|
| 47 |
|
| 48 |
demo.launch()
|
|
|
|
| 39 |
with gr.Row():
|
| 40 |
t2p_image_output = gr.Image(label="Generated Image")
|
| 41 |
|
| 42 |
+
# Add a hidden component to store a random value
|
| 43 |
+
update_trigger = gr.Number(visible=False)
|
| 44 |
+
|
| 45 |
+
def generate_with_update(prompt, upscale):
|
| 46 |
+
output, image = text_to_pano(prompt, upscale)
|
| 47 |
+
return output, image, gr.Number.update(value=torch.rand(1).item())
|
| 48 |
+
|
| 49 |
t2p_generate.click(
|
| 50 |
+
generate_with_update,
|
| 51 |
inputs=[t2p_input, t2p_upscale],
|
| 52 |
+
outputs=[t2p_output, t2p_image_output, update_trigger]
|
| 53 |
)
|
| 54 |
|
| 55 |
demo.launch()
|