ComfyUI Node Runs on cloud

TeaCache

Free 1.5-3x speedup for Flux, HiDream, Wan and more

By welltop-cn·Created 2 years ago·Updated about a year ago· 1,085
TeaCache
  • model
  • model
model_typeflux
rel_l1_thresh0.40
start_percent0.00
end_percent1.00
cache_devicecuda

If there's one node in this pack you actually want, it's this one. TeaCache patches your diffusion model so it skips redundant work between denoising steps - no retraining, no quantization, no extra checkpoint to download, just a model-in/model-out node you drop right after your loader. On a 4090 running Flux, people report going from roughly 3.8 it/s to 7.2 it/s at the default threshold - call it a 2x speedup for free. The video side compounds even harder: one widely-cited 4090 benchmark on Wan 2.1 14B went from about 40 minutes down to around 5.5 minutes once TeaCache was stacked with SageAttention and torch.compile. Your mileage varies with resolution and steps, but the direction is consistent across every model this pack touches. The catch is the quality tradeoff isn't zero - but at sane settings it's genuinely hard to spot.

How it works

The idea - Timestep Embedding Aware Cache, originally from Alibaba's vilab research team, with this pack (welltop-cn) being the ComfyUI wiring around it - is that consecutive denoising steps in a diffusion model often produce nearly identical outputs, especially mid-schedule. TeaCache estimates how different the current step's output would be from the cached one and, when that estimate falls under your threshold, reuses the cache instead of running the full step. It's training-free because it isn't touching weights at all - it's a runtime decision about whether a step is worth computing.

The inputs and outputs that matter

You feed it a model and get a patched model back - wire that straight into your sampler. The setting that actually matters is model_type: a 16-entry dropdown telling TeaCache which architecture it's patching, because the caching math is tuned per model, not universal. The twelve you'll see up front cover Flux, Flux Kontext, LTX-Video, Lumina-2.0, HunyuanVideo, and the three HiDream-I1 flavors (Full/Dev/Fast) plus four Wan 2.1 T2V/I2V combinations; the remaining four are "retention mode" variants of those same Wan presets, which the README says trade a little extra setup for better speed and quality together. PuLID-FLUX isn't its own entry - it's just Flux with an identity adapter riding along, so you still pick flux.

rel_l1_thresh is your speed/quality dial (default 0.4): higher skips more steps - faster, rougher; lower stays closer to the uncached original. start_percent/end_percent restrict caching to a slice of the schedule - leave these at 0/1 unless you've read the README's own warning that they're for people who really know what they're doing. cache_device (cuda/cpu) decides where cached tensors live: cuda is faster but eats a bit more VRAM, cpu is the safe pick if you're already tight.

How to install it

Install via ComfyUI Manager - search "ComfyUI-TeaCache" - or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/welltop-cn/ComfyUI-TeaCache
cd ComfyUI-TeaCache
pip install -r requirements.txt

Restart ComfyUI. No model weights to download - it's pure code sitting on top of whatever you already load with Load Diffusion Model or Load LoRA.

Common issues & troubleshooting

Output looks noticeably worse. Drop rel_l1_thresh. The README's per-model table (0.06 for LTX-Video up to 1.5 for HiDream-Fast) is the honest starting point, not a suggestion to skip.

It seems to do nothing with certain other nodes. People report TeaCache working fine alongside LoRA, Redux and Inpaint on Flux, but not with CFG thresholding or FlowEdit - those change the sampling math in ways the cache estimate doesn't account for. If you're stacking one of those, don't expect TeaCache to cooperate.

AttributeError: 'NoneType' object has no attribute 'get' on patches_replace. This shows up when something upstream of TeaCache in the graph - usually another model-patching node, or a ComfyUI core update that changed how transformer_options gets initialized - leaves that dict unset. Put TeaCache immediately after your model loader rather than deep in a chain of patches, and make sure both ComfyUI and the pack are current before assuming your workflow is broken.

LTX-Video output comes out blurry. LTX support landed after the initial Flux/HunyuanVideo release and had a rockier start - if you're on an old pack version, update before assuming the workflow is wrong.

CategoryTeaCache

Inputs (6)

NameTypeDefaultDescription
modelMODELThe diffusion model the TeaCache will be applied to.
model_typeCOMBOfluxSupported diffusion model.
rel_l1_threshFLOAT0.400–10How strongly to cache the output of diffusion model. This value must be non-negative.
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.
cache_deviceCOMBOcudaDevice where the cache will reside.

Outputs (1)

NameTypeDescription
modelMODEL