Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ from diffusers.utils import load_image
|
|
16 |
# load pipeline
|
17 |
global pipe_canny
|
18 |
global pipe_tile
|
|
|
19 |
controlnet_canny = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Canny")
|
20 |
controlnet_tile = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Tile")
|
21 |
|
@@ -57,7 +58,7 @@ def infer(image_in, prompt, control_type, inference_steps, guidance_scale, contr
|
|
57 |
n_prompt = 'NSFW, nude, naked, porn, ugly'
|
58 |
|
59 |
if control_type == "canny":
|
60 |
-
|
61 |
pipe.to("cuda", torch.float16)
|
62 |
# Canny preprocessing
|
63 |
image_to_canny = load_image(image_in)
|
@@ -70,7 +71,7 @@ def infer(image_in, prompt, control_type, inference_steps, guidance_scale, contr
|
|
70 |
control_image = image_to_canny
|
71 |
|
72 |
elif control_type == "tile":
|
73 |
-
|
74 |
pipe.to("cuda", torch.float16)
|
75 |
control_image = load_image(image_in)
|
76 |
|
|
|
16 |
# load pipeline
|
17 |
global pipe_canny
|
18 |
global pipe_tile
|
19 |
+
global pipe
|
20 |
controlnet_canny = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Canny")
|
21 |
controlnet_tile = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Tile")
|
22 |
|
|
|
58 |
n_prompt = 'NSFW, nude, naked, porn, ugly'
|
59 |
|
60 |
if control_type == "canny":
|
61 |
+
pipe = pipe_canny
|
62 |
pipe.to("cuda", torch.float16)
|
63 |
# Canny preprocessing
|
64 |
image_to_canny = load_image(image_in)
|
|
|
71 |
control_image = image_to_canny
|
72 |
|
73 |
elif control_type == "tile":
|
74 |
+
pipe = pipe_tile
|
75 |
pipe.to("cuda", torch.float16)
|
76 |
control_image = load_image(image_in)
|
77 |
|