Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,8 +111,8 @@ def predict(
|
|
| 111 |
|
| 112 |
img = np.array(input_image.convert("RGB"))
|
| 113 |
|
| 114 |
-
W = int(np.shape(img)[
|
| 115 |
-
H = int(np.shape(img)[
|
| 116 |
|
| 117 |
input_image = input_image.resize((H, W))
|
| 118 |
uploaded_mask = uploaded_mask.resize((H, W))
|
|
@@ -128,8 +128,8 @@ def predict(
|
|
| 128 |
prompt=prompt,
|
| 129 |
control_image=input_image.convert("RGB"),
|
| 130 |
control_mask=uploaded_mask.convert("RGB"),
|
| 131 |
-
width=
|
| 132 |
-
height=
|
| 133 |
num_inference_steps=ddim_steps,
|
| 134 |
generator=torch.Generator("cuda").manual_seed(seed),
|
| 135 |
guidance_scale=scale,
|
|
|
|
| 111 |
|
| 112 |
img = np.array(input_image.convert("RGB"))
|
| 113 |
|
| 114 |
+
W = int(np.shape(img)[1] - np.shape(img)[1] % 16)
|
| 115 |
+
H = int(np.shape(img)[0] - np.shape(img)[0] % 16)
|
| 116 |
|
| 117 |
input_image = input_image.resize((H, W))
|
| 118 |
uploaded_mask = uploaded_mask.resize((H, W))
|
|
|
|
| 128 |
prompt=prompt,
|
| 129 |
control_image=input_image.convert("RGB"),
|
| 130 |
control_mask=uploaded_mask.convert("RGB"),
|
| 131 |
+
width=W,
|
| 132 |
+
height=H,
|
| 133 |
num_inference_steps=ddim_steps,
|
| 134 |
generator=torch.Generator("cuda").manual_seed(seed),
|
| 135 |
guidance_scale=scale,
|