Nodes/Louis Use/📐 Resolution Selector
ComfyUI Node

📐 Resolution Selector

Stop typing 1024×1024 — pick an aspect ratio and a megapixel budget instead

By LouisLU1997·Created 4 months ago·Updated 2 months ago· 0
📐 Resolution Selector
    • 宽度
    • 高度
    宽高比16:9
    百万像素2.0
    aspect_ratio

    There are two ways to think about a target resolution. One is "I want exactly 1024×1024." The other is "I want roughly 2 megapixels, in a 16:9 shape" - and let the math decide whether that's 1888×1060 or whatever fits. The second way is usually better, because it separates what shape from how big, and it lets you reuse one workflow across aspect ratios without editing hardcoded numbers. 📐 Resolution Selector is the node for that second way of thinking.

    You pick an aspect ratio and a megapixel budget; it hands you concrete 宽度 and 高度 integers. And it does the math the way diffusion wants it: dimensions are rounded to multiples of 64, which keeps the result VAE-friendly and eliminates a whole class of "why is my latent off by a couple pixels" confusion.

    The inputs

    • 宽高比 - 17 presets with Chinese labels: "1:1 正方形", "16:9 横屏" (landscape), "4:3 横屏", "2:1 超宽" (ultra-wide), "9:16 竖屏" (portrait), "1:2 竖屏", "9:21 超高" (ultra-tall), and so on. The full set covers square, wide, and tall orientations, and the labels are self-explanatory once you know 横屏 = landscape and 竖屏 = portrait.
    • 百万像素 (megapixels, 0.1–16, default 2) - the total pixel budget. 2.0 MP is the default and is a sane all-around target; drop it for VRAM-light models, raise it for detail-heavy work.

    There's also an optional aspect_ratio override input, which is the integration point with this pack's Ideogram4 Text Encode: that node emits an aspect_ratio string, you wire it here, and the dropdown gets overridden so the prompt's requested shape and the actual canvas always agree. That's the workflow they clearly built together.

    The outputs

    Two INTs: 宽度 and 高度. Wire them into Empty Latent Image (converted to inputs), a resolution-aware conditioning, or a Resize node. They're also just numbers you can read off the node if all you needed was "what's 2MP at 16:9, rounded to 64?"

    Installing it

    Part of the Louis Use pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use
    

    Or "Louis Use" in ComfyUI Manager, then restart. Zero dependencies beyond core - it's a math node with a pretty face (there's a JS extension that adds a small resolution preview under the widgets).

    The catch to know

    The math is simple but the rounding isn't obvious: it computes the aspect-ratio-consistent width, rounds to 64, then derives height from the budget and rounds that to 64 too. The result is close to your megapixel budget but rarely exact - that's a feature, not a bug, since exact 2.0 MP would usually break divisibility. And if you connect the aspect_ratio override, it wins over the dropdown entirely, so if the dropdown ever seems "stuck," check whether a wire is overriding it.

    CategoryLouis_use

    Inputs (3)

    NameTypeDefaultDescription
    宽高比COMBO16:917 options: 1:1 正方形, 16:9 横屏, 16:10 横屏, 4:3 横屏, 3:2 横屏, 5:4 横屏, +11
    百万像素FLOAT2.00.1–16输出图像的目标像素总量(百万),宽高由宽高比自动分配
    aspect_ratiooptSTRING接 Ideogram4 Text Encode 的 aspect_ratio 输出,覆盖上方宽高比下拉框

    Outputs (2)

    NameTypeDescription
    宽度INT
    高度INT