Spaces:
Runtime error
Runtime error
Update pipeline_stable_diffusion_xl_instantid_img2img.py
Browse files
pipeline_stable_diffusion_xl_instantid_img2img.py
CHANGED
|
@@ -734,16 +734,16 @@ class StableDiffusionXLInstantIDImg2ImgPipeline(StableDiffusionXLControlNetImg2I
|
|
| 734 |
controlnet = self.controlnet._orig_mod if is_compiled_module(self.controlnet) else self.controlnet
|
| 735 |
|
| 736 |
# align format for control guidance
|
| 737 |
-
if isinstance(
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
control_guidance_start =
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
|
| 748 |
# 1. Check inputs. Raise error if not correct
|
| 749 |
self.check_inputs(
|
|
|
|
| 734 |
controlnet = self.controlnet._orig_mod if is_compiled_module(self.controlnet) else self.controlnet
|
| 735 |
|
| 736 |
# align format for control guidance
|
| 737 |
+
if not isinstance(control_guidance_start, list) and isinstance(control_guidance_end, list):
|
| 738 |
+
control_guidance_start = len(control_guidance_end) * [control_guidance_start]
|
| 739 |
+
elif not isinstance(control_guidance_end, list) and isinstance(control_guidance_start, list):
|
| 740 |
+
control_guidance_end = len(control_guidance_start) * [control_guidance_end]
|
| 741 |
+
elif not isinstance(control_guidance_start, list) and not isinstance(control_guidance_end, list):
|
| 742 |
+
mult = len(controlnet.nets) if isinstance(controlnet, MultiControlNetModel) else 1
|
| 743 |
+
control_guidance_start, control_guidance_end = (
|
| 744 |
+
mult * [control_guidance_start],
|
| 745 |
+
mult * [control_guidance_end],
|
| 746 |
+
)
|
| 747 |
|
| 748 |
# 1. Check inputs. Raise error if not correct
|
| 749 |
self.check_inputs(
|