sizing for SDXL (advanced)
Why your crops look wrong
- width
- height
- crop_w
- crop_h
- target_width
- target_height
- downscale
sizing_node ("sizing for SDXL (advanced)") is the big sibling in the Ser-Hilary/SDXL_sizing pack: everything the basic node does, plus the knobs you reach for when you actually care which bucket you land in, want to see the math, or want to experiment with SDXL's crop conditioning. If you're here because you keep getting images cropped oddly at non-standard sizes, this is the node that tells you exactly why - and lets you do something about it.
How it works
Same engine as sizing_node_basic - the basic node literally subclasses it. It picks the nearest SDXL training bucket for your aspect ratio, computes the six conditioning values (width, height, crop_w, crop_h, target_width, target_height) that describe the hypothetical "original" image and its crop, and hands you the generation size and an optional downscale factor. What the advanced version adds is control over which bucket list is "nearest."
The three string inputs parse the same way they do on the basic node: native_res stays 1024, aspect accepts 1:1, 16:9, 0.5, -1 (inherit from original), and original_res takes a bare long-side number, an exact WxH, or a float like 2.0 to scale the gen size.
The knobs that matter
- strict_bucketing - the interesting one. Four modes:
SDXL Report(the full bucket list from the SDXL paper, the default),Comfy(the nine buckets the ComfyUI dev explicitly recommends - fewer, but "these had the most training data and produce the best results," per the source),Smallest Buckets(a handful of low-pixel buckets, handy for VRAM-strapped machines), anddisabled(theoretical 64-multiple bucketing instead of a fixed list). Beyond ~4:1 aspect there's no real training bucket, and the node quietly disables strict bucketing for those. - verbose -
basicprints the seven outputs to the console;fullwalks you through the scaling and crop math step by step. Turn it on once. It's the best documentation of how SDXL sizing actually works that this pack has, and it'll show you where your crops are coming from. - fit_aspect_to_bucket - after picking a bucket, it adjusts the effective aspect to match it so
crop_w/crop_hcome out at or near zero. It's the "I don't want any cropping at all" cheat. - downscale_effect - 0 means the
downscaleoutput does nothing; 1 means it scales your generation back to match the original resolution (minus crop). The author built this for his own downscaling habit and admits most people don't want it. - crop_extra - extra crop as a fraction of gen size. Kept low, or zero, per the author's own warning that it tends to look odd.
The extra_args toy box
The extra_args string at the bottom is where this node gets genuinely weird, and the author is upfront that some of it is experimental. A few that are actually useful:
--nocrop- forcescrop_w/crop_hto 0 for A/B testing whether plausible crops even matter.--randomaspect 2x3 4x2- random aspect between two bounds (defaults 0.25 to 4.0). Note it's random per workflow run, not per generation - the author says he'd need to make ComfyUI call the node per batch for that.--sharp/--extrasharp/--supersharp- scale the width/height conditioning by 133% / 167% / 200% while keeping the gen size. That's the img2img trick: feed it a small input image's dimensions but generate with larger conditioning values.--nudge w 0.8- produces an original resolution with 80% of the maximum plausible width-cropping, for stress-testing at the edges ofcrop_w.--shortsideand--equivalent- change how a bare number inoriginal_resis interpreted (long side vs. short side vs. matching pixel area).
Install and gotchas
Same as the rest of the pack: ComfyUI Manager → search SDXL_sizing, or git clone https://github.com/Ser-Hilary/SDXL_sizing into ComfyUI/custom_nodes and restart. Zero dependencies, zero model files, pure arithmetic.
The trap with this node is over-configuring it. If the basic node covers your use, use it - strict_bucketing on SDXL Report is a perfectly good default and extra_args is a sandbox, not a requirement. Where the advanced node genuinely earns its keep: debugging crop behavior with verbose = full, forcing no-crop generations with fit_aspect_to_bucket, and the --sharp family for img2img. Everything else is toys you'll try once and leave alone.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| native_res | STRING | 1024 | — |
| aspect | STRING | 1:1 | — |
| original_res | STRING | 800x1200 | — |
| crop_extra | FLOAT | 0.0000–1 | — |
| downscale_effect | FLOAT | 0.0000–1 | — |
| verboseopt | COMBO | 3 options: disabled, basic, full | |
| fit_aspect_to_bucketopt | COMBO | 2 options: disabled, enabled | |
| strict_bucketingopt | COMBO | 4 options: SDXL Report, Comfy, Smallest Buckets, disabled | |
| extra_argsopt | STRING | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| crop_w | INT | — |
| crop_h | INT | — |
| target_width | INT | — |
| target_height | INT | — |
| downscale | FLOAT | — |