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

Deduplicate sampling/demo code #76

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Deduplicate sampling/demo code #76

wants to merge 10 commits into from

Conversation

akx
Copy link
Contributor

@akx akx commented Jul 27, 2023

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 to model.eval() (which was already done in Minimal txt2img example #60)
  • the last commit, which merges the edited do_sample and do_txt2img from the sampling demo with the refactored helpers, and adds a new move_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.

@akx akx mentioned this pull request Jul 27, 2023
@akx akx force-pushed the dedupe branch 2 times, most recently from 6020210 to 5aef27f Compare July 27, 2023 08:32
@palp
Copy link
Member

palp commented Aug 7, 2023

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?

@akx
Copy link
Contributor Author

akx commented Aug 8, 2023

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 🏖️

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