Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,12 +136,12 @@ with gr.Blocks() as demo:
|
|
| 136 |
img = resize_image(img, 1024)
|
| 137 |
if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
|
| 138 |
raise gr.Error('image aspect ratio cannot be larger than 2.0')
|
| 139 |
-
return img,
|
| 140 |
|
| 141 |
original_image.upload(
|
| 142 |
store_img,
|
| 143 |
[original_image],
|
| 144 |
-
[
|
| 145 |
)
|
| 146 |
|
| 147 |
inputs = [original_image, input_mask, prompt, negative_prompt, blended, invert_mask, control_strength, seed, randomize_seed, guidance_scale, num_inference_steps]
|
|
|
|
| 136 |
img = resize_image(img, 1024)
|
| 137 |
if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
|
| 138 |
raise gr.Error('image aspect ratio cannot be larger than 2.0')
|
| 139 |
+
return img, [], None # when new image is uploaded, `selected_points` should be empty
|
| 140 |
|
| 141 |
original_image.upload(
|
| 142 |
store_img,
|
| 143 |
[original_image],
|
| 144 |
+
[original_image, selected_points]
|
| 145 |
)
|
| 146 |
|
| 147 |
inputs = [original_image, input_mask, prompt, negative_prompt, blended, invert_mask, control_strength, seed, randomize_seed, guidance_scale, num_inference_steps]
|