Priority (Best-Res)
Pick which resolution gets the perfect aspect ratio (as a wire, of course)
- priority
Here's a subtle problem hiding in every HD-fix workflow: when you round an initial resolution and an upscaled resolution to different steps, the two can end up with slightly different aspect ratios. Best-Res (area+scale) has to decide which one gets to keep the exact ratio you asked for - and Priority (Best-Res) is the dropdown for that decision, exposed as a wire so you can change it without digging through a node.
It's a primitive passthrough, same pattern as Crop-Pad Strategy: one enum input, one enum output, zero math. The interesting part is what the three values actually mean.
The three priorities
original(default) - the initial resolution is rounded first, and the upscaled one is derived from it. The upscaled image inherits the init's ratio as closely as possible, even if that drifts from your requested aspect ratio. This is the safe default: the composition you see in pass one is the composition you get in pass two.desired- both resolutions are rounded independently toward your requested ratio. Each size individually is closest to what you asked, but the two sizes can differ from each other in ratio - which is exactly the situation that forces crop/pad later. Best when both sizes must each look right on their own and you're fine handling the mismatch.upscaled- the upscaled resolution is rounded first, and the initial one is back-tracked from it. Pick this when the final HD image is the one you care most about - e.g., it has to match a specific output size or a video frame - and the init pass is just a means to an end.
All three keep both sizes step-clean; they only differ in which size keeps the ratio and which one absorbs the rounding error.
Why a passthrough node
Best-Res (area+scale) has this same dropdown built in, so you only need this node if you want the choice to live elsewhere: on a control panel, driven by a primitive or switch, or changed per batch. It's also handy while you're learning what each priority does - pull it out, flip it, and watch the area+scale node's status readout show how the two sizes' ratios shift. The on-node display makes the tradeoff visible: you'll literally see "AR real/goal" drift on one of the two lines depending on your pick.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-BestResolution
or find "Best Resolution" in ComfyUI Manager, install, restart. frozendict is the only dependency; no models. Wire its priority output into the priority input of Best-Res (area+scale). If you never change your mind about the priority, leave the widget on the main node and skip this one entirely - it's pure convenience, not necessity.
The short version: original if you want pass two to match pass one, desired if you want both sizes individually closest to your ratio, upscaled if the final size is king. The tradeoff only matters once you start pushing step values up, which is the price of the pack's "keep everything divisible" discipline.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| priority | COMBO | original | Defines what resolution to prioritize, as well as which order to perform rounding in: • desired - first, approximate resolutions are calculated for both initial and upscaled size; then, both are rounded. In both cases, the rounded resolution is closest to the desired one, but aspect ratio might differ the most between sizes. • original - first, initial resolution is calculated and rounded; then, upscaled one is detected from it. Upscaled resolution might differ the most from the desired aspect ratio, but it follows the ratio from initial size as much as possible. • upscaled - vice versa: first, the rounded upscaled resolution is calculated; then, the initial one back-tracked from it. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| priority | desired,original,upscaled | — |