Update app.py
Browse files
app.py
CHANGED
|
@@ -104,6 +104,7 @@ def infer(
|
|
| 104 |
if not use_controlnet:
|
| 105 |
pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch_dtype)
|
| 106 |
else:
|
|
|
|
| 107 |
controlnet = ControlNetModel.from_pretrained(
|
| 108 |
controlnet_mode, torch_dtype=torch_dtype)
|
| 109 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
@@ -119,6 +120,7 @@ def infer(
|
|
| 119 |
pipe.unet = lora
|
| 120 |
|
| 121 |
if use_ip_adapter:
|
|
|
|
| 122 |
pipe.load_ip_adapter(
|
| 123 |
"h94/IP-Adapter",
|
| 124 |
subfolder="models",
|
|
|
|
| 104 |
if not use_controlnet:
|
| 105 |
pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch_dtype)
|
| 106 |
else:
|
| 107 |
+
controlnet_image = cv2.resize(controlnet_image, (width, height), interpolation=cv2.INTER_AREA)
|
| 108 |
controlnet = ControlNetModel.from_pretrained(
|
| 109 |
controlnet_mode, torch_dtype=torch_dtype)
|
| 110 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
|
|
| 120 |
pipe.unet = lora
|
| 121 |
|
| 122 |
if use_ip_adapter:
|
| 123 |
+
ip_adapter_image = cv2.resize(ip_adapter_image, (width, height), interpolation=cv2.INTER_AREA)
|
| 124 |
pipe.load_ip_adapter(
|
| 125 |
"h94/IP-Adapter",
|
| 126 |
subfolder="models",
|