Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 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:
|
| 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 |
)
|