Nodes/ComfyUI-Lumina2-TeaCache/Lumina2 TeaCahe (FE)
ComfyUI Node

Lumina2 TeaCahe (FE)

Lumina2 getting slow? This node skips the diffusion steps that don't matter

By fexli·Created about a year ago·Updated about a year ago· 4
Lumina2 TeaCahe (FE)
  • model
  • MODEL
rel_l1_thresh0.300
start_percent0.00
end_percent1.00

If you're generating with Lumina-Image-2.0 and it feels like watching paint dry, this is the node you want. FE_TeaCache_Lumina2 is a single-purpose speed hack that stops the model from recomputing layers it's already figured out. No quantization, no distilled model to download, no extra weights - it just patches the model you already have and makes the sampler skip work. One node, four inputs, done.

It's a port of the TeaCache trick from spawner1145, which originally shipped for Lumina2 inside Diffusers, transplanted into ComfyUI by fexli. TeaCache already has a reputation in the video crowd - it's the standard "skip redundant computation" toggle in Wan workflows, good for a moderate speedup at the cost of a little fidelity. Same idea here, but for a still-image DiT.

How it works

TeaCache leans on the observation that consecutive denoising steps aren't really all that different. Early in sampling the image is mostly noise, but by mid-schedule, step 20 looks a lot like step 19, so the transformer is doing nearly identical work twice.

The node instruments the Lumina2 transformer's forward pass. Each step it runs only the first layer's adaLN modulation, then measures how much that "modulated input" changed versus the previous step - a relative L1 distance, rescaled through a polynomial that the original authors fit. Those distances accumulate; as long as the running total stays under rel_l1_thresh, the node skips running the transformer blocks entirely and reuses the residual from the last time it actually computed them. Cross the threshold and it runs the full stack, updates the cached residual, and starts accumulating again.

One nice touch in the source: it keys the cache by sequence length, so it stays correct if you're doing different-sized batches or CFG-with-different-lengths in the same graph. And the first and last steps always compute - no skipping the boundaries.

The inputs that matter

The node is refreshingly small. model takes your Lumina2 MODEL (the README's wiring is "UNet Loader → this node → KSampler"), and it spits out a patched MODEL that you feed to the KSampler.

  • rel_l1_thresh - the cache threshold, default 0.3, range 0–10. This is the whole game. Higher = more steps get skipped = faster but softer, messier results. Set it to 0 and the node returns the model untouched - a handy off-switch you can leave wired in.
  • start_percent / end_percent - the slice of the denoising schedule where caching is active, both 0–1. Defaults are full-range (0 to 1), which is what you want most of the time. If you find early steps where structure locks in are getting sloppy, nudge start_percent up a bit so the first few percent always compute.

Installing it

It's a two-line job, no dependencies worth fearing. There's no requirements.txt - the pack needs nothing beyond what ComfyUI already ships (it imports comfy.ldm.common_dit and unittest.mock, that's it), and it downloads no model files.

ComfyUI Manager: search for ComfyUI-Lumina2-TeaCache and hit install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/fexli/ComfyUI-Lumina2-TeaCache.git

Then restart ComfyUI. The node lives under fexli/utils in the node menu.

Where people get burned

The big one: this only works on Lumina2-family models. The forward pass it patches is Lumina-specific - the patchify, the adaLN modulation, all of it. Plug it into Flux or Wan and it'll either error or silently do nothing. If you need TeaCache for those, welltop-cn's ComfyUI-TeaCache covers the other architectures; this is the Lumina2-only port.

Quality is the second trap. This is a "faster but a bit worse" trade, and the author's own README says to tune rel_l1_thresh empirically. Start at the 0.3 default and watch details - text, hands, fine texture degrades first as you crank it. If your workflow is anything other than iterating on compositions, the savings may not be worth the softening.

Also: the node is marked EXPERIMENTAL in the source, the display name is misspelled as "Lumina2 TeaCahe (FE)", and this pack has essentially zero community footprint - no threads, no benchmarks. It's a small, honest utility for a model that's itself a niche (Apache-licensed, solid, but forever in Flux's shadow). Treat it as a free speed knob, not a miracle, and you'll be fine.

Categoryfexli/utils

Inputs (4)

NameTypeDefaultDescription
modelMODEL
rel_l1_threshFLOAT0.3000–10
start_percentFLOAT0.000–1The start percentage of the steps that will apply TeaCache.
end_percentFLOAT1.000–1The end percentage of the steps that will apply TeaCache.

Outputs (1)

NameTypeDescription
MODELMODEL