InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- computer-vision
Research direction
Start by reading InpaintProcessor.preprocess() in src/diffusers/image_processor.py and follow how it infers image dimensions when height or width is omitted. Reproduce the failure with the issue's CPU example, then check nearby image processor tests for where to add a regression case. Done when preprocessing with padding_mask_crop succeeds with either dimension omitted and the regression test passes.
Written by the indexing model from the issue text.
Description
InpaintProcessor.preprocess() works without height and width until I set padding_mask_crop. With cropping enabled, omitting either dimension raises a TypeError.
from PIL import Image
from diffusers.image_processor import InpaintProcessor
image = Image.new("RGB", (64, 48))
mask = Image.new("L", image.size)
mask.paste(255, (24, 16, 40, 32))
InpaintProcessor().preprocess(image, mask=mask, padding_mask_crop=8)
TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'
Passing both dimensions works. The crop calculation divides width by height before the processor has inferred the missing dimensions. I expected the omitted dimensions to be inferred from the input image, as they are without cropping.
Reproduced on main at 08d5de30 (Diffusers 0.44.0.dev0) on CPU. No model weights are needed.
Would it make sense to reuse the image processor's existing size inference before computing the crop? I can send a small PR with a regression test if that approach looks right.
- Dominant language
- Python
- Stars
- 35k
- Forks
- 7.5k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/diffusers
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
huggingface/diffusers#15436 · 1 comment ·
Maintainers usually reply within 1 day
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Possibly taken @hparik11 claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
huggingface/diffusers#15423 · 2 comments ·
Maintainers usually reply within 1 day
-
Docs: 13 docstrings document parameters their functions don't havePossibly taken @M-Colley claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
huggingface/diffusers#15363 · 2 comments ·
Maintainers usually reply within 1 day
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorPossibly taken @chessing234 claimed this 11 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/diffusers#15337 · 3 comments ·
Maintainers usually reply within 1 day
-
Multi-vector textual inversion uses only the first vector when the token has uppercase letters (transformers v5)Possibly taken @houyunsun claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
huggingface/diffusers#15313 ·
Maintainers usually reply within 1 day
All issues in huggingface/diffusers
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-connect#1266 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
biosustain/growthcurves_app#89 ·
Maintainers usually reply within 1 day
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
canonical/loki-k8s-operator#695 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day