Nodes/Comfyroll Studio/πŸ”³ CR SDXL Aspect Ratio
ComfyUI Node Runs on cloud

πŸ”³ CR SDXL Aspect Ratio

SDXL's actual training buckets, ready as a latent

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,296
πŸ”³ CR SDXL Aspect Ratio
    • width
    • height
    • upscale_factor
    • batch_size
    • empty_latent
    • show_help
    β—„width1024β–Ί
    β—„height1024β–Ί
    β—„aspect_ratioβ–Ύβ–Ί
    β—„swap_dimensionsβ–Ύβ–Ί
    β—„upscale_factor1.0β–Ί
    β—„batch_size1β–Ί

    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 when aspect_ratio is custom.

    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.

    Category🧩 Comfyroll Studio/✨ Essential/πŸ”³ Aspect Ratio

    Inputs (6)

    NameTypeDefaultDescription
    widthINT102464–8192β€”
    heightINT102464–8192β€”
    aspect_ratioCOMBO10 options: custom, 1:1 square 1024x1024, 3:4 portrait 896x1152, 5:8 portrait 832x1216, 9:16 portrait 768x1344, 9:21 portrait 640x1536, +4
    swap_dimensionsCOMBO2 options: Off, On
    upscale_factorFLOAT1.00.1–100β€”
    batch_sizeINT11–64β€”

    Outputs (6)

    NameTypeDescription
    widthINTβ€”
    heightINTβ€”
    upscale_factorFLOATβ€”
    batch_sizeINTβ€”
    empty_latentLATENTβ€”
    show_helpSTRINGβ€”