Nodes/CFG Megapack/CFG Measure: Per-Step Probe
ComfyUI Node

CFG Measure: Per-Step Probe

Stop guessing what your CFG is actually doing

By AbstractEyes·Created 5 days ago·Updated 5 days ago· 3
CFG Measure: Per-Step Probe
  • model
  • MODEL
◄filename_prefixcfg_probe►
◄print_every0►

Guidance is the least observable knob in ComfyUI. You set a number, you look at a picture, you guess. CFG Measure: Per-Step Probe is the pack's answer to that: a node that writes one line of numbers per sampler step to disk, so you can see whether the guidance scale you think you're running is the one being run, and what it's actually doing to the latent.

This is the most useful node in the pack for anyone tuning it, and it's the one people skip.

What it records

A JSON line per step, into output/cfg_probe/, in files named <prefix>_<time>_<run>.jsonl. Each line carries:

  • the scale used that step - which is how you catch a schedule, a cap or a self-tuning rule disagreeing with your KSampler setting;
  • the size of the guidance difference and its cosine with the conditional prediction - the two numbers that tell you whether the prompt and the model's prior are agreeing at all;
  • how far guidance pushed the prediction;
  • the std ratio, which is the pack's saturation metric: this is the column that tells you why an image is burning;
  • the low-frequency share of the guidance, and the |x0| range.

If you've ever wanted to prove that a node does something on step 17 and nothing on step 30, this is the tool.

The inputs

  • model - in and out; it's a MODEL patch like everything else, so it lives in the chain between the loader and the sampler. It doesn't alter the image, it just carries the measurement stage in the plan.
  • filename_prefix - default cfg_probe. Change it when you're comparing two variants in one session so the files don't turn into a pile.
  • print_every - 0 (the default) writes the file only. Set it to, say, 5 and it also prints every fifth step to the console, which is what you want when you're on a remote box and don't feel like opening a file.

Output: MODEL.

What you actually do with it

  • Tuning a norm cap or a coefficient. Nodes like Power-Law CFG and PMC-CFG apply constants to the size of the guidance difference. The probe's size column tells you what that size is on your model and resolution, which turns a guessing game into arithmetic.
  • Watching a self-tuning node earn its keep. FBG sets its own scale every step, and it takes its next step from the previous one. Reading the scale column over a run is the difference between trusting it and understanding it.
  • Tuning the angle governor. The probe records the angles it saw and how often each edge of the band fired, which is the only honest way to pick a leash length for a model you haven't measured.
  • Diagnosing saturation. When an image blows out and you can't tell whether it was the scale, the schedule or the correction, the std ratio separates them.

CFG Plan Readout is the companion: same stage, different job. The probe gives you numbers over time; the readout prints the whole plan installed on the model - which node holds each stage, with what settings. Between them they replace most of the superstition in CFG tuning.

Install

ComfyUI Manager: search CFG Megapack, install, restart. comfy-cli: comfy node install comfy-cfg-megapack. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack

Restart ComfyUI. There's no requirements.txt and nothing to download - the pack needs torch and the Python standard library on top of ComfyUI's current node API (comfy_api.latest). Tested on ComfyUI 0.38.0 with torch 2.11, GPU and CPU-only. On a shared card, CFG_MEGAPACK_VRAM_FRACTION=0.6 before launch caps the pack's VRAM use.

To see the file appear, run one short generation with the probe chained in, then:

ls ComfyUI/output/cfg_probe/
head -1 ComfyUI/output/cfg_probe/cfg_probe_*_1.jsonl

Traps

  • One file per run, and runs add up. A sweep across twenty seeds leaves twenty files in output/cfg_probe/. Set filename_prefix per experiment, and clear the folder when you're done - it's a debugging directory, not an archive.
  • The numbers are per-step and per-run, so compare like with like. Two runs with different step counts won't line up line by line; the probes are useful for reading the shape of a run, not for diffing two files byte by byte.
  • It's a stage node, so it shares the "measure" stage. Chain two probes and the later one takes the stage - you'll get one file, not two.
  • It won't tell you why another pack's node is winning. If a RescaleCFG, Mahiro or RenormCFG is sitting after your chain, it holds ComfyUI's single CFG-function slot and modifies the result after everything you measured. The probe shows what the pack computed, not what the sampler finally received. Check the chain order first.
CategoryCFG Megapack/7 measure

Inputs (3)

NameTypeDefaultDescription
modelMODEL—
filename_prefixSTRINGcfg_probe—
print_everyINT00–1000Also print every Nth step to the console (0 = file only).

Outputs (1)

NameTypeDescription
MODELMODEL—