Skip to content

Fix InpaintProcessor output when no mask is provided - #14807

Open
lindicaphxag-tech wants to merge 1 commit into
huggingface:mainfrom
lindicaphxag-tech:fix-inpaint-processor-return-contract
Open

lindicaphxag-tech wants to merge 1 commit into
huggingface:mainfrom
lindicaphxag-tech:fix-inpaint-processor-return-contract

Conversation

@lindicaphxag-tech

@lindicaphxag-tech lindicaphxag-tech commented Sep 18, 2026

Copy link
Copy Markdown

Fixes #14470.

InpaintProcessor.preprocess returns three values when a mask is present, but the no-mask early return only returned the processed image. Direct callers that rely on the tuple contract then fail while unpacking the result.

The no-mask path now returns the processed image, None for the mask, and empty overlay metadata. The return annotation and a focused regression test cover that path.

Validation run locally:

  • git diff --check

The targeted pytest command could not start in this checkout because Pillow is not installed locally. CI remains the source of truth for the full dependency environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes-issue size/S PR with diff < 50 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InpaintProcessor.preprocess returns a bare tensor when no mask is passed, breaking its own 3-value contract

1 participant