kabachuha / sd-webui-text2video

Auto1111 extension implementing text2video diffusion models (like ModelScope or VideoCrafter) using only Auto1111 webui dependencies
Other
1.28k stars 107 forks source link

add option to keep pipe in memory #26

Closed nagolinc closed 1 year ago

nagolinc commented 1 year ago

Add an option to keep the pipe in memory between runs (much faster, but uses about 5gb of ram)

hithereai commented 1 year ago

Please keep your PRs on topic next time, you changed formatting of many things too. :)

I will revert whatever is not needed and confirm, as the core change is working.

I'd prefer to not use a global in general but for now it will work. Can probably implement it differently in the near future.

Thanks for your contribution!

kabachuha commented 1 year ago

We'll need something like a button to unload the pipe after the last run is it's selected, or it will occupy VRAM after all generations have finished and hinder the Stable Diffusion checkpoint

But it's a matter for a further change, I guess

nagolinc commented 1 year ago

@hithereai Thanks! Sorry about the formatting issues (my text editor automatically changed a bunch of stuff when I save).

@kabachuha I believe that as I have it implemented, the pipeline will unload if you unclick "keep pipeline.." and re-generate.

hithereai commented 1 year ago

If you uncheck the new keep in vram param it will unload after the next run. So when you click generate it will still use it since it's still in VRAM. But after that run is done, it will get unloaded.

@kabachuha want to add a dedicated button to clear it out of vram so that you won't have to generate another video just to remove it from vram, I believe.

nagolinc commented 1 year ago

Does gradio let you listen for onchange events so we can unload it as soon as the box is unchecked? Adding another button seems excessive.

kabachuha commented 1 year ago

@nagolinc yes, it does allow that. Checkboxes in Deforum are opening/hiding new settings rows in the UI on click