InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
先阅读 src/diffusers/image_processor.py 中的 InpaintProcessor.preprocess(),追踪省略 height 或 width 时图像尺寸的推断方式。使用 issue 中的 CPU 示例重现故障,然后检查附近的图像处理器测试,确定应在哪里添加回归测试。省略任一尺寸时,使用 padding_mask_crop 的预处理均能成功,且回归测试通过,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 35k
- 派生
- 7.5k
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15436 · 1 条评论 ·
维护者通常 1 天内回复
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0可能已有人在做 @hparik11 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
huggingface/diffusers#15423 · 2 条评论 ·
维护者通常 1 天内回复
-
Docs: 13 docstrings document parameters their functions don't have可能已有人在做 @M-Colley 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/diffusers#15363 · 2 条评论 ·
维护者通常 1 天内回复
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 于 11 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/diffusers#15337 · 3 条评论 ·
维护者通常 1 天内回复
-
Multi-vector textual inversion uses only the first vector when the token has uppercase letters (transformers v5)可能已有人在做 @houyunsun 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
huggingface/diffusers#15313 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
ClickHouse/clickhouse-connect#1266 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
biosustain/growthcurves_app#89 ·
维护者通常 1 天内回复
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not exist未关闭
难度 2/5 1-3 小时 新手友好度 78/100
canonical/loki-k8s-operator#695 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复