Unverified Commit e89ab5bc authored by Teriks's avatar Teriks Committed by GitHub
Browse files

SDXL ControlNet Union pipelines, make control_image argument immutible (#10663)



controlnet union XL, make control_image immutible

when this argument is passed a list, __call__
modifies its content, since it is pass by reference
the list passed by the caller gets its content
modified unexpectedly

make a copy at method intro so this does not happen
Co-authored-by: default avatarTeriks <Teriks@users.noreply.github.com>
parent 8ceec90d
......@@ -1350,6 +1350,8 @@ class StableDiffusionXLControlNetUnionInpaintPipeline(
if not isinstance(control_image, list):
control_image = [control_image]
else:
control_image = control_image.copy()
if not isinstance(control_mode, list):
control_mode = [control_mode]
......
......@@ -1140,6 +1140,8 @@ class StableDiffusionXLControlNetUnionPipeline(
if not isinstance(control_image, list):
control_image = [control_image]
else:
control_image = control_image.copy()
if not isinstance(control_mode, list):
control_mode = [control_mode]
......
......@@ -1286,6 +1286,8 @@ class StableDiffusionXLControlNetUnionImg2ImgPipeline(
if not isinstance(control_image, list):
control_image = [control_image]
else:
control_image = control_image.copy()
if not isinstance(control_mode, list):
control_mode = [control_mode]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment