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

NS Micro Conditioning Override

Fake the size and crop SDXL thinks it's rendering at

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
NS Micro Conditioning Override
  • conditioning
  • CONDITIONING
original_width1024
original_height1024
crop_left0
crop_top0
target_width1024
target_height1024

SDXL doesn't just look at your latent size - it embeds a description of that size into its conditioning: the original_size, the crop offset, and the target_size that make up its "micro-conditioning." NS Micro Conditioning Override is the node that lets you lie to it. You feed it a conditioning plus six numbers, and it rewrites those embedded values by hand.

Why would you want to lie? Because SDXL's micro-conditioning is a leftover from training and it does weird things in the wild. The classic example: when you upscale and re-run an image, or when you're working with an odd crop, the conditioning still carries the original size and crop from when the prompt was first encoded - and the model can silently behave as if it's generating at a resolution and framing that no longer matches what's actually on the latent canvas. This node is the surgical fix: tell SDXL "no, actually, this is a 1024×1024 render with no crop," and it will stop assuming otherwise.

How it works

Mechanically it's the simplest node in the micro-conditioning family - there's no model patch, no extra UNet passes, no sampling math. It walks the CONDITIONING list and overwrites six keys in each entry's dictionary:

  • width / height - from original_width / original_height (defaults 1024×1024, 0–8192).
  • crop_w / crop_h - from crop_left / crop_top (defaults 0, 0–4096). These are the "which part of a larger image was cropped to get here" values.
  • target_width / target_height - from target_width / target_height (defaults 1024×1024).

Everything else in the conditioning is left untouched. Output is a CONDITIONING with the same shape, ready to drop back into the sampler.

The inputs that matter

Honestly, in the common case you touch almost none of them. The defaults - 1024×1024 original, no crop, 1024×1024 target - are the "clean slate" values that fix most micro-conditioning drift. The moment you need to care: when your actual render genuinely is a specific aspect ratio or a crop, you set these to match reality.

That's the key insight for using it right: the override should describe the truth. Set original_width/original_height to what the image actually is, and crop_left/crop_top to 0 unless you really did crop from a larger source. The failure mode people hit is setting these to what they want rather than what is, which just introduces a new, different kind of conditioning lie.

Where it fits

In the pack's micro-conditioning family, this is the manual, explicit one: Override sets values by hand, Schedule sweeps them during sampling, and Guidance uses size differences as a steering signal. If you only ever want one of the three, Override is the one that's hard to misuse and easy to understand. It's also SDXL-specific in practice - the y-vector shape it edits is an SDXL thing, and on other models the keys simply may not exist (the node writes them regardless, which is harmless on models that ignore them).

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 - this node is pure conditioning dictionary surgery, so it's the most trouble-free install in the pack.

The honest take

This is the node you'll probably forget exists until the exact moment you need it - when a workflow's SDXL output is subtly off at the edges, and someone says "check your micro-conditioning," and you realize you can actually fix it instead of working around it. It's not flashy. It rewrites six numbers. But for that one class of silent SDXL weirdness, it's the right tool and it's hard to break.

CategoryNS/Conditioning

Inputs (7)

NameTypeDefaultDescription
conditioningCONDITIONING
original_widthINT10240–8192
original_heightINT10240–8192
crop_leftINT00–4096
crop_topINT00–4096
target_widthINT10240–8192
target_heightINT10240–8192

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING