Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,11 +13,10 @@ model_path = snapshot_download("archerfmy0831/sd-t2i-360panoimage")
|
|
13 |
txt2panoimg = Text2360PanoramaImagePipeline(model_path, torch_dtype=torch.float16)
|
14 |
|
15 |
@spaces.GPU(duration=200)
|
16 |
-
def text_to_pano(prompt, upscale
|
17 |
input_data = {'prompt': prompt, 'upscale': upscale, 'refinement': False}
|
18 |
output = txt2panoimg(input_data)
|
19 |
-
|
20 |
-
return output, output, new_state
|
21 |
|
22 |
title = """<h1 align="center">SD-T2I-360PanoImage</h1>
|
23 |
<p align="center">360° Panorama Image Generation</p>
|
@@ -39,14 +38,11 @@ with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
|
39 |
|
40 |
with gr.Row():
|
41 |
t2p_image_output = gr.Image(label="Generated Image")
|
42 |
-
|
43 |
-
# Hidden state to force refresh
|
44 |
-
state = gr.State(value=0)
|
45 |
|
46 |
t2p_generate.click(
|
47 |
text_to_pano,
|
48 |
-
inputs=[t2p_input, t2p_upscale
|
49 |
-
outputs=[t2p_output, t2p_image_output,
|
50 |
)
|
51 |
|
52 |
demo.launch()
|
|
|
13 |
txt2panoimg = Text2360PanoramaImagePipeline(model_path, torch_dtype=torch.float16)
|
14 |
|
15 |
@spaces.GPU(duration=200)
|
16 |
+
def text_to_pano(prompt, upscale):
|
17 |
input_data = {'prompt': prompt, 'upscale': upscale, 'refinement': False}
|
18 |
output = txt2panoimg(input_data)
|
19 |
+
return None, None, output, output # Clear the Pannellum component first
|
|
|
20 |
|
21 |
title = """<h1 align="center">SD-T2I-360PanoImage</h1>
|
22 |
<p align="center">360° Panorama Image Generation</p>
|
|
|
38 |
|
39 |
with gr.Row():
|
40 |
t2p_image_output = gr.Image(label="Generated Image")
|
|
|
|
|
|
|
41 |
|
42 |
t2p_generate.click(
|
43 |
text_to_pano,
|
44 |
+
inputs=[t2p_input, t2p_upscale],
|
45 |
+
outputs=[t2p_output, t2p_image_output, t2p_output, t2p_image_output] # Clear and then update
|
46 |
)
|
47 |
|
48 |
demo.launch()
|