Spaces:
Running
on
Zero
Running
on
Zero
Update raw.py
Browse files
raw.py
CHANGED
|
@@ -55,15 +55,16 @@ def generate_image(prompt, scale, steps, control_image, controlnet_conditioning_
|
|
| 55 |
# Upscale x1
|
| 56 |
control_image = control_image.resize((int(w * scale), int(h * scale)), resample=2) # Resample.BILINEAR
|
| 57 |
print("Size to: " + str(control_image.size[0]) + ", " + str(control_image.size[1]))
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
| 67 |
return image
|
| 68 |
|
| 69 |
# Create Gradio interface with rows and columns
|
|
|
|
| 55 |
# Upscale x1
|
| 56 |
control_image = control_image.resize((int(w * scale), int(h * scale)), resample=2) # Resample.BILINEAR
|
| 57 |
print("Size to: " + str(control_image.size[0]) + ", " + str(control_image.size[1]))
|
| 58 |
+
with torch.inference_mode():
|
| 59 |
+
image = pipe(
|
| 60 |
+
prompt=prompt,
|
| 61 |
+
control_image=control_image,
|
| 62 |
+
controlnet_conditioning_scale=controlnet_conditioning_scale,
|
| 63 |
+
num_inference_steps=steps,
|
| 64 |
+
guidance_scale=guidance_scale,
|
| 65 |
+
height=control_image.size[1],
|
| 66 |
+
width=control_image.size[0]
|
| 67 |
+
).images[0]
|
| 68 |
return image
|
| 69 |
|
| 70 |
# Create Gradio interface with rows and columns
|