Skip to content
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

Make sure --free_gpu_mem still works when using CKPT-based diffuser model #2367

Merged
merged 5 commits into from
Jan 24, 2023

Conversation

addianto
Copy link
Contributor

@addianto addianto commented Jan 19, 2023

This PR attempts to fix --free_gpu_mem option that was not working in CKPT-based diffuser model after #1583.

I noticed that the memory usage after #1583 did not decrease after generating an image when --free_gpu_mem option was enabled.
It turns out that the option was not propagated into Generator instance, hence the generation will always run without the memory saving procedure.

This PR also related to #2326. Initially, I was trying to make --free_gpu_mem works on 🤗 diffuser model as well.
In the process, I noticed that InvokeAI will raise an exception when --free_gpu_mem is enabled.
I tried to quickly fix it by simply ignoring the exception and produce a warning message to user's console.

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

Thank you. This looks good to me and I'll merge once I've tested it.

@lstein lstein enabled auto-merge January 24, 2023 02:42
@lstein lstein merged commit 884768c into invoke-ai:main Jan 24, 2023
@addianto addianto deleted the bugfix/free-gpu-mem-diffuser branch January 24, 2023 05:50
@addianto
Copy link
Contributor Author

Thank you for merging this. 👍🎉

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.

2 participants