Nodes/ComfyUI-MagCache/MagCache Calibration
ComfyUI Node

MagCache Calibration

Fixing MagCache when your step count doesn't match the preset

By Zehong-Ma·Created about a year ago·Updated 8 months ago· 274
MagCache Calibration
  • model
  • model
model_typechroma_calibration

This one's easy to miss the point of if you stumble on it before the regular MagCache node. It's not an alternative way to speed up your generation - it's a one-time fitting step for when MagCache's baked-in numbers don't match your setup.

Why it exists

MagCache decides which sampling steps to skip by comparing how much the model's output magnitude shifts step to step, against a lookup table of expected magnitude ratios (mag_ratios) for your model family. Those tables were measured at a specific step count. If you run at a step count MagCache wasn't calibrated for, the ratios no longer line up with what's actually happening in your sampler, and you get worse skip decisions - either too aggressive (visible degradation) or too conservative (no real speedup). The README calls this out directly for Chroma: the bundled chroma_calibration example workflow exists "to calibrate the mag_ratios for Chroma when the number of inference steps differs from the pre-defined value." This node is that calibration pass, generalized to the models that need it.

Practically: you run this node once, in place of the regular MagCache node, with the exact step count and settings you plan to actually use. That pass measures and records the correct magnitude curve for your configuration, and you go back to a normal MagCache setup afterward for your real, cached generations.

The inputs and outputs that matter

  • model - same as MagCache: the diffusion model you're calibrating for. Output is a model you wire onward same as usual.
  • model_type - this is the detail that trips people up: it's not the same list as the regular MagCache node. Calibration only ships three options - chroma_calibration (the default), flux_calibration, and flux_kontext_calibration. There is currently no calibration preset for Wan or HunyuanVideo through this node; those families rely entirely on the pre-baked tables in the main MagCache node.

How to install it

It ships in the same pack as MagCache - there's no separate install. Via ComfyUI Manager, search ComfyUI-MagCache; manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Zehong-Ma/ComfyUI-MagCache
cd ComfyUI-MagCache
pip install -r requirements.txt

then restart. If you already have MagCache working, you already have this node too - it just shows up as a separate entry in the node search.

Common issues & troubleshooting

You're using Wan or HunyuanVideo and this node doesn't cover it. That's not a bug on your end - as of this pack's current release, calibration is only offered for Chroma, Flux, and Flux-Kontext. If a Wan model's default MagCache settings look off at your step count, your options are the recommended-values table in the regular MagCache README, or opening an issue on the pack's GitHub - the author has been actively adding model support.

Picked the wrong calibration preset for your model. flux_calibration on a Chroma checkpoint (or vice versa) calibrates against the wrong architecture's magnitude behavior, so the output will look wrong in ways that don't obviously point back to this node. Match the preset to what's actually loaded, the same rule as the model_type dropdown on regular MagCache.

Left this node in your workflow permanently. It's meant to be a step you run once (or whenever your step count changes) to produce good numbers, then swap back to the plain MagCache node for actual generations. Leaving the calibration node wired into your production workflow isn't the intended use - go back to MagCache once you've got settings you're happy with.

Still getting bad output after calibrating. Double check the step count you calibrated at matches the step count of your real run - a calibration done at 20 steps won't help a workflow that ends up running 30.

CategoryMagCacheCalibration

Inputs (2)

NameTypeDefaultDescription
modelMODELThe diffusion model the MagCache will be applied to.
model_typeCOMBOchroma_calibrationSupported diffusion model.

Outputs (1)

NameTypeDescription
modelMODEL