mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
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: Teriks <Teriks@users.noreply.github.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user