Skip to content

Fix InpaintProcessor output when no mask is provided - #14807

Closed
lindicaphxag-tech wants to merge 2 commits into
huggingface:mainfrom
lindicaphxag-tech:fix-inpaint-processor-return-contract
Closed

lindicaphxag-tech wants to merge 2 commits 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.

@lindicaphxag-tech

Copy link
Copy Markdown
Author

Closing this duplicate in favor of the earlier #14481. That PR fixes the same no-mask tuple contract, uses a precise optional-mask return type, and has broader coverage for masked and padding-crop paths.

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