This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
Model loading #11
PrincipalSkinner
started this conversation in
Ideas
Replies: 1 comment
-
Those are some good changes, I've already implemented changing pipelines and schedulers, but not changing models on the fly. Running the garbage collection is a good idea. I may add a "kill pipe" button. I've just been stop the script using the command prompt window. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Your UI was the best I found when I started a few weeks ago. Since then, I've built onto it and I see you have too. I just thought I'd share something I did that I think you would find beneficial.
Loading a model at the start is annoying, especially if you have quit to start up again just to change models. I fixed this in mine. I do not load a model at start (I have no args available at all, actually). What I do is give a dropdown with the list of models (populated however -- I check a ./models/ directory). When the Generate button is clicked, it checks the pipe for a few things. If pipe is None, then it loads the scheduler/model. If the pipe is NOT None, then it checks the previously selected model (saved in a variable when the model is loaded) and compares against the current selected model. If they are the same, nothing is done to the pipe. If they are NOT the same, load the newly selected model. Initially this ran into an issue of running out of memory (boo 8gb cards). To fix that I called del pipe and ran garbage collection before loading the new model. Haven't had an issue since.
With the scheduler, I have the same set up with one exception. If the scheduler is changed you do NOT have to reload the model. You can change it on the pipe directly and instantly. However, be careful because some people (me, specifically) are stupid and like to change schedulers while it's generating .. and that crashes. So changing scheduler on the fly when NOT generating is fine. I have mine change ONLY in the "prep" stages of the generate function, so there's no chance I can blow things up again.
I also gave myself a "Kill Pipe" button so that if I want to use my computer for other things between generating images, I can release the RAM/VRAM while I do whatever it is. Might be another idea for you to add.
I will note that I'm exceptionally new at python (I'm well pretty versed in other languages), so if there are issues with doing this that I'm not realizing I'd be grateful to hear about them.
Beta Was this translation helpful? Give feedback.
All reactions