Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
6c13a24
1
Parent(s):
76ee8d3
22
Browse files
app.py
CHANGED
|
@@ -141,8 +141,14 @@ def inference(
|
|
| 141 |
control_image = processor(control_image, to_pil=True)
|
| 142 |
control_image = control_image.resize((width, height))
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
print("DEBUG: control_image_torch")
|
| 145 |
-
control_image_torch = get_image_latent(control_image, sample_size=
|
| 146 |
|
| 147 |
# generation
|
| 148 |
if randomize_seed: seed = random.randint(0, MAX_SEED)
|
|
|
|
| 141 |
control_image = processor(control_image, to_pil=True)
|
| 142 |
control_image = control_image.resize((width, height))
|
| 143 |
|
| 144 |
+
sample_size = [height, width]
|
| 145 |
+
if mask_image is not None:
|
| 146 |
+
mask_image = get_image_latent(mask_image, sample_size=sample_size)[:, :1, 0]
|
| 147 |
+
else:
|
| 148 |
+
mask_image = torch.ones([1, 1, sample_size[0], sample_size[1]]) * 255
|
| 149 |
+
|
| 150 |
print("DEBUG: control_image_torch")
|
| 151 |
+
control_image_torch = get_image_latent(control_image, sample_size=sample_size)[:, :, 0]
|
| 152 |
|
| 153 |
# generation
|
| 154 |
if randomize_seed: seed = random.randint(0, MAX_SEED)
|