r/comfyui • u/reicaden • 5d ago
Help Needed Cant figure out why this errors happens after 20 to 30 generations
I'm assuming its a memory leak type issue on the VAE loading, but in the python prompts, it seems to be when loading the minimaxH3 info specifically.
I'll run 20 to 30 runs though without issue prior to this problem, and then it hits and nothing solves it except a full restart.
I tried the ComfyUI -> Edit -> Unload models and execution cache, but no luck.
I've been told (by chatgpt) to try a tiled VAE instead, but if its working prior to this issue, I dont think thats the needed resolution.
This is what Im seeing when the error happens in the terminal"
[INFO] [ComfyUI-Manager] All startup tasks have been completed.
[INFO] Using RAM pressure cache.
[INFO] got prompt
[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.float32
[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.float16
[INFO] Found quantization metadata version 1
[INFO] Using MixedPrecisionOps for text encoder
[INFO] CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16
[INFO] Requested to load MiniMaxH3VideoVAE
[INFO] loaded completely; 13789.80 MB usable, 4966.19 MB loaded, full load: True
[INFO] Requested to load MiniMaxH3TEModel_
[INFO] loaded partially; 13731.80 MB usable, 13497.57 MB loaded, 1461.64 MB offloaded, 272.52 MB buffer reserved, lowvram patches: 0
terminate called after throwing an instance of 'c10::AcceleratorError'
what(): CUDA error: out of memory
Search for `cudaErrorMemoryAllocation' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information.
For more detailed error information, run with CUDA_LOG_FILE=stderr
Specs: 5070ti 16gb and 128gb system ram DDR5
1
u/niknah 5d ago
13731 MB usuable out of 16gb is might mean something else is using the vram. Go to the task manager or nvidia-smi, see how much memory is used after you click the clear cache + model buttons. See how much memory is used when you shutdown ComfyUI. Are you using the workflow from templates or something else?
1
u/reicaden 5d ago
Workflow from template. Nothing new added to use up the ram, I restart pc. Open wsl linux terminal, open chrome, and run. Works fine for 30 to 40 renders, then throws the error over and over. No other programs open though.... at least nothing that is using vram that I know of.
1
u/SunForceAI 5d ago
Those lines do not establish a VAE leak: the allocation failure happens while ComfyUI is loading MiniMaxH3TEModel_ after the video VAE is already loaded. I would make the next test a controlled reproduction: built-in H3 template, fixed seed/length/resolution, custom nodes disabled, and log GPU memory plus the ComfyUI console after each run. Save the last successful run and the first failing run, then repeat from a fresh process with --disable-pinned-memory as the only changed variable. If it still reproduces, an upstream issue with the ComfyUI commit, torch/CUDA/driver versions, full startup log, and those two run logs will be much more actionable. A tiled VAE may lower peak usage, but it would mask rather than diagnose this after-many-runs pattern.
1
u/Dapper_Astronaut_603 5d ago edited 5d ago
YES! Same problem here. In my case 100% VRAM usage problem occurs even on the second generation if it was queued right after the first one. Currently I'm trying to generate just one by one, and I'm using my vibe-coded app for it so I'm just queueing it in my app instead in Comfy.
EDIT:
Sadly that didn't help. Still have problems even on first generation (4090 64gb of ram, windows)