You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PRX pipelines ignore the dict returned by callback_on_step_end #15355
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.
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.
Activity