Nodes/ComfyUI-NS-Util/NS Micro Conditioning Guidance
ComfyUI Node

NS Micro Conditioning Guidance

Guidance from the difference between high-res and low-res predictions

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
NS Micro Conditioning Guidance
  • model
  • MODEL
high_res_size2048
low_res_size256
mcg_scale1.00
start_percent0.00
end_percent0.70

SDXL embeds its size and crop information directly into the model's conditioning - the famous "micro-conditioning": the original_size, crop, and target_size values that tell the model what resolution and framing it's working in. NS Micro Conditioning Guidance weaponizes that. It runs the model twice per step with different micro-conditioning - one predicting as if the image were high resolution, one as if it were low - and adds the difference between those predictions to the denoising signal as extra guidance.

The theory is simple and worth taking seriously: a high-res-conditioned prediction tends to know more about fine detail and structure than a low-res one, so "what the high-res model sees that the low-res one doesn't" is a natural detail signal. Add that difference in, scaled by mcg_scale, and you're steering the image toward the detail a high-res interpretation would produce - without actually upscaling. It's in the same family of ideas as other "prediction difference" guidance tricks, applied to the size micro-conditioning that SDXL makes available.

How it works

This is a MODEL patch, so it plugs between your checkpoint and the KSampler and wraps the UNet. On every step within the active window (default 0% → 70% of the run):

  1. It rebuilds the conditioning's y vector twice - once declaring the image size as high_res_size (default 2048), once as low_res_size (default 256), using the model's own timestep embedder to re-encode those values.
  2. It runs both through the model (two extra forward passes per step - this is not free).
  3. It computes high_pred − low_pred, normalizes it relative to the current denoised signal's magnitude, and adds mcg_scale times that to the denoised output.

start_percent/end_percent (both 0–1) bound when the effect is active - the default window ends at 0.7, because by the end of a run you don't want guidance fighting the final polish.

Inputs that matter

  • model - your SDXL-family model.
  • high_res_size / low_res_size (64–8192, defaults 2048/256) - the two resolutions being compared. The gap between them is the whole effect: bigger gap, stronger detail signal.
  • mcg_scale (−10 to 10, default 1) - how hard the difference gets added. Negative flips it (low-res guidance instead). This is your main tuning knob.
  • start_percent / end_percent - the active window.

Output is a patched MODEL. It's SDXL-only, and the code politely returns the model unpatched with a console warning if you feed it anything else.

The honest cost

The "twice per step" thing is not a rounding error: within the active window every step runs the UNet three times instead of once, and you pay that on top of CFG's own double pass. On a 3060 you'll feel it. Also expect subtle, sometimes imperceptible results at low mcg_scale - this is a nudge, not a filter. Start around 1.0, and if you can't see anything, you're better off tuning high_res_size up rather than cranking the scale into artifacts.

Installing it

Part of ComfyUI-NS-Util:

cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util

or ComfyUI Manager → Install via Git URL with the same URL, restart. No model downloads, light dependencies.

When you'd reach for it

You're on SDXL, you want more fine detail in the composition - the kind of sharpness you'd normally get from a hires pass - and you're willing to spend compute in the sampler rather than add a whole upscale stage. It's a niche tool for a niche goal, and this pack clearly treats the micro-conditioning family as an experiment (the schedule variant, the override variant, and this all orbit the same idea). But the idea is real, and if you've exhausted the usual detail dials, this is a genuinely different lever.

CategoryNS/Conditioning

Inputs (6)

NameTypeDefaultDescription
modelMODEL
high_res_sizeINT204864–8192
low_res_sizeINT25664–8192
mcg_scaleFLOAT1.00-10–10
start_percentFLOAT0.000–1
end_percentFLOAT0.700–1

Outputs (1)

NameTypeDescription
MODELMODEL