Nodes/Emu35-Comfyui-Nodes/Emu 3.5 Memory Manager
ComfyUI Node

Emu 3.5 Memory Manager

The three dials that keep a 34B model on a 24GB card

By EricRollei·Created 9 months ago·Updated 9 months ago· 5
Emu 3.5 Memory Manager
  • model
  • vq_model
  • model
action

Emu 3.5 is big enough that "just load it and go" isn't a strategy - the model is 34B for image generation and 65B for the base, and even the NF4 quantized weights crowd a 24GB card before you've generated a single token. Emu 3.5 Memory Manager is the pack's answer to that: one node with three commands for what to do with the loaded model, plus a pass-through so you can keep it wired into the graph.

It takes the loaded model (EMU_MODEL, required) and optionally the vq_model (EMU_VQ), and the action dropdown picks the behavior:

  • keep_in_vram - a no-op. The model stays resident, which is what you want when you're about to run a generation and don't want reloading latency.
  • move_to_ram - moves the model and the vision tokenizer to CPU and empties the CUDA cache. This is your "free VRAM for something else" command. The model object survives, so you're not re-downloading, but the next generation pays the transfer cost to pull it back.
  • clear_cache - lighter touch: garbage-collects, empties the CUDA cache and IPC buffers, then prints how much is allocated per GPU. Doesn't move the model off the card - useful between generations where the model is staying but you want peak memory down.

Output is the same model (EMU_MODEL) you put in, so the wire stays live and you can chain it anywhere the model flows. It's an output node, so its real value is the side effect plus a console report.

The inputs that matter

  • model - wire the loader's EMU_MODEL here.
  • action - the three-option dropdown above.
  • vq_model - optional; wire the loader's EMU_VQ if you want the tokenizer moved to RAM too. Honestly, for the 24GB crowd this is where the win is: keeping the VQ model on CPU is one of the known tricks for fitting Emu 3.5 on a 4090.

Install

It's in the pack with everything else - install once, get all the nodes:

cd ComfyUI/custom_nodes
git clone --recursive https://github.com/EricRollei/Emu35-Comfyui-Nodes.git emu35
cd emu35
pip install -r requirements.txt

Models in ComfyUI/models/emu35/, and yes you need real hardware: the full BF16 weights want 48GB+, and NF4 quantized (wikeeyang/Emu35-Image-NF4) is the 24GB path.

Where this fits in a real workflow

The community recipe for running Emu 3.5 on a 4090 that actually worked: Loader V2 with vq_device set to cpu, a Memory Manager set to clear_cache between the loader and the sampler, and ComfyUI launched with --lowvram plus --reserved-vram bumped a bit. People who skipped the memory step crashed around 30% into inference. So think of this node as the governor in that pipeline - it doesn't make the model smaller, it just makes sure you're not holding two giant models in VRAM at once when you only need one.

CategoryEmu3.5

Inputs (3)

NameTypeDefaultDescription
modelEMU_MODEL
actionCOMBO3 options: keep_in_vram, move_to_ram, clear_cache
vq_modeloptEMU_VQ

Outputs (1)

NameTypeDescription
modelEMU_MODEL