Nodes/ComfyUI-ppm/CLIPMicroConditioning
ComfyUI Node

CLIPMicroConditioning

Set SDXL's size and crop conditioning by hand

By pamparamm·Created 2 years ago·Updated about 14 hours ago· 265
CLIPMicroConditioning
  • cond
  • CONDITIONING
width1024
height1024
crop_w0
crop_h0
target_width1024
target_height1024

If you've ever wondered why SDXL images look better when you tell it the image is 1024x1024 even when you're rendering something else, this node is the knob behind that. SDXL wasn't just trained on pictures - it was trained on pictures plus three extra numbers: the original resolution of the source image, how it was cropped, and the target size. That's "micro-conditioning," and it quietly steers composition and perceived quality. CLIPMicroConditioning lets you stamp those numbers onto a conditioning yourself instead of letting the encoder guess.

What it actually does

Most people already feed these values without knowing it: ComfyUI's CLIPTextEncodeSDXL has width, height, crop_w, crop_h, target_width, target_height baked into it. The catch is that those live inside the encoder. If you built your conditioning some other way - a plain CLIP Text Encode, a concatenated prompt, something out of another node pack - the micro-conditioning either isn't there or is stuck at defaults. This node takes a finished CONDITIONING and writes the size/crop metadata onto it after the fact. Same signal, applied wherever you want in the graph.

The mechanism is not magic. SDXL learned to associate "original size = big" with sharp, detailed training crops and "original size = small" with the blurry upscaled junk in its dataset. So telling it the source was large biases it toward the good stuff. The crop offsets do the opposite of what you'd hope by default - a nonzero crop tells the model "this was a cropped photo," which is why heads and feet get chopped off. Setting crop to 0,0 is you saying "this is the whole frame."

The inputs that matter

  • width / height (default 1024) - the original size you're claiming the image came from. Keep these at or above your model's native resolution. This is the lever people actually reach for.
  • crop_w / crop_h (default 0) - the crop offset. Leave them at 0 unless you specifically want that off-center, cropped-photo feel.
  • target_width / target_height (default 1024) - the intended output size. Usually just match your actual generation resolution.

cond in, CONDITIONING out - wire the output straight into your KSampler's positive (or negative) slot in place of the original.

Install

Nothing to download, no models, no weird dependencies - it's pure conditioning plumbing.

  • ComfyUI Manager: search "ComfyUI-ppm", install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/pamparamm/ComfyUI-ppm, then restart ComfyUI.

The pack is a grab-bag of sampling and conditioning nodes by Pamparamm - genuinely useful stuff that flew under the radar for a while because the GitHub docs are thin. Don't expect a manual; expect to experiment.

Common issues & troubleshooting

It does nothing on your model. This is SDXL-family lore specifically. SDXL and its finetunes (Pony, Illustrious, NoobAI) were trained with size/crop conditioning; SD 1.5, Flux, and most 2026 flow-matching models were not. Bolt it onto a Flux workflow and you'll see no effect, because there's no learned response to feed. That's not a bug, it's the wrong model.

You're chopping off heads. Check crop_w/crop_h. Nonzero crop values tell the model the subject was cropped out of frame, and it obliges. Reset to 0.

Subtle by nature. Micro-conditioning nudges, it doesn't transform. If you're A/B testing it, use a fixed seed and change only these values - otherwise you're just looking at seed variance and convincing yourself of things.

Pack-wide rule from the author: if the node starts throwing errors after a pack update, delete it and re-add it to the graph. That resets stale internal state and fixes most post-update weirdness.

Categoryadvanced/conditioning

Inputs (7)

NameTypeDefaultDescription
condCONDITIONING
widthINT10240–16384
heightINT10240–16384
crop_wINT00–16384
crop_hINT00–16384
target_widthINT10240–16384
target_heightINT10240–16384

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING