Dragon7108andClaude Opus 4.8 18f22591a8 Initial commit: QuickRatio v1.0.0
ComfyUI aspect-ratio node — preset + custom ratios, base-resolution scaling,
configurable divisible_by alignment (8/16/64…), and a live in-node preview.
GPL-3.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 19:20:01 -05:00
2026-06-07 19:20:01 -05:00
2026-06-07 19:20:01 -05:00
2026-06-07 19:20:01 -05:00
2026-06-07 19:20:01 -05:00
2026-06-07 19:20:01 -05:00

ComfyUI-QuickRatio

A simple utility node for ComfyUI that provides quick aspect ratio calculations for image generation.

Features

  • Preset Ratios: Common aspect ratios including 16:9, 4:3, 1:1, portrait variants, and ultrawide formats
  • Custom Ratios: Support for custom width:height ratios
  • Smart Scaling: Automatically scales dimensions based on a base resolution
  • Configurable Alignment: Snaps the computed dimension to a divisible_by value (default 8) — bump it to 16 for Flux, 64 for models that need it, etc.

Usage

  1. Select a preset ratio from the dropdown or choose "custom"
  2. Set your base resolution (the larger dimension will use this value)
  3. Set divisible_by to match your model's alignment (default 8; e.g. 16 for Flux)
  4. For custom ratios, specify width and height ratio values
  5. The node outputs width and height as integers

Available Presets

Outputs below are at the default base resolution of 1024 (which sets the longer side) and the default divisible_by of 8. The shorter side is snapped to divisible_by, so it can land a few pixels off the exact ratio — e.g. 21:9 gives 440, not 438.9. Raise divisible_by (16, 64, …) for models that need it, and change the base resolution to scale every preset proportionally.

Preset Description Output @ base 1024 (W×H)
1:1 Square 1024 × 1024
11:17 Tabloid/ledger, portrait 664 × 1024
16:9 Widescreen 1024 × 576
9:16 Vertical / mobile 576 × 1024
4:3 Classic 1024 × 768
3:4 Portrait classic 768 × 1024
21:9 Ultrawide 1024 × 440
9:21 Vertical ultrawide 440 × 1024
3:2 Photography 1024 × 680
2:3 Portrait photography 680 × 1024
5:4 Large format 1024 × 816
4:5 Portrait large format 816 × 1024
custom Your own width:height ratio depends on inputs

Installation

Via ComfyUI-Manager: "Install via Git URL" → https://github.com/Dragon7108/ComfyUI-QuickRatio

Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Dragon7108/ComfyUI-QuickRatio

Restart ComfyUI. No extra dependencies.

License

GPL-3.0 — ComfyUI is GPL-3.0 and this node integrates with it, so it matches.

S
Description
No description provided
Readme GPL-3.0
44 KiB
Languages
JavaScript 52.4%
Python 47.6%