Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -29,7 +29,7 @@ def process_image(input_image, mode, weight1=None, weight2=None):
|
|
| 29 |
elif mode == "refine":
|
| 30 |
sotai_image, sketch_image = process_image_as_base64(input_image, mode, weight1, weight2)
|
| 31 |
|
| 32 |
-
return sotai_image, sketch_image, filename
|
| 33 |
|
| 34 |
def mix_images(sotai_image_data, sketch_image_data, opacity1, opacity2):
|
| 35 |
sotai_image = Image.open(io.BytesIO(base64.b64decode(sotai_image_data))).convert('RGBA')
|
|
@@ -155,12 +155,12 @@ with gr.Blocks() as demo:
|
|
| 155 |
original_submit.click(
|
| 156 |
process_image,
|
| 157 |
inputs=[input_image, original_mode],
|
| 158 |
-
outputs=[sotai_image_data, sketch_image_data, send_filename]
|
| 159 |
)
|
| 160 |
refine_submit.click(
|
| 161 |
process_image,
|
| 162 |
inputs=[input_image, refine_input[0], refine_input[1], refine_input[2]],
|
| 163 |
-
outputs=[sotai_image_data, sketch_image_data, send_filename]
|
| 164 |
)
|
| 165 |
sotai_image_data.change(
|
| 166 |
mix_images,
|
|
|
|
| 29 |
elif mode == "refine":
|
| 30 |
sotai_image, sketch_image = process_image_as_base64(input_image, mode, weight1, weight2)
|
| 31 |
|
| 32 |
+
return sotai_image, sketch_image, mixed_image, filename
|
| 33 |
|
| 34 |
def mix_images(sotai_image_data, sketch_image_data, opacity1, opacity2):
|
| 35 |
sotai_image = Image.open(io.BytesIO(base64.b64decode(sotai_image_data))).convert('RGBA')
|
|
|
|
| 155 |
original_submit.click(
|
| 156 |
process_image,
|
| 157 |
inputs=[input_image, original_mode],
|
| 158 |
+
outputs=[sotai_image_data, sketch_image_data, mixed_image, send_filename]
|
| 159 |
)
|
| 160 |
refine_submit.click(
|
| 161 |
process_image,
|
| 162 |
inputs=[input_image, refine_input[0], refine_input[1], refine_input[2]],
|
| 163 |
+
outputs=[sotai_image_data, sketch_image_data, mixed_image, send_filename]
|
| 164 |
)
|
| 165 |
sotai_image_data.change(
|
| 166 |
mix_images,
|