Skip to content

Bugfix for SDXL model loading in low ram system. #4628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2023

Conversation

Symbiomatrix
Copy link
Contributor

What does this PR do?

Prevents crashing on system with low ram during load of SDXL models by deferring the unet's transfer to cpu till after tokenizers etc are loaded., right before constructing the pipe. Unless the loads are correlated in some way or I missed some important function in the middle, this should have the same effect and leave only torch to deal with a complete lack of memory.

Fixes # (issue)
#4624, or at least appears to.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sayakpaul sayakpaul requested review from DN6 and yiyixuxu August 16, 2023 06:44
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks!

@patrickvonplaten patrickvonplaten merged commit 863e741 into huggingface:main Aug 24, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
Update convert_from_ckpt.py

Co-authored-by: Patrick von Platen <[email protected]>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
Update convert_from_ckpt.py

Co-authored-by: Patrick von Platen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants