Skip to content

Fix wrong variable in multi-ControlNet check_inputs#14156

Open
sridhar-3009 wants to merge 1 commit into
huggingface:mainfrom
sridhar-3009:fix/14057-controlnet-img2img-variable-name
Open

Fix wrong variable in multi-ControlNet check_inputs#14156
sridhar-3009 wants to merge 1 commit into
huggingface:mainfrom
sridhar-3009:fix/14057-controlnet-img2img-variable-name

Conversation

@sridhar-3009

Copy link
Copy Markdown

What does this PR fix?

Fixes #14057.

In pipeline_controlnet_img2img.py and pipeline_controlnet_inpaint.py, the multi-ControlNet branch of check_inputs() was referencing the image variable (the input image) where it should reference control_image (the ControlNet conditioning image). This caused type/length validation to run against the wrong variable when using MultiControlNetModel.

Changes

  • Added control_image as a new parameter to check_inputs() in both files.
  • Updated the multi-ControlNet branch to validate control_image instead of image, including updating the TypeError/ValueError messages to name the correct parameter.
  • Updated the self.check_inputs() call sites to pass image (the input image) and control_image (the ControlNet conditioning image) as separate arguments, so each variable is checked against the right input.

The single-ControlNet branch is unchanged — it continues to validate image as before.

In pipeline_controlnet_img2img.py and pipeline_controlnet_inpaint.py,
the multi-ControlNet branch of check_inputs() was checking the `image`
variable (the input image) where it should check `control_image` (the
ControlNet conditioning image). This caused incorrect type/length
validation against the wrong variable.

Fix by:
- Adding `control_image` as a new parameter to check_inputs() in both files
- Updating the multi-ControlNet branch to use `control_image` instead of `image`
- Updating the self.check_inputs() call sites to pass `image` and
  `control_image` as separate arguments

Fixes huggingface#14057
@github-actions github-actions Bot added pipelines size/S PR with diff < 50 LOC fixes-issue labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SD1.5 - pipeline_controlnet_img2img and pipeline_controlnet_inpaint are mixing variables "image" and "control_image"

1 participant