Nodes/CUI-Lumina2-TeaCache/Lumina2 TeaCahe
ComfyUI Node

Lumina2 TeaCahe

Make Lumina-Image-2.0 render up to 2.5x faster with one node — no retraining required

By spawner1145·Created about a year ago·Updated 7 months ago· 20
Lumina2 TeaCahe
  • model
  • MODEL
rel_l1_thresh6.000
start_percent0.00
end_percent1.00
coefficients_string[225.7042019806413, -608.8453716535591, 304.1869942338369, 124.21267720116742, -1.4089066892956552]

Lumina-Image-2.0 is one of the friendlier open image models around - Apache-licensed, strong prompt adherence, native ComfyUI support basically since it shipped. Its one real sin is speed: a 50-step render on a 4090 sits around 25 seconds, which is an eternity when you're iterating on a prompt. TeaCache_Lumina2 is the fix for that. You drop it between your UNet Loader and KSampler and it can turn that 25s into roughly 10s, with the quality loss mostly invisible at sane settings.

TeaCache isn't distillation - you're not swapping in a distilled checkpoint or retraining anything. It's the cache-acceleration trick from ali-vilab/TeaCache, transplanted to ComfyUI for the Lumina architecture by fexli and then retransplanted here by spawner. Diffusion models recompute a huge transformer stack at every step, but consecutive steps are usually pretty similar. TeaCache exploits that: at each step it looks at the adaLN-modulated input to the model, measures how much it actually changed since the last step, rescales that change through a polynomial, and accumulates. If the accumulated drift stays below rel_l1_thresh, it skips the expensive layer stack entirely and reuses the previous step's residual. The first and last steps always run in full, which is where the rough structure gets locked in.

The inputs that actually matter

  • model - your Lumina-Image-2.0 UNet, straight from a UNet Loader. This node only makes sense on the Lumina family; that's the whole deal.
  • rel_l1_thresh (default 6.0) - the skip threshold. This is the knob you'll actually tune.
  • start_percent / end_percent - the window of steps where caching applies. Keep the defaults (0 to 1) at first; you can exclude the most delicate early steps later.
  • coefficients_string - the polynomial coefficients for the rescale, as a bracketed list. The default is the tuned [225.7, -608.8, 304.2, 124.2, -1.4] set. There's a second set in the README for low-step renders. If you don't know why you'd change this, don't.

Output is a single patched MODEL, which you feed into the KSampler. That's the whole graph.

The settings, from the author's own numbers

The README's rules of thumb are worth following before you start experimenting:

  • 25 steps or fewer: start at rel_l1_thresh ≈ 6 with the default coefficients.
  • 50 steps and up: drop it proportionally - the README suggests ~0.6 at 50 steps.
  • Higher threshold = faster but softer. The author's 4090 table shows ~25s baseline, ~20s at 0.2, and ~10s at 0.5 (that's the 2.5x). Push past the sweet spot and you get blur and melted details.
  • rel_l1_thresh = 0 disables TeaCache cleanly and returns your model untouched - handy for A/B tests or when you've had enough.

Installing it

ComfyUI Manager is the easy route: Manager → Install Custom Node, search CUI-Lumina2-TeaCache, install, restart. Manual install is the usual two-liner:

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

Then restart ComfyUI. Nothing to download inside the pack - you still need the Lumina-Image-2.0 UNET itself in your diffusion_models folder. The pack's requirements.txt pulls lpips and scikit-optimize, but those only matter for the pack's analysis nodes; this one doesn't touch them.

Where people get burned

The node only works on Lumina-family models. Feed it a Flux or SD3 UNet and it degrades gracefully-ish - it prints a warning and disables itself rather than crashing, but you'll be running a slower patched model with nothing to show for it. Also watch the console for a 'sample_sigmas' not found warning: that means TeaCache couldn't see the sampler's step schedule and quietly switched itself off, which is how you get "no speedup and I don't know why."

The quality trap is the usual one: it's tempting to crank rel_l1_thresh until renders are instant, and the result looks fine at thumbnail size and mushy at full res. Community habit with TeaCache (it's been around on Flux and HunyuanVideo for a while) is to iterate fast with caching on, then flip it off for the final render. Treat this as an iteration accelerator, not a permanent upgrade, and you'll be happy with it.

Categoryutils

Inputs (5)

NameTypeDefaultDescription
modelMODEL
rel_l1_threshFLOAT6.000
start_percentFLOAT0.000–1The start percentage of the steps that will apply TeaCache. / TeaCache开始应用的步数百分比。
end_percentFLOAT1.000–1The end percentage of the steps that will apply TeaCache. / TeaCache停止应用的步数百分比。
coefficients_stringSTRING[225.7042019806413, -608.8453716535591, 304.1869942338369, 124.21267720116742, -1.4089066892956552]Coefficients for np.poly1d. Format: 393.7, -603.5, 209.1, -23.0, 0.86 (with or without brackets []) / 用于 np.poly1d 的系数。格式: 393.7, -603.5, 209.1, -23.0, 0.86 (可带或不带方括号[])

Outputs (1)

NameTypeDescription
MODELMODEL