PRX pipelines ignore the dict returned by callback_on_step_end
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Domínio
- machine-learning
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 35k
- Forks
- 7.5k
- Merge médio
- 2d 22h
- PRs com merge (30d)
- 58
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de huggingface/diffusers
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15436 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15433 ·
Mantenedores costumam responder em até 1 dia
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Talvez já em andamento @hparik11 assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
huggingface/diffusers#15423 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Docs: 13 docstrings document parameters their functions don't haveTalvez já em andamento @M-Colley assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
huggingface/diffusers#15363 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorTalvez já em andamento @chessing234 assumiu há 11 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
huggingface/diffusers#15337 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de huggingface/diffusers
Issues semelhantes
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 79/100
developmentseed/titiler-covjson#164 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
awslabs/visual-asset-management-system#2164 ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
MakazhanAlpamys/Soup#3589 ·
Mantenedores costumam responder em até 1 dia
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia