Nodes/ComfyUI-sdxl-micro-conditioning/SDXL Micro-Cond (Simple)
ComfyUI Node

SDXL Micro-Cond (Simple)

Generate big, pretend it was small — the SDXL crop trick, automated

By lRemixl·Created 5 months ago·Updated 5 months ago· 0
SDXL Micro-Cond (Simple)
  • conditioning
  • latent
  • CONDITIONING
scalar0.75
scale_target_sizetrue

There's a well-known trick for getting clean results when you push SDXL above its native 1024x1024: tell the model the image it's drawing is actually a low-res original that got upscaled. The model doesn't know any better - it just composes for that size, and you get better framing, fewer over-stuffed empty corners, and less "I can see every pore" flatness at high resolution. SDXLMicroConditioningSimple is that trick packaged as a single node that computes the numbers for you.

How it works

SDXL's conditioning carries size/crop metadata: the "original" size, crop coordinates, and the target size. When you sample at a resolution above native, leaving those values at your actual output size tells the model "this is genuinely a 1536x1024 drawing" - which it was never trained to do well. The fix is to feed it a smaller original size than the canvas you're actually sampling.

That's what this node does automatically. You feed it your latent, and it reads the shape straight out of latent["samples"], multiplies the latent dimensions by 8 (the VAE's downsample factor) to recover real pixel dimensions, then applies one scalar to shrink the "original" size. Crop values get zeroed out, the result rounds to a multiple of 8, and the whole thing is written into a deep-copied conditioning dict. Nothing is sampled, nothing is re-encoded - it's a conditioning rewrite, pure Python, no dependencies.

The inputs

Three, and you'll realistically only touch one:

  • latent - the actual latent you're sampling. This is the anchor; the node derives everything from its shape, which is what keeps it consistent with your real canvas (the failure mode the Advanced node's manual version invites).
  • scalar (default 0.75) - how much smaller the "original" should be than your actual output. Lower = the model believes the upscale factor is bigger. 0.75 is the sensible starting point.
  • scale_target_size (default true) - whether the target size also scales down. Leave it on for the basic trick. Turn it off if you want the model to think it's looking at a crop of a low-res original blown up to full size - a closer simulation of how SDXL saw low-res images in training, per the author's own code comments.

Output is a single CONDITIONING, wired into the positive and negative inputs of your KSampler, replacing whatever came out of your text encoder.

Install

In ComfyUI Manager, search "SDXL Micro-Conditioning" and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/lRemixl/ComfyUI-sdxl-micro-conditioning

Restart ComfyUI. No requirements.txt, no model files, nothing heavy. The node shows up in advanced/conditioning.

Gotchas

  • The effect is subtle, so judge it fairly. Crop conditioning nudges composition and texture handling; it doesn't remix the image. If you flick the scalar and see "nothing happened," you're probably looking for the wrong kind of change.
  • SDXL-family only. This is pure SDXL machinery (SDXL, Pony, Illustrious and friends). On Flux or SD 1.5 it's dead weight - they don't carry micro-conditioning at all.
  • Patch both streams. Drop the node's output into positive and negative conditioning, or the two sides disagree about what size the image is.
  • It's not a substitute for hires fix. It improves how a big first pass composes; it doesn't add detail. If you want actual resolution, you still upscale after.

If you generate SDXL at 1536x1024 and up, the Simple node is the one I'd actually reach for - it's the same conditioning lie as the Advanced node, minus the arithmetic and minus the foot-gun of setting target values that don't match your latent.

Categoryadvanced/conditioning

Inputs (4)

NameTypeDefaultDescription
conditioningCONDITIONING
latentLATENT
scalarFLOAT0.750.01–100
scale_target_sizeBOOLEANtrue

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING