PRX pipelines ignore the dict returned by callback_on_step_end
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
调研方向
Read pipeline_prx.py around line 806 and pipeline_prx_pixel.py around line 642, then inspect the callback tests in tests/pipelines/prx/test_pipeline_prx.py and test_pipeline_prx_pixel.py. The issue describes the expected change and the failing assertion; run pytest tests/pipelines/prx -k callback --runxfail to confirm it, then check that the tests pass after the callback outputs are applied. A linked pull request is already open.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
PRXPipeline and PRXPixelPipeline call callback_on_step_end but throw away the dict it returns:
callback_on_step_end(self, i, t, callback_kwargs)
(pipeline_prx.py around line 806, pipeline_prx_pixel.py around line 642). So a callback that changes latents has no effect. Every other pipeline pops the returned keys back, e.g. latents = callback_outputs.pop("latents", latents).
The test suite already knows about this: tests/pipelines/prx/test_pipeline_prx.py and test_pipeline_prx_pixel.py mark test_callback_inputs with a strict xfail (CALLBACK_OUTPUTS_IGNORED), with the note that "whoever adds the pop-back will see it XPASS and can drop this marker".
I'd like to open a PR for this: assign the callback output and pop latents back in both pipelines (+4 lines), and remove the two xfail markers. I left prompt_embeds out on purpose: it's in _callback_tensor_inputs, but it isn't read inside the denoising loop after the cross-attention embeddings are built, so popping it would change nothing.
Reproduction
The existing test, with the xfail marker ignored:
pytest tests/pipelines/prx -k callback --runxfail
On main (4f78832):
FAILED tests/pipelines/prx/test_pipeline_prx.py::TestPRXPipeline::test_callback_inputs
FAILED tests/pipelines/prx/test_pipeline_prx_pixel.py::TestPRXPixelPipeline::test_callback_inputs
2 failed, 2 passed, 73 deselected
The failing assertion is assert output.abs().sum() == 0: the test's callback sets latents to zeros on the last step, but the output isn't zero because the edit is dropped.
With the fix, pytest tests/pipelines/prx gives 61 passed, 16 skipped.
I verified this with the tiny components from the test suite only; I didn't run the Photoroom/prx-512-t2i-sft checkpoint.
Logs
No response
System Info
- 🤗 Diffusers version: 0.44.0.dev0 (main @ 4f78832)
- Platform: macOS-26.6.2-arm64-arm-64bit
- Python version: 3.12.16
- PyTorch version (GPU?): 2.15.0 (False)
- Huggingface_hub version: 2.4.0
- Transformers version: 5.23.0
- Accelerate version: 1.16.0
Who can help?
@DN6 @yiyixuxu
- 主要语言
- 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 天内回复
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15433 ·
维护者通常 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 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 79/100
developmentseed/titiler-covjson#164 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
awslabs/visual-asset-management-system#2164 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
维护者通常 1 天内回复
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocket未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复