Nodes/ComfyUI-LTXVideo/πŸ…›πŸ…£πŸ…§ Image to CPU
ComfyUI Node Runs on cloud

πŸ…›πŸ…£πŸ…§ Image to CPU

Move an image off the GPU to free VRAM in tight LTX workflows

By LightricksΒ·Created 2 years agoΒ·Updated about a month agoΒ· 3,956
πŸ…›πŸ…£πŸ…§ Image to CPU
  • image
  • IMAGE

ImageToCPU does exactly what the name says: it moves an image tensor off your GPU and onto the CPU, so those frames live in system RAM instead of VRAM. That sounds trivial, and mechanically it is - but in an LTX-2 workflow, where VRAM is the resource everyone's fighting over, a well-placed offload can be the difference between a run finishing and a run dying with an out-of-memory error.

Here's the situation it's built for. LTX-2 is heavy: a big diffusion transformer plus the enormous Gemma 3 12B text encoder, the combination that caused OOM crashes on nearly every card at launch. In a long or multi-stage pipeline you often generate frames early, then need the GPU free for a later heavy step (an upscale pass, a second sampler, a decode). Frames you're done actively computing on don't need to hog VRAM. Push them to CPU and reclaim the space.

How it works

It takes an IMAGE and returns the same IMAGE, but relocated to CPU memory. No pixels change - it's purely a device transfer. Downstream nodes that don't need GPU acceleration (saving, previewing, some post-processing) can work on the CPU-resident copy, while the VRAM those frames were occupying is handed back for the next demanding operation.

The inputs and outputs that matter

About as minimal as a node gets:

  • image (IMAGE) - the image (or batch of frames) to move to CPU.

Output is the same IMAGE, now on the CPU. Wire it in wherever you want to drop GPU residency - typically right after a stage that produced frames you won't do more GPU work on.

There are no parameters. It's a one-job utility.

How to install it

Install the pack from ComfyUI Manager the way the README recommends: Ctrl+M β†’ Install Custom Nodes β†’ search LTXVideo β†’ Install β†’ restart. Or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Lightricks/ComfyUI-LTXVideo

then restart ComfyUI. It shows up under utility. The node itself costs nothing to install and needs no models - it exists precisely to help the surrounding LTX-2 pipeline (32GB+ VRAM, 100GB+ disk per Lightricks) fit in the memory you have.

Common issues & troubleshooting

It didn't fix my OOM. Placement matters. Offloading images helps only if images were meaningfully occupying VRAM at the moment you ran out - and often the real hog is the model or the text encoder, not the frames. For LTX-2 specifically, the bigger memory wins come from a quantized Gemma text encoder, GGUF model quants, --reserve-vram, and disabling previews. Use ImageToCPU as one tool among those, not a silver bullet.

Downstream node throws a device-mismatch error. If a later node expects its inputs on the GPU and you've handed it CPU-resident frames, you can get a device mismatch. In practice ComfyUI usually moves tensors back as needed, but if a custom node is strict about it, move the image back to GPU before that step (or just place the offload after the GPU-dependent work is done).

No visible change. That's normal - this is a memory management node, not a visual effect. Its whole value is invisible: less VRAM pressure. You notice it by not crashing, not by anything in the output.

System RAM is the new bottleneck. Moving frames to CPU trades VRAM for system RAM. On a machine with limited RAM (LTX-2 already wants 64GB comfortably), offloading a big batch of high-res frames can push you into swap. If your disk starts thrashing, that's the tradeoff biting - you've moved the pressure, not eliminated it.

Categoryutility

Inputs (1)

NameTypeDefaultDescription
imageIMAGEβ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”