Nodes/Advanced CLIP Text Encode/Add CLIP SDXL Params
ComfyUI Node Runs on cloud

Add CLIP SDXL Params

Attach SDXL size and crop conditioning to any prompt

By BlenderNeko·Created 3 years ago·Updated 2 years ago· 439
Add CLIP SDXL Params
  • conditioning
  • CONDITIONING
width1024
height1024
crop_w0
crop_h0
target_width1024
target_height1024

SDXL was trained with more than just your text - it also learned from the original size of each training image and where each crop came from. Those extra "micro-conditioning" values are a real, if quiet, lever on SDXL output. This node lets you attach them to a conditioning you already have, instead of getting them only from ComfyUI's built-in CLIPTextEncodeSDXL. Feed it a CONDITIONING, dial in the size/crop numbers, get a CONDITIONING back with those params baked in.

The main reason it exists: if you're encoding with BlenderNeko's CLIP Text Encode SDXL (Advanced) - which handles weighting but doesn't set these size params - you chain this node after it to add them back. It's the missing half of that pairing.

What "size and crop conditioning" actually does

SDXL's training set was full of images at every resolution, and a lot of them were center-crops of larger pictures. Instead of throwing that metadata away, SDXL was conditioned on it, so the model can be told what it's making. Two useful consequences:

  • Tell it the source resolution was large (e.g. 1024×1024) and you steer toward the sharp, high-res corner of the training distribution. Tell it 512×512 and output tends softer.
  • Tell it the crop offset was 0,0 and the model behaves like the subject is centered and uncropped. Non-zero crop values can shove the framing off-center, sometimes cutting off heads - usually not what you want.

This is a subtle steering effect, not a transformation. It nudges quality and framing; it won't rescue a bad prompt.

The inputs and outputs that matter

Everything is a plain integer, and honestly you set most of these once and forget them:

  • conditioning - the CONDITIONING you're adding params to (from an encode node).
  • width and height (default 1024 each) - the resolution SDXL is told the source image was. This is the size-conditioning. Set it to your target resolution, or a bit higher, to bias toward quality.
  • crop_w and crop_h (default 0) - the crop offset, i.e. which pixel of the "original" the crop starts at. Leave both at 0 for centered, uncropped framing. This is the one to actually understand: non-zero values are how people sometimes get accidental off-center or cut-off compositions.
  • target_width and target_height (default 1024) - the intended output resolution. Match these to what you're actually generating.

The output is a single CONDITIONING, which goes into the positive or negative input of your KSampler.

The sane default for almost everyone: set width/height/target_width/target_height all to your real output resolution, and leave crop_w/crop_h at 0. That's the neutral, no-surprises configuration.

Installing it

ComfyUI Manager: search Advanced CLIP Text Encode, install, restart.

Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb

Restart ComfyUI and hard-refresh (F5). No model downloads, no dependencies - installing the pack gives you this node alongside the two encode nodes and the refiner-params node.

Where people get tripped up

You probably already have this built in. ComfyUI's core CLIPTextEncodeSDXL node sets width/height/crop/target internally. This standalone node is only worth it when you want the size params separate from the encode - most often to pair with the pack's own SDXL Advanced encoder, which leaves them out. If you're using the stock SDXL encode, you don't need this.

SDXL only. These conditioning parameters are an SDXL-family thing. They mean nothing on SD 1.5, and nothing on the LLM-encoded 2026 models. Wire it only into an SDXL / Pony / Illustrious / NoobAI graph.

The effect is gentle. Don't expect a dramatic change from tweaking these. Cranking width/height well above your resolution gives diminishing, sometimes weird returns, and messing with crop_w/crop_h is more likely to break your framing than improve it. Leave crop at 0 unless you specifically want an off-center look, and change one value at a time on a fixed seed so you can actually see what it bought you.

Categoryconditioning/advanced

Inputs (7)

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

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING