⚡ Magic Cache 缓存加速 (TeaCache + FBCache)
What Magic Cache actually skips
- model
- model
Sick of waiting out a 25-step FLUX render and wishing there were a "make it faster" button? This is that button. Magic Cache sits between your model loader and your sampler and patches the model so it skips work it doesn't need - you get the same model back, just with the boring parts of the denoising loop short-circuited. The README's honest number is 1.5x to 3x faster, and that matches what cache-distillation tech like this generally delivers.
It bundles two tricks into one node, both inherited from the Comfy-WaveSpeed and ComfyUI-TeaCache projects: TeaCache and FBCache. TeaCache watches how much the latents actually change between steps, and when the change is tiny it reuses the previous step's output instead of running the network - great for the early, low-information steps, roughly 2x on its own. FBCache works in the feature space instead: within a chosen step range (the sweet spot is the middle, roughly 20%–85% of steps) it reuses cached transformer-block features. The README's recommended mode is Both, which runs the TeaCache timestep check first and then the FBCache feature check. "Both" is genuinely the one to start with.
How you use it
Plug the model output of your loader into this node, pick a mode from the settings, and feed the model output into the sampler instead. That's the whole wiring change. The parameters - thresholds, step ranges, cache device (CUDA or CPU) - live behind the ⚙️ settings popup and the 📖 help button, and the defaults are sensible enough that you should run once before touching anything.
The schema is about as minimal as a node gets: one required input, model, one output, model. Everything else is a hidden UI setting, which is exactly what you want from a node whose job is "be invisible between two existing nodes."
Model support is broad: FLUX, FLUX-Kontext, FLUX-Klein, PuLID-FLUX, SDXL, SD1.5, and Anima are all listed, plus flux2klein and the latest Anima as things this node adds beyond the upstream projects. So it's not a FLUX-only toy - an SDXL user gets the same 2x.
Where people get burned
Quality. Caching is a lossy shortcut by design, and the failure mode is the image going slightly mushy or smeary in the mid-steps. The fix the README gives is the right one: lower the threshold parameter (for FLUX, rel_l1_thresh=0.4 is the recommended starting point) until the artifact disappears. There's a real trade, though: too low and the node stops skipping anything and you've gained nothing.
Second gotcha: the cache has to live somewhere, and it's on your VRAM by default. On a card that's already sweating, switching the cache device to CPU is the escape hatch. And each run auto-cleans the old patch cache before applying a new one, which the changelog added specifically to stop the slow memory-leak creep you get from re-patching models over and over.
Installing it
This ships inside the ComfyUI-Magic-Assistant pack, so install the pack:
cd ComfyUI/custom_nodes/
git clone https://github.com/shigjfg/ComfyUI-Magic-Assistant.git
cd ComfyUI-Magic-Assistant
pip install -r requirements.txt
then restart ComfyUI (or search "ComfyUI-Magic-Assistant" in ComfyUI Manager). No extra model files, no separate download - the cache logic is all Python in the node. It's also one of the rare Magic nodes that doesn't care what ComfyUI version you're on, since it patches the model object rather than touching core APIs.
If a render looks slightly off after enabling it, the cache is the first thing to suspect, not your prompt. Disable it, compare, and only then start tuning thresholds.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | 要应用缓存优化的扩散模型 (Diffusion model to apply cache optimization) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |