Skip to content

About

Reduce repeated sampling computations with TeaCache, First-Block Cache, and DeepCache in Forge-family WebUIs, with adjustable speed and quality presets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Speed Cache

Reduce repeated model computation during sampling with TeaCache, First-Block Cache or DeepCache for Forge, reForge and Forge Neo.

Caching can improve generation speed by reusing intermediate results on selected steps. The speed gain and image differences depend on the model, sampler, step count and cache settings; compare results with the uncached baseline before using it for a final image.

Quick start

  1. Enable Speed Cache.
  2. Choose a method.
  3. Start with Balanced, then compare Quality and Fast against an image made with caching disabled.
  4. After changing models, reselect the preset so its values are loaded for the new model family.

The console reports how many model passes were reused for each image.

Compatibility

Model family Forge reForge Forge Neo
SD 1.x and SDXL All three methods All three methods All three methods
Flux Not available in this package TeaCache, First-Block Cache TeaCache, First-Block Cache
Chroma, Qwen-Image, Wan, Lumina 2, Z-Image, Anima, Krea and ERNIE Not available in this package Not available in this package TeaCache, First-Block Cache

Model and backend support can change as the WebUI projects evolve. DeepCache is limited to SD 1.x and SDXL; unsupported combinations are skipped with a console note.

Methods

  • First-Block Cache: runs the first block each step and may reuse the remaining computation when the change is small. A sensible method to try first.
  • TeaCache: estimates whether to reuse computation before running the full model. Calibrated rescaling is used for selected model families; others use the uncalibrated change measure.
  • DeepCache: performs a full pass periodically and reuses deeper features on intervening steps. Available for SD 1.x and SDXL only.

If the result changes too much

Symptom What to try
Soft or smeared detail Choose Quality or lower the threshold.
Composition differs from the uncached image Move Start at later, around 10–20% of the sampling steps, and compare again.
Fine details look unfinished Move End at earlier, around 90% of the steps.
Blotches with TeaCache on a new model Limit the maximum number of cached steps in a row.

These are starting points rather than universal settings. Use a fixed prompt and seed when comparing results.

Notes

  • Hires fix and img2img use the WebUI's own step accounting for the Start and End ranges.
  • Conditional and unconditional predictions keep separate caches.
  • ControlNet can be used. With DeepCache, controls that act on skipped deep blocks are not applied on cached steps.
  • Cache settings are stored in PNG generation information and can be pasted back. X/Y/Z plot axes include Method, Threshold, Cache interval, Cache depth, Start and End.

Tests

Run python tests_speedcache.py forge, python tests_speedcache.py reforge or python tests_speedcache.py neo from the extension folder. These tests exercise supported model paths with small random weights and do not require a checkpoint or GPU.

Credits and licence

TeaCache, First-Block Cache and DeepCache are based on work by their respective authors. See NOTICE.md for attribution and licence details. This extension is released under the MIT License; see LICENSE.

About

Reduce repeated sampling computations with TeaCache, First-Block Cache, and DeepCache in Forge-family WebUIs, with adjustable speed and quality presets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages