π³ CR Aspect Ratio
Pick a resolution preset and get an empty latent for free
- width
- height
- upscale_factor
- prescale_factor
- batch_size
- empty_latent
- show_help
Getting your dimensions right in SD1.5 and SDXL is more finicky than it looks - generate at the wrong aspect ratio and you get duplicated heads, stretched bodies, and that unmistakable "the model has never seen this shape" wrongness. CR Aspect Ratio is the node that saves you from memorizing the good numbers. Pick a named preset, and it hands you the width, the height, and an empty latent already sized and ready for your KSampler.
That last part is the actual selling point. Most dimension helpers just spit out two integers and leave you to wire up a separate Empty Latent Image node. This one bundles the latent in, so a single node replaces two and there's one less place to fat-finger a mismatch.
How it works
You choose an aspect_ratio from a list of presets - the SD1.5 set (512-based: 1:1, 2:3, 3:4, 16:9, and so on) and the SDXL set (1024-based: 1:1, 3:4, 5:8, and more), all resolutions those models were actually trained to handle well. The node reads the preset, sets width and height accordingly, and builds an empty latent at that size times your batch. Pick custom and it uses the width/height you type in instead. swap_dimensions flips landscape to portrait without you having to swap the numbers by hand.
The two scale factors are pass-through plumbing for a hires pipeline: prescale_factor lets you generate smaller and upscale_factor is carried downstream as the number a later upscaler should multiply by. They don't resize anything on their own - they're values you route to the nodes that do.
The inputs and outputs that matter
aspect_ratio- the preset dropdown. This is the input you're here for. Match it to your model: SD1.5 presets for 1.5 checkpoints, SDXL presets for SDXL.swap_dimensions(Off/On) - flip portrait/landscape.batch_size- how many latents to make.width/height- only really used whenaspect_ratioiscustom.
The outputs are the whole point:
empty_latent(LATENT) - wire this straight into your KSampler. This is the convenience.widthandheight(INT) - feed these to anything that needs the numbers (upscalers, conditioning, image resizes).upscale_factor,prescale_factor(FLOAT),batch_size(INT) - pass-throughs for the rest of your pipeline.show_help- wiki link, ignore.
How to install it
Comfyroll Studio (Suzie1 and RockOfFire) is 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.
Also on CivitAI.
Common issues
The single biggest mistake isn't the node's fault: pick a preset that matches your model. Feed an SDXL checkpoint a 512x512 SD1.5 preset and you'll get mangled output, and vice versa - the model wants the resolutions it was trained on. When in doubt, 1024x1024 for SDXL, 512x768 for SD1.5.
If the node doesn't show up at all, that's the pack-wide load failure: Comfyroll Studio: Failed to load Graphics nodes in the log, ending in NameError: name 'CR_HalftoneGrid' is not defined. The NameError is a symptom - the real cause is an import error higher up, usually an incompatible Pillow version from another custom node, and it can take the whole pack down at once. Reinstall Pillow (pip install --upgrade --force-reinstall pillow) into ComfyUI's Python and restart.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464β8192 | β |
| height | INT | 102464β8192 | β |
| aspect_ratio | COMBO | 18 options: custom, SD1.5 - 1:1 square 512x512, SD1.5 - 2:3 portrait 512x768, SD1.5 - 3:4 portrait 512x682, SD1.5 - 3:2 landscape 768x512, SD1.5 - 4:3 landscape 682x512, +12 | |
| swap_dimensions | COMBO | 2 options: Off, On | |
| upscale_factor | FLOAT | 1.00.1β100 | β |
| prescale_factor | FLOAT | 1.00.1β100 | β |
| batch_size | INT | 11β64 | β |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| width | INT | β |
| height | INT | β |
| upscale_factor | FLOAT | β |
| prescale_factor | FLOAT | β |
| batch_size | INT | β |
| empty_latent | LATENT | β |
| show_help | STRING | β |