Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,6 +154,9 @@ body {
|
|
| 154 |
|
| 155 |
# --- Gradio Interface ---
|
| 156 |
|
|
|
|
|
|
|
|
|
|
| 157 |
def start_generation():
|
| 158 |
return demo
|
| 159 |
|
|
@@ -176,8 +179,8 @@ with gr.Blocks() as welcome_screen:
|
|
| 176 |
# Connect Welcome Screen to Generation Screen
|
| 177 |
start_button.click(fn=start_generation, outputs=demo)
|
| 178 |
|
| 179 |
-
# Main Generation Screen
|
| 180 |
-
with
|
| 181 |
with gr.Row():
|
| 182 |
gr.Markdown("<h1 style='text-align: center;'>Create Your Disney Pixar AI Poster</h1>", elem_id="title")
|
| 183 |
|
|
@@ -230,4 +233,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 230 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 231 |
|
| 232 |
# Launch the Gradio app
|
| 233 |
-
welcome_screen.launch(max_threads=128)
|
|
|
|
| 154 |
|
| 155 |
# --- Gradio Interface ---
|
| 156 |
|
| 157 |
+
# Define demo OUTSIDE the blocks
|
| 158 |
+
demo = gr.Blocks(css=css)
|
| 159 |
+
|
| 160 |
def start_generation():
|
| 161 |
return demo
|
| 162 |
|
|
|
|
| 179 |
# Connect Welcome Screen to Generation Screen
|
| 180 |
start_button.click(fn=start_generation, outputs=demo)
|
| 181 |
|
| 182 |
+
# Main Generation Screen (Now use the defined 'demo')
|
| 183 |
+
with demo:
|
| 184 |
with gr.Row():
|
| 185 |
gr.Markdown("<h1 style='text-align: center;'>Create Your Disney Pixar AI Poster</h1>", elem_id="title")
|
| 186 |
|
|
|
|
| 233 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 234 |
|
| 235 |
# Launch the Gradio app
|
| 236 |
+
welcome_screen.launch(max_threads=128)
|