Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
c8672e0
1
Parent(s):
a30ad4e
22
Browse files
app.py
CHANGED
|
@@ -145,13 +145,13 @@ def inference(
|
|
| 145 |
control_image = control_image.resize((width, height))
|
| 146 |
control_image_torch = get_image_latent(control_image, sample_size=sample_size)[:, :, 0]
|
| 147 |
|
| 148 |
-
|
| 149 |
# inpaint_image = None
|
| 150 |
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
|
| 156 |
# if inpaint_image is not None:
|
| 157 |
# inpaint_image = get_image_latent(inpaint_image, sample_size=sample_size)[:, :, 0]
|
|
@@ -170,7 +170,7 @@ def inference(
|
|
| 170 |
generator=generator,
|
| 171 |
guidance_scale=guidance_scale,
|
| 172 |
image = None,
|
| 173 |
-
mask_image =
|
| 174 |
control_image=control_image_torch,
|
| 175 |
num_inference_steps=num_inference_steps,
|
| 176 |
control_context_scale=control_context_scale,
|
|
|
|
| 145 |
control_image = control_image.resize((width, height))
|
| 146 |
control_image_torch = get_image_latent(control_image, sample_size=sample_size)[:, :, 0]
|
| 147 |
|
| 148 |
+
mask_image = None
|
| 149 |
# inpaint_image = None
|
| 150 |
|
| 151 |
+
if mask_image is not None:
|
| 152 |
+
mask_image = get_image_latent(mask_image, sample_size=sample_size)[:, :1, 0]
|
| 153 |
+
else:
|
| 154 |
+
mask_image = torch.ones([1, 1, sample_size[0], sample_size[1]]) * 255
|
| 155 |
|
| 156 |
# if inpaint_image is not None:
|
| 157 |
# inpaint_image = get_image_latent(inpaint_image, sample_size=sample_size)[:, :, 0]
|
|
|
|
| 170 |
generator=generator,
|
| 171 |
guidance_scale=guidance_scale,
|
| 172 |
image = None,
|
| 173 |
+
mask_image = mask_image,
|
| 174 |
control_image=control_image_torch,
|
| 175 |
num_inference_steps=num_inference_steps,
|
| 176 |
control_context_scale=control_context_scale,
|