Diffusion Single File
comfyui

Model Reloads on prompt/image change?

#38
by Dalvogalbo2 - opened

I have 6GB VRAM and 48GB RAM. i still have 12GB RAM unused after it finishes the video generation, but every time i change the prompt or image and start the workflow it drops the RAM usage to like 40% and reloads the diffusion model from HDD/SSD.

I'm using...
w4a8 diffusion Model - 11 GB
Q2 Text encoder - 8 GB
Video Vae INT8 convrot - 2.9 GB
Audio Vae (default)
Turbo Lora lightx2v

the generated video looks fine but i need to stop diffusion model reload on each run. any possible fixes that keeps the model in RAM and prevents offloads please?

to mention further i've tried all these changes in startup bat file :
--lowvram
--high-ram
--cache-ram
--disable-dynamic-vram
--cache-classic
(not all together of course!)
but none of these worked

I have 6GB VRAM and 48GB RAM. i still have 12GB RAM unused after it finishes the video generation, but every time i change the prompt or image and start the workflow it drops the RAM usage to like 40% and reloads the diffusion model.

I'm using...
w4a8 diffusion Model - 11 GB
Q2 Text encoder - 8 GB
Video Vae INT8 convrot - 2.9 GB
Audio Vae (default)
Turbo Lora lightx2v

the generated video looks fine but i need to stop diffusion model reload on each run. any possible fixes that keeps the model in RAM and prevents offloads please?

If you have 6GB VRAM, you cannot expect to be different. Even if you made a typo and had 16GB VRAM, VAE and TE will still need to make room and free the VRAM for their turn.

thanks for the reply.
i thought to free the VRAM it offloads the models from VRAM to RAM instead of the HDD (in my case it reloads the model from HDD and bc of that "model initializing..." takes too long before continuing the generation). after it finishes the video generation, it fully utilizes the RAM, doesn't it? but even then i have free 12GB of RAM left. so i guess it requires a lot more free RAM than that?

although i also use KREA2 INT convrot, if sum up the model TE and vae, it is around 17-18 GB but it does not reload the model from HDD on prompt change.

some users with high VRAM and RAM are also having this issue. i'm tying to know if there's a probable fix for that.
https://github.com/Comfy-Org/ComfyUI/issues/14618?timeline_page=1

I dont think many people realize how many resources making AI video actually takes... My 16gb vram is full in SECONDS.. My 80GB ram is full many times over and my 128gb ssd swap drive is in constant use.

rtx 5090 will still offload a crap ton to work... It will still shift things from vram to ram to swap space CONSTANTLY.
The models we are using are huge, but then there is the clip, then the vae's, then guess what most people dont even think about... The videos. These videos are UNCOMPRESSED RAW videos. They take HUGE amounts of memory to hold them. The fact it works on any card with less than 16gb vram is a miracle. And 32gb ram ... IS NOTHING because its full the moment you try to run a video workflow. My 80GB ram is always full.

The Vram in use when your done your video is... the video. The model is offloaded.

Sign up or log in to comment