
ComfyUI Load Video Out of Memory? v0.45 RAM Tested
ComfyUI runs out of memory on video because Get Video Components turns every frame into float32, 12 bytes per pixel, and before v0.45.0 it held each frame twice while doing it. One minute of 1080p is about 45 GB before you've done anything with it. v0.45.0 cut the peak from roughly 2x that batch to 1.25x to 1.46x in my test, and 8-bit sources went from 2.5x to as low as 1.15x. On a Mac, though, the default allocator hid most of the gain. Here are the numbers from v0.44.0 and v0.45.0 on the same five clips, and what actually keeps a video workflow inside your RAM.
How Much RAM Does a Video Take in ComfyUI?
More than people expect. Load Video itself is cheap: it hands back a VIDEO object that points at the file. The cost hits at Get Video Components, which decodes the whole thing into one IMAGE batch. For a normal H.264 file it asks PyAV for 32-bit float RGB (gbrpf32le) per frame, so the math is simple:
bytes = frames x width x height x 3 channels x 4 bytes (float32)
360p (640x360) 2.76 MB per frame 10 s @ 30 fps = 0.83 GB
720p (1280x720) 11.06 MB per frame 30 s @ 30 fps = 9.95 GB
1080p (1920x1080) 24.88 MB per frame 60 s @ 30 fps = 44.79 GB
4K (3840x2160) 99.53 MB per frame 10 s @ 30 fps = 29.86 GBThat batch is the floor, not the peak.The output is every frame by design, so no version of ComfyUI makes the batch itself smaller. What changed in v0.45.0 is how much extra memory it needs while building it. If your machine has 32 GB and the batch is 20 GB, the old code needed about 40 GB at its peak, and that's where the crash, the swap storm or the silent worker death comes from.
What Did ComfyUI v0.45.0 Change?
One PR in the v0.45.0 release (November 10) is easy to miss among the partner nodes: #17562, "Get Video Components: hold the decoded frames once, not twice". I read both versions of video_types.py. Up to v0.44.0, each decoded frame went into a Python list and the list was passed to torch.stack at the end, so for a moment every frame existed twice.
The 8-bit path was worse. For full-range sources (yuvj420p, yuvj422p, yuvj444p) and rgb24, rgba and pal8, frames are decoded as uint8 and converted afterwards with a.float() / 255.0. That line makes two full float copies on top of the uint8 list and the uint8 stack. Full-range YUV is common in phone, webcam and screen recordings, and pal8 covers palette formats like GIF.
v0.45.0 replaces the list with one of two stores:
- HostFrames, when DynamicVRAM (comfy-aimdo) is active. That's NVIDIA, and AMD on ROCm 7.14+. Frames go into a reserved host buffer that grows in place. Your log says "DynamicVRAM support detected and enabled" at startup when this is on.
- FrameChunks everywhere else: CPU, Mac, installs without aimdo. Frames go into blocks of up to 32 frames or 256 MiB. At the end the blocks are copied into one tensor and freed one by one, and 8-bit frames are divided by 255 in place, straight into the output.
v0.44.0 vs v0.45.0: Peak RAM on the Same Clips
I cloned both tags on my Mac mini (16 GB, CPU) and called the exact function the node runs, VideoFromFile(clip).get_components(), in a fresh process per run, three runs each. The clips were H.264 with heavy noise so macOS memory compression couldn't flatter the numbers. Peak is the process's lifetime max physical footprint, shown as a multiple of the final batch:
# one process per run, both versions, same clips
from comfy_api.latest._input_impl.video_types import VideoFromFile
fp0, _ = footprint() # proc_pid_rusage v4
comp = VideoFromFile(clip).get_components() # what Get Video Components runs
fp1, peak = footprint() # lifetime max phys_footprint
ratio = (peak - fp0) / comp.images.nbytes| Clip | Batch (MiB) | v0.44.0 peak | v0.45.0 peak | v0.45.0, default macOS malloc |
|---|---|---|---|---|
| 360p, 300 frames, yuv420p | 791 | 2.04x | 1.25x | 2.04-2.11x |
| 720p, 120 frames, yuv420p | 1,266 | 2.05x | 1.46x | 2.07-2.08x |
| 1080p, 60 frames, yuv420p | 1,424 | 2.08x | 1.43x | 2.14x |
| 360p, 300 frames, yuvj420p (8-bit path) | 791 | 2.54x | 1.15x | 1.43-1.45x |
| 720p, 120 frames, yuvj420p (8-bit path) | 1,266 | 2.55x | 1.36x | 1.57-1.60x |
The first two version columns ran with MallocLargeCache=0 (more on that below). The last column is what you get on a stock Mac. The frames came out identical on both versions (same checksum), and v0.45.0 was as fast or faster: the 8-bit 360p clip decoded in about half the time (0.5 s against 1.0 to 1.5 s).
The 8-bit path gained the most: from 2.54x to 1.15x, which is the difference between needing 2 GB and under 1 GB for a 10-second 360p clip. The standard path dropped from about 2x to 1.25x to 1.46x. It doesn't reach the 1.09x the PR measured on Linux because my clips were short. The extra is mostly fixed (a 256 MiB block plus decoder buffers), so the ratio falls as clips get longer. The PR's own test was 300 frames of 1080p, a 7.46 GB batch.
Why Didn't Upgrading Help on My Mac?
This one surprised me. With the stock allocator, v0.45.0 on a standard H.264 clip peaked at 2.04x to 2.14x, the same as v0.44.0. And after the batch was freed, the process stayed charged at about 2x of it (v0.44.0 varied from 1.24x to 2.11x).
The cause is macOS's malloc, not ComfyUI. FrameChunks frees its blocks one at a time while it copies them into the output, which only helps if freed memory leaves the process. macOS keeps large freed blocks in a cache for reuse and still counts them against the process. The switch for that cache is MallocLargeCache, an environment variable that isn't in man malloc but is read in Apple's open-source libmalloc. Setting it to 0 gave me the numbers in the table, and after the batch was deleted, memory went back down to 1% of the batch, against 1.2x to 2.1x with the cache on.
# macOS: return freed large blocks to the system right away
MallocLargeCache=0 python main.pyTwo caveats. The cache exists because it's faster for programs that reuse big blocks, so turning it off can cost some speed elsewhere in ComfyUI. I didn't measure that. And I didn't test how the cached memory behaves under real memory pressure, where the kernel may take some of it back. What I can say is that Activity Monitor and the peak footprint both showed the 2x. If your Mac swaps when a video loads, this is worth a try.
Does Trim Video Before Get Video Components Save RAM?
Yes, and on any version. Trim Video and Crop Video take a VIDEO and return a VIDEO. Trim is as_trimmed(start, duration) and Crop stores the rectangle, so the decoder only keeps frames inside the window, cropped as they arrive. Put them between Load Video and Get Video Components, not after. On the 10-second 360p clip, with the allocator cache off:
- Full clip (300 frames): 1,614 MiB peak on v0.44.0, 989 MiB on v0.45.0.
- Trimmed to 2 s (60 frames): 334 MiB on v0.44.0, 335 MiB on v0.45.0.
- Cropped to 320x180: 414 MiB on v0.44.0, 255 MiB on v0.45.0.
Core ComfyUI has no resize-on-decode and no "every nth frame" option. If you need a 4K source at 720p, or 8 fps instead of 30, re-encode it with ffmpeg before it ever reaches the canvas. The Video Helper Suite custom node has its own loader with a frame cap and frame skipping. It decodes with its own code, so this fix doesn't apply to it, and I didn't test it here.
My Checklist for Video Workflows That Keep Crashing
- Do the math first.Frames x width x height x 12 bytes. If that's more than half your free RAM, the old code was always going to fail.
- Upgrade to v0.45.0 or later.It's a drop-in change. The frames are identical.
- Trim and crop before decoding, using the core video nodes.
- On a Mac, try
MallocLargeCache=0if memory stays high after the node finishes. - Watch the whole graph, not just the loader. Upscalers, interpolators and VAE encodes downstream make their own copies of that batch.
If the job dies with no error in the UI, check whether the worker survived. A dead ComfyUI worker looks exactly like a long queue over the WebSocket API. And if you upgraded and a video custom node stopped loading, here's how I read ComfyUI import failures. For the rest of how I run Comfy in production, see my ComfyUI best practices.
Frequently Asked Questions
Why does ComfyUI run out of memory when I load a video?
Get Video Components decodes every frame into one float32 IMAGE batch, 12 bytes per pixel. One minute of 1080p at 30 fps is about 44.8 GB. Before v0.45.0 it also held each frame twice while building that batch, so peak RAM was about 2x the batch, or 2.5x for 8-bit sources.
Does ComfyUI v0.45 use less RAM for video?
Yes. In my test with the macOS allocator cache off, peak RAM went from 2.04x to 2.08x of the frame batch on v0.44.0 to 1.25x to 1.46x on v0.45.0 for standard H.264, and from 2.54x to 1.15x to 1.36x for 8-bit video. The final batch is the same size, because the output is every frame by design.
Why didn't upgrading ComfyUI lower memory on my Mac?
macOS's allocator caches large freed blocks and still charges them to the process. With the default settings, v0.45.0 still peaked at about 2.04x to 2.14x on standard H.264 in my test, and the memory stayed charged after the node finished. With MallocLargeCache=0 the peak fell to 1.25x to 1.46x and memory went back to the system when the batch was freed.
Does Trim Video reduce memory in ComfyUI?
Yes, when it sits before Get Video Components. Trim Video and Crop Video change the VIDEO object, not an IMAGE batch, so only the trimmed window and cropped area get decoded. Trimming a 10-second 360p clip to 2 seconds cut peak memory from 989 MiB to 335 MiB.
How I Tested
November 18, 2026, on a 16 GB Mac mini in Allen, TX. I made shallow clones of the v0.44.0 and v0.45.0 tags, each with its own Python 3.12 virtualenv from the repo's requirements and CPU PyTorch, and called VideoFromFile.get_components()directly, the method the Get Video Components node calls. I didn't start the server. The five clips came from ffmpeg's testsrc2 with a noise filter, encoded with libx264 at CRF 18, and the full-range copies used -pix_fmt yuvj420p. Each version and clip ran in its own process, three times, and the tables show the first run (the other two matched within 0.07x). Memory is proc_pid_rusagephysical footprint, since RSS undercounts on macOS once pages get compressed. The HostFrames path that NVIDIA installs use wasn't tested, by me or in the PR. All of this ran next to the services on that machine, so swap was already in use, which is the honest version of a real workstation.
Video Workflow Eating Your RAM?
I build ComfyUI pipelines that run unattended on real hardware, from image heroes to video and music. Send me the workflow and the machine specs, and I'll tell you where the memory goes.
Related Posts
AI Models
ComfyUI WebSocket API: Every Message, Tested on 0.33
I captured every ComfyUI 0.33.0 WebSocket message across success, cache hit, error, interrupt and reconnect runs. Cache hits send no progress, a missing client_id hides the done event, a reconnect lost 11 steps, and a crashed worker looked exactly like a long queue.
AI Models
ComfyUI IMPORT FAILED: How to Fix Custom Node Errors
IMPORT FAILED means a custom node pack crashed while loading. 17 failures from my own ComfyUI logs came from four causes: a broken stdout, the wrong Python, a moved diffusers module, and a bug. Plus one pack that failed silently.
AI Models
ComfyUI Prompt Outputs Failed Validation: API Fix
ComfyUI's validation error is an HTTP 400 whose real reason lives in node_errors. Tested 11 broken graphs on ComfyUI 0.33.0, found a 200 response that silently skips broken outputs, and built a preflight against /object_info that catches all of them.