fix(diffusion): inherit cpu offload hooks in from_pipe pipelines - #5759
Open
ChristianGruend wants to merge 3 commits into
Open
fix(diffusion): inherit cpu offload hooks in from_pipe pipelines#5759ChristianGruend wants to merge 3 commits into
ChristianGruend wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
from_pipe()does not carry over CPU offload hooks from the source pipeline. When--cpu-offloadis enabled, inpaint and img2img pipelines created viafrom_pipe()load their shared components fully onto the GPU instead of respecting the offload setting, causing an out-of-memory crash.Target branch
dev.Linked Issue
Fixes #5759 — no separate issue was opened; the bug was discovered and fixed directly while testing CPU offload with inpaint/img2img pipelines.
Type of Change
Checklist
docker compose up) and verified the change works end-to-end.How to Test
--cpu-offloadenabled.from_pipe()internally to share the base pipeline).enable_model_cpu_offload()is called explicitly and the pipeline runs without OOM.Visual / UI changes
Not applicable — this is a backend-only fix in
scripts/diffusion_server.py, no UI/rendering code touched.