-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Deduplicate sampling/demo code #76
base: main
Are you sure you want to change the base?
Conversation
6020210
to
5aef27f
Compare
…el mover context, and deduplicate
I didn't see this before starting on #102 or it would have saved me some work :( Regardless, I think I addressed the same things here, but let me know if you spot anything missing or have feedback on it. I believe my model swapping method ends up more flexible? |
Sorry you ended up doing duplicate work. I should have maybe pinged you harder here... (Maybe it'd be worth it to review the rest of my open PRs to avoid more of the same..?) I'm currently on vacation so it's a bit hard to review and compare the PRs, sorry 🏖️ |
This PR deduplicates the code inadvertently readded in #69 to use the refactored helpers implemented in #57.
Most of the commits are simple mechanical refactorings, aside from:
sgm.util.load_model_from_config
had to be changed not tomodel.eval()
(which was already done in Minimal txt2img example #60)do_sample
anddo_txt2img
from the sampling demo with the refactored helpers, and adds a newmove_model
context manager argument to implement low-VRAM mode. (I think it turned out pretty elegant.)👉 Since I do not have a beefy enough CUDA device at my easy disposal, I didn't test the streamlit demo yet.