comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
57.82k stars 6.13k forks source link

Clearing V-ram when pressing "cancel" button. #5762

Open ZeTofZone opened 1 day ago

ZeTofZone commented 1 day ago

Feature Idea

Hi.

I just remark that if I press the "cancel" button, and press again "Queue", the v-ram is not cleared. I used the nodes "ComfyUI_Searge_LLM" (https://github.com/SeargeDP/ComfyUI_Searge_LLM) and when running automatically (queue prompt => auto queue) this run smoothly. But if I press the cancel button, the next prompt have to load again the LLM model which take a lot of time. In fact it occupy more than my 8Gb vram in this case. I'm running in a RTX 3060 Ti with 8Gb of vram and my processor is an i7-11700 with 32Gb of ram. I have an extension (don't know which one, could be "tinyterraNodes but not sure) which add a button "Clean up of VRAM usage", and when I press this button after to stop (canceled) the generation, the need of reloading the model is not present and it works like if I didn't press the "cancel" button.

That mean, I believe, there is an action which is done in "normal" (not canceled) run which clear the vram, which is not done when the generation is canceled.

To be clear, here is a resume of the situation :

I just don't want to have to stop the "auto-queue", have to press the "clear vram" and launch again.

Thanks in advance !!

Existing Solutions

Seems to have an option in the "tinyterraNodes" which is doing this very well (but manually).

Other

No response

LukeG89 commented 1 day ago

Have you tried using Manager's Unload Models and Free model and node chace?

image

Also, have you tried other extensions to clear memory? Like these ones: