Nodes/ComfyUI-DonutNodes/Donut SDXL TeaCache
ComfyUI Node

Donut SDXL TeaCache

Skip the UNet steps that barely change

By DonutsDelivery·Created about a year ago·Updated about 23 hours ago· 25
Donut SDXL TeaCache
  • model
  • model
cache_threshold10.00
start_percent0.00
end_percent1.00
cache_devicecuda
enabletrue
cache_modebalanced

TeaCache was the acceleration trick of early 2025 - every SDXL and Flux workflow thread had someone asking why their denoise was suddenly skipping steps. It works by noticing something most people don't: during denoising, consecutive steps often feed the UNet inputs that are nearly identical. Recompute them anyway and you've paid full price for a few percent of change.

Donut SDXL TeaCache is a drop-in version for SDXL checkpoints. You slot it between your checkpoint loader and your KSampler, and it patches the model's forward pass so that when the input between steps hasn't drifted past a threshold, the previous UNet output gets reused instead of recomputed. Same output socket, same wiring, fewer flops.

How it works

The node wraps the UNet forward and compares each new input against the previous one with a relative L1 distance. That distance feeds a small polynomial, and the value accumulates across steps. When the accumulated distance stays under your threshold, the model returns the cached output from the last real compute; once it crosses, it computes fresh and resets the counter. There's a real quality lever hiding in that math - raise the threshold and more steps skip, but the error compounds, so "aggressive" is a mood, not a promise.

The inputs that matter

  • cache_threshold - a percentage, oddly, despite the slider. The tooltip is honest about what the numbers mean: 4% = quality, 5% = balanced, 10%+ = speed. Start at 5.
  • cache_mode - conservative / balanced / aggressive. This is just a multiplier on the threshold (0.5x / 1.0x / 1.5x), so it's a second way to say the same thing. Pick one and tune the threshold, don't fight both.
  • start_percent / end_percent - which slice of denoising gets caching. Caching late denoising steps is where the artifacts hide, so 0.0 → 0.8 is a common compromise.
  • cache_device - cuda (fast, eats VRAM) or cpu (slower but frees memory). On a card that's already tight, cpu is the move.
  • enable - yes, you can leave the node in place and flip this off. Handy for A/B testing speed vs. quality in the same graph.

The single output is model, and it feeds straight into the model input of any KSampler. That's the whole graph: Load Checkpoint → Donut SDXL TeaCache → KSampler → VAE Decode.

Install

This ships inside the ComfyUI-DonutNodes pack. Easiest path:

  1. In ComfyUI Manager, search for "DonutNodes" and install.
  2. Restart ComfyUI.

Manual, if you prefer:

cd ComfyUI/custom_nodes
git clone https://github.com/DonutsDelivery/ComfyUI-DonutNodes.git donutnodes
cd donutnodes
python -m pip install -r requirements.txt

Run the pip line with the same Python that launches ComfyUI. The pack pulls in opencv-python-headless, scipy, matplotlib, psutil, tqdm, and requests - nothing model-sized, no downloads.

Where people get burned

  • It helps iterative work, not one-offs. TeaCache's wins come when similar inputs repeat - prompt refinement, batch generation, parameter sweeps. A single unique generation at low step counts won't show much.
  • Quality loss at aggressive settings is real, not a rumor. If faces start wobbling or fine texture goes glassy, raise the threshold toward 4% or shrink the cached range.
  • VRAM, not just speed. CUDA caching holds the previous output on the GPU. On 8GB cards the "free speed" can cost you elsewhere; cpu cache device is the escape hatch.
  • TeaCache is a 2025 technology. It's genuinely still useful on SDXL, but if you're chasing raw speed and don't have a loyalty to SDXL, the reason the hype cooled is that distilled models (Lightning/Turbo, Z-Image Turbo) got the same job done faster with no cache at all. Use this to make your existing SDXL workflow faster - not to start a new one.

The author, DonutsDelivery, is a CivitAI SDXL photorealism workflow creator, and this node comes from that same pack of LoRA-stacking, detailing, and enhancement tools. If you're already in the Donut ecosystem, this is the zero-risk speed knob.

CategoryDonutNodes

Inputs (7)

NameTypeDefaultDescription
modelMODELThe SDXL diffusion model TeaCache will be applied to.
cache_thresholdFLOAT10.000–100Cache threshold % - higher values = more aggressive caching (4%=quality, 5%=balanced, 10%+=speed)
start_percentFLOAT0.000–1Start percentage of denoising steps to apply TeaCache.
end_percentFLOAT1.000–1End percentage of denoising steps to apply TeaCache.
cache_deviceCOMBOcudaDevice where cache will reside.
enableBOOLEANtrueEnable/disable TeaCache.
cache_modeCOMBObalancedCache mode preset that adjusts cache_threshold.

Outputs (1)

NameTypeDescription
modelMODEL