Nodes/ComfyUI_Patches_ll/ApplyTeaCachePatch
ComfyUI Node Runs on cloud

ApplyTeaCachePatch

Near-free 1.5-2x speed on Flux and the video models

By lldacing·Created 2 years ago·Updated 8 months ago· 124
ApplyTeaCachePatch
  • model
  • model
rel_l1_thresh0.250
cache_deviceoffload_device
wan_coefficientsdisabled

TeaCache is the well-known one. If you've seen a Flux or HunyuanVideo workflow suddenly get ~2x faster with one small node added, this is almost certainly the family it was. The insight is simple: on diffusion models, consecutive denoising steps are very similar, so the transformer's heavy double blocks are mostly recomputing the same thing. TeaCache measures how much the input actually changed since last step, and when it barely moved, it skips the expensive blocks and reuses the previous step's output. This node applies that to Flux, HunYuanVideo, LTXVideo, MochiVideo, and WanVideo - no retraining, no extra model files.

The community's honest verdict, echoed in the r/StableDiffusion thread that announced the first ComfyUI TeaCache node: it's "pretty damn close to the same... just worse." Which makes it perfect for iterating on a prompt fast and switching off for the final render.

How it works

At each step it compares the current step's "modulated" input to the previous step's, tracks an accumulated relative L1 distance, and when that stays under your threshold it skips the double blocks and patches in the cached residual from the last fully-computed step. The author pulls the rescale coefficients straight from the official ali-vilab/TeaCache repo so the numbers you type match the official thresholds, and it always computes the first and last steps. You'll see a console log like skipped cond steps: 12 so you know it's working.

The input that matters:

  • rel_l1_thresh - the skip threshold. Higher = faster, softer. Author's reference: Flux 0.25 ≈ 1.5x, 0.4 ≈ 1.8x, 0.6 ≈ 2.0x; HunYuanVideo 0.1 ≈ 1.6x, 0.15 ≈ 2.1x; LTXVideo 0.03 ≈ 1.6x; MochiVideo 0.06 ≈ 1.5x. 0 disables.

Two optional inputs, both worth knowing:

  • cache_device - where the cached residual is stored, main_device (GPU) or offload_device (CPU, the default). The offload default keeps VRAM free; flip it if you see a speed penalty from copying.
  • wan_coefficients - Wan2.1 ships several variants with different rescale curves (t2v 1.3B, t2v 14B, i2v 480P, i2v 720P). Pick the one matching your model or TeaCache on Wan will misjudge similarity and either skip too much or do nothing.

model in, model out, same as every node in this pack.

Installation

Search ComfyUI_Patches_ll in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/lldacing/ComfyUI_Patches_ll.git
# restart ComfyUI

Requires ComfyUI ≥ 0.3.17. Only numpy and packaging as dependencies - this pack downloads no models and needs no Triton or torch.compile (that's the appeal over WaveSpeed, which is faster but a genuinely painful install on Windows).

Common issues

  • Works but not faster / no log line. It needs a *ForwardOverrider (DitForwardOverrider auto-detects) in the model path, or the hooks never fire. You get normal sampling with no crash and no speedup.
  • MochiVideo. Author's own testing: poor quality after acceleration, possible black video. Don't bother.
  • Wan with wan_coefficients disabled. The source comments warn the first steps can be unstable; select the coefficients for your exact Wan model.
  • Composition breaks at high thresholds. Keep the first and last few steps unskipped - that's exactly what the Advanced variant's start_at/end_at is for if you want the aggressive middle.

Rule of thumb: run 0.25 on Flux for drafts, and when you've settled on a prompt, set rel_l1_thresh back to 0 and render the keeper.

Categorypatches/speed

Inputs (4)

NameTypeDefaultDescription
modelMODEL
rel_l1_threshFLOAT0.2500–5Flux: 0 (original), 0.25 (1.5x speedup), 0.4 (1.8x speedup), 0.6 (2.0x speedup), and 0.8 (2.25x speedup). HunYuanVideo: 0 (original), 0.1 (1.6x speedup), 0.15 (2.1x speedup). LTXVideo: 0 (original), 0.03 (1.6x speedup), 0.05 (2.1x speedup). MochiVideo: 0 (original), 0.06 (1.5x speedup), 0.09 (2.1x speedup). WanVideo: 0 (original), reference values Wan2.1 t2v 1.3B 0.05 0.07 0.08 Wan2.1 t2v 14B 0.14 0.15 0.2 Wan2.1 i2v 480P 0.13 0.19 0.26 Wan2.1 i2v 720P 0.18 0.2 0.3
cache_deviceoptCOMBOoffload_device2 options: main_device, offload_device
wan_coefficientsoptCOMBOdisabledWanVideo coefficients.

Outputs (1)

NameTypeDescription
modelMODEL