Yesianrohn commited on
Commit
e6fff4e
·
verified ·
1 Parent(s): 89543e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -320,7 +320,7 @@ with gr.Blocks() as iface:
320
  with gr.Column():
321
  sample_choice = gr.Radio(choices=["Sample 1", "Sample 2"], label="Choose a Sample Background")
322
  input_image = gr.Image(type="pil", label="Input Image")
323
- mask_input = gr.ImageEditor(type="pil", label="Draw Mask on Image", interactive=True)
324
  text_input = gr.Textbox(label="Text to Synthesize / Edit")
325
  outlined_image = gr.Image(type="pil", label="Original Image with Mask Outline")
326
 
@@ -355,10 +355,10 @@ with gr.Blocks() as iface:
355
  inputs=[sample_choice],
356
  outputs=[input_image]
357
  )
358
-
359
  # Update mask when input image changes
360
  input_image.change(
361
- lambda image: None if image is None else {"image": image},
362
  inputs=[input_image],
363
  outputs=[mask_input]
364
  )
 
320
  with gr.Column():
321
  sample_choice = gr.Radio(choices=["Sample 1", "Sample 2"], label="Choose a Sample Background")
322
  input_image = gr.Image(type="pil", label="Input Image")
323
+ mask_input = gr.Image(type="pil", label="Draw Mask on Image", tool="sketch", interactive=True)
324
  text_input = gr.Textbox(label="Text to Synthesize / Edit")
325
  outlined_image = gr.Image(type="pil", label="Original Image with Mask Outline")
326
 
 
355
  inputs=[sample_choice],
356
  outputs=[input_image]
357
  )
358
+
359
  # Update mask when input image changes
360
  input_image.change(
361
+ lambda image: image, # Pass through image to mask_input
362
  inputs=[input_image],
363
  outputs=[mask_input]
364
  )