yeq6x commited on
Commit
426b3b0
·
1 Parent(s): 6707323

Update inference output in app.py to yield Gradio updates instead of images, streamlining the generator's response structure for improved integration with the UI.

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -150,7 +150,7 @@ def infer(
150
  num_images_per_prompt=1,
151
  ).images
152
  stage2_only_image = stage2_images[0] if stage2_images else None
153
- yield stage2_only_image, gr.update(), seed
154
 
155
  # --- Combined generation ---
156
  print(f"Generating with combined LoRAs...")
@@ -180,11 +180,11 @@ def infer(
180
  if pil_image.size != generated_image.size:
181
  pil_image = pil_image.resize(generated_image.size, Image.Resampling.LANCZOS)
182
  blended_image = Image.blend(pil_image, generated_image, alpha=0.75)
183
- yield stage2_only_image, blended_image, seed
184
  return
185
 
186
  # Return first result image and seed
187
- yield stage2_only_image, result_images[0] if result_images else None, seed
188
 
189
  # --- Examples and UI Layout ---
190
  examples = []
 
150
  num_images_per_prompt=1,
151
  ).images
152
  stage2_only_image = stage2_images[0] if stage2_images else None
153
+ yield stage2_only_image, None, seed
154
 
155
  # --- Combined generation ---
156
  print(f"Generating with combined LoRAs...")
 
180
  if pil_image.size != generated_image.size:
181
  pil_image = pil_image.resize(generated_image.size, Image.Resampling.LANCZOS)
182
  blended_image = Image.blend(pil_image, generated_image, alpha=0.75)
183
+ yield gr.update(), blended_image, seed
184
  return
185
 
186
  # Return first result image and seed
187
+ yield gr.update(), result_images[0] if result_images else None, seed
188
 
189
  # --- Examples and UI Layout ---
190
  examples = []