Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -201,8 +201,7 @@ def infer(image, width, height, overlap_percentage, num_inference_steps, resize_
|
|
201 |
|
202 |
# yield background, cnet_image
|
203 |
print("#####################",type(cnet_image),"##############################")
|
204 |
-
return
|
205 |
-
# return cnet_image
|
206 |
|
207 |
def clear_result():
|
208 |
"""Clears the result ImageSlider."""
|
@@ -327,8 +326,8 @@ with gr.Blocks() as demo:
|
|
327 |
preview_button = gr.Button("Preview alignment and mask")
|
328 |
|
329 |
with gr.Column():
|
330 |
-
|
331 |
-
result = ImageSlider(label="Generated Image")
|
332 |
history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
|
333 |
preview_image = gr.Image(label="Preview")
|
334 |
|
@@ -370,12 +369,11 @@ with gr.Blocks() as demo:
|
|
370 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
371 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
372 |
outputs=[result],
|
|
|
|
|
|
|
|
|
373 |
)
|
374 |
-
# ).then(#Update the history gallery
|
375 |
-
# fn=lambda x,history: update_history(x, history),
|
376 |
-
# inputs=[result, history_gallery],
|
377 |
-
# outputs=history_gallery,
|
378 |
-
# )
|
379 |
|
380 |
preview_button.click(
|
381 |
fn=preview_image_and_mask,
|
|
|
201 |
|
202 |
# yield background, cnet_image
|
203 |
print("#####################",type(cnet_image),"##############################")
|
204 |
+
return cnet_image
|
|
|
205 |
|
206 |
def clear_result():
|
207 |
"""Clears the result ImageSlider."""
|
|
|
326 |
preview_button = gr.Button("Preview alignment and mask")
|
327 |
|
328 |
with gr.Column():
|
329 |
+
result = gr.Image(label="Generate Image", interactive=False)
|
330 |
+
# result = ImageSlider(label="Generated Image")
|
331 |
history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
|
332 |
preview_image = gr.Image(label="Preview")
|
333 |
|
|
|
369 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
370 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
371 |
outputs=[result],
|
372 |
+
).then(#Update the history gallery
|
373 |
+
fn=lambda x,history: update_history(x, history),
|
374 |
+
inputs=[result, history_gallery],
|
375 |
+
outputs=history_gallery,
|
376 |
)
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
preview_button.click(
|
379 |
fn=preview_image_and_mask,
|