HelloAI1 commited on
Commit
c44b6b5
·
verified ·
1 Parent(s): c93ff24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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 gr.Blocks(css=css) as demo:
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)