Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,12 +20,12 @@ controlnet_tile = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Ti
|
|
| 20 |
pipe_canny = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 21 |
"stabilityai/stable-diffusion-3-medium-diffusers",
|
| 22 |
controlnet=controlnet_canny
|
| 23 |
-
)
|
| 24 |
|
| 25 |
pipe_tile = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 26 |
"stabilityai/stable-diffusion-3-medium-diffusers",
|
| 27 |
controlnet=controlnet_tile
|
| 28 |
-
)
|
| 29 |
|
| 30 |
def resize_image(input_path, output_path, target_height):
|
| 31 |
# Open the input image
|
|
@@ -67,7 +67,7 @@ def infer_canny(image_in, prompt, control_type, inference_steps, guidance_scale,
|
|
| 67 |
pipe = pipe_tile
|
| 68 |
control_image = load_image(image_in)
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
# infer
|
| 73 |
image = pipe(
|
|
|
|
| 20 |
pipe_canny = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 21 |
"stabilityai/stable-diffusion-3-medium-diffusers",
|
| 22 |
controlnet=controlnet_canny
|
| 23 |
+
).to("cuda", torch.float16)
|
| 24 |
|
| 25 |
pipe_tile = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 26 |
"stabilityai/stable-diffusion-3-medium-diffusers",
|
| 27 |
controlnet=controlnet_tile
|
| 28 |
+
).to("cuda", torch.float16)
|
| 29 |
|
| 30 |
def resize_image(input_path, output_path, target_height):
|
| 31 |
# Open the input image
|
|
|
|
| 67 |
pipe = pipe_tile
|
| 68 |
control_image = load_image(image_in)
|
| 69 |
|
| 70 |
+
|
| 71 |
|
| 72 |
# infer
|
| 73 |
image = pipe(
|