Dart Get Aspect Ratio
Dart Get Aspect Ratio (DanbooruTagsTransformerGetAspectRatio) — ComfyUI node guide
- ASPECT_RATIOS
Dart Get Aspect Ratio does one small, specific thing: it looks at your width and height and tells you which of Dart's five aspect-ratio categories they fall into. On its own that's not very interesting - it only exists to feed one field, aspect_ratio, on Dart Compose Prompt V2. But it saves you a genuinely annoying failure mode: generating at a tall canvas while your Dart prompt still says square, because you forgot to update the dropdown by hand.
Why this node exists at all
Dart Compose Prompt V2 (the v2 prompt builder for dart-v2-sft and dart-v2-moe-sft) has an aspect_ratio field that steers the model's generated composition toward a particular canvas shape - a portrait scene reads differently than a landscape one, and the model was trained with that as an explicit hint. Picking that value by hand works fine right up until you change your actual generation resolution and forget to update it, and now your composition tags and your canvas silently disagree. Wiring this node's output straight into aspect_ratio closes that gap: change your width/height, and the aspect ratio tag follows automatically instead of drifting out of sync.
Inputs and output
Two required inputs, both plain integers: width (default 1024, range 16–16384, step 8) and height (same range and step). Feed these from the same width/height values driving your actual image generation - a Latent Image node, or wherever your resolution originates in the workflow - so the two stay locked together.
The output is a single socket named ASPECT_RATIOS, and it's worth knowing this isn't a plain string: it's typed as the same five-way enum that Dart Compose Prompt V2's aspect_ratio field uses - ultra_wide, wide, square, tall, ultra_tall. That's exactly why the two connect directly with no conversion node in between; the output type is built to match the input it's meant to feed.
Installing it
Install through ComfyUI Manager (search "ComfyUI-Dart") or clone it manually: cd ComfyUI/custom_nodes && git clone https://github.com/nkchocoai/ComfyUI-Dart.git, then restart ComfyUI. It's part of the same pack as the rest of these nodes - no separate install, and nothing to download; it's pure arithmetic on two integers, no model or tokenizer involved.
Where this actually matters, and where it doesn't
This node is only useful if you're on the v2 pipeline. Dart Compose Prompt (the v1 builder, for dart-v1-sft) has no aspect_ratio field at all, so there's nothing here to wire it into on that path - if you're on v1, this node has no home in your workflow.
On v2, the thing worth understanding is that this is a categorization, not a precise ratio calculation - five wide buckets covering everything from a tall portrait to an ultra-wide banner, not a continuous value. Two quite different resolutions can land in the same bucket (tall covers a range, not one exact ratio), and that's fine - it's matching the granularity the model was actually trained on, not losing precision you needed. If you're hand-picking square because it "feels right" for a roughly-square image, this node gives you the same answer with zero chance of it silently going stale the next time you change resolution.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ASPECT_RATIOS | ultra_wide,wide,square,tall,ultra_tall | — |