Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,9 +89,6 @@ def generate(
|
|
89 |
mask_image = load_image(mask_url)
|
90 |
|
91 |
if use_controlnet:
|
92 |
-
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16)
|
93 |
-
pipe = StableDiffusionControlNetPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16)
|
94 |
-
|
95 |
image = load_image(img_url)
|
96 |
image = np.array(image)
|
97 |
|
@@ -100,6 +97,9 @@ def generate(
|
|
100 |
image = image[:, :, None]
|
101 |
image = np.concatenate([image, image, image], axis=2)
|
102 |
canny_image = Image.fromarray(image)
|
|
|
|
|
|
|
103 |
|
104 |
if use_lora:
|
105 |
pipe.load_lora_weights(lora)
|
|
|
89 |
mask_image = load_image(mask_url)
|
90 |
|
91 |
if use_controlnet:
|
|
|
|
|
|
|
92 |
image = load_image(img_url)
|
93 |
image = np.array(image)
|
94 |
|
|
|
97 |
image = image[:, :, None]
|
98 |
image = np.concatenate([image, image, image], axis=2)
|
99 |
canny_image = Image.fromarray(image)
|
100 |
+
|
101 |
+
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16)
|
102 |
+
pipe = StableDiffusionControlNetPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16)
|
103 |
|
104 |
if use_lora:
|
105 |
pipe.load_lora_weights(lora)
|