π³ CR SDXL Aspect Ratio
SDXL's actual training buckets, ready as a latent
- width
- height
- upscale_factor
- batch_size
- empty_latent
- show_help
SDXL wasn't trained on a smooth continuum of resolutions - it was trained on a specific set of "buckets," fixed width/height pairs around the 1024-pixel mark that the model actually saw during training. Generate outside those buckets and you're rolling the dice on stretched anatomy or duplicated subjects. CR SDXL Aspect Ratio is a dropdown of exactly those buckets, so you pick a ratio by name instead of hoping you remembered the right numbers.
Worth knowing: the presets here - 896x1152 portrait, 1216x832 landscape and the rest - line up with the resolutions the SDXL realism community actually converged on as standard (portrait 896x1152, landscape 1216x832 shows up verbatim in generation-settings write-ups), so this isn't a Comfyroll-invented list, it's the real bucket set.
How it works
Pick aspect_ratio from the list - 1:1 square 1024x1024 through portrait ratios like 9:21 portrait 640x1536 and landscape ones out to 21:9 landscape 1536x640, plus custom for hand-typed dimensions. The node sets width/height to match your choice and builds an empty_latent at that size times your batch_size, so you don't need a separate Empty Latent Image node. swap_dimensions flips portrait to landscape (or back) without you re-picking the ratio.
The inputs and outputs that matter
aspect_ratio- the bucket dropdown. This is the input that matters.swap_dimensions(Off/On) - portrait β landscape flip.upscale_factor- a plain pass-through value for a later upscale stage in your pipeline; the node doesn't resize anything with it, it's just carried through as a number.batch_size- how many latents to build.width/height- only used whenaspect_ratioiscustom.
Outputs: width, height (INT), upscale_factor (FLOAT), batch_size (INT), and the one that saves you a node - empty_latent (LATENT), wired directly into your KSampler. Plus show_help, a wiki link you can leave disconnected.
How to install it
Comfyroll Studio (Suzie1 and RockOfFire) - a mature utility pack, no models, no heavy dependencies.
- ComfyUI Manager - search "Comfyroll Studio," install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, then restart.
Common issues & troubleshooting
You want an SD 1.5 preset and can't find it here. This node is SDXL-only on purpose - for 512-based SD 1.5 ratios, use the sibling CR SD1.5 Aspect Ratio node, or the combined CR Aspect Ratio node if you want both families in one dropdown.
There's also a legacy node with a similar name. "CR Aspect Ratio SDXL" (note the word order) is the older node this one replaced - same job, older interface, no bundled latent. If an old workflow has that one in it, this is the upgrade path; there's no reason to keep the legacy version in a new build.
Output looks fine but the image is still off. Aspect-ratio buckets fix resolution, not composition - if you're still seeing artifacts, check your sampler settings before blaming this node; SDXL realism work generally wants 20-35 steps on a DPM++ 2M/3M SDE Karras sampler, and Euler A specifically tends to read as smoother/less detailed on SDXL than people expect coming from SD 1.5.
The pack fails to load entirely. Missing Comfyroll nodes across the board usually means Comfyroll Studio: Failed to load Graphics nodes followed by NameError: name 'CR_HalftoneGrid' is not defined in your startup log - a downstream symptom of an earlier import failure, often a Pillow version conflict from another installed custom node. Force-reinstall Pillow (pip install --upgrade --force-reinstall pillow) and restart, or reinstall the pack cleanly if that doesn't fix it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464β8192 | β |
| height | INT | 102464β8192 | β |
| aspect_ratio | COMBO | 10 options: custom, 1:1 square 1024x1024, 3:4 portrait 896x1152, 5:8 portrait 832x1216, 9:16 portrait 768x1344, 9:21 portrait 640x1536, +4 | |
| swap_dimensions | COMBO | 2 options: Off, On | |
| upscale_factor | FLOAT | 1.00.1β100 | β |
| batch_size | INT | 11β64 | β |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| width | INT | β |
| height | INT | β |
| upscale_factor | FLOAT | β |
| batch_size | INT | β |
| empty_latent | LATENT | β |
| show_help | STRING | β |