Nodes/ComfyUI-DD-Nodes/DD Aspect Ratio Selector
ComfyUI Node

DD Aspect Ratio Selector

Stop googling the right resolution for Qwen-Image and Wan

By Dontdrunk·Created 2 years ago·Updated 20 days ago· 181
DD Aspect Ratio Selector
    • 宽度
    • 高度
    🤖 选择模型Qwen-image
    📐 选择比例横屏
    📏 选择宽高16:9

    Every new model ships with a list of "recommended resolutions" that nobody can remember, and getting them wrong costs you quality or outright failures. DD Aspect Ratio Selector turns that table into two numbers: pick a model, pick a shape, pick a ratio, and out come the exact 宽度 (Width) and 高度 (Height) integers the model wants. It's the sort of node that feels unnecessary until the first time you run Qwen-Image at a weird size and get mangled text or a crash.

    How it works

    The node carries hardcoded resolution tables for the two models it knows about:

    • Qwen-image: 1:1 → 1328×1328, 16:9 → 1664×928, plus 9:16, 4:3, 3:4, 3:2, 2:3. These are Qwen-Image's native buckets, which the model expects you to hit exactly.
    • Wan2.2: 1:1 → 960×960, 4:3 → 960×720, 16:9 → 832×480, plus their portrait and HD variants (1280×720, 720×1280). Those match the resolutions the Wan 2.2 community settled on for its video models.

    Three inputs drive it: 🤖 选择模型 (Select Model), 📐 选择比例 (Select Orientation - landscape/portrait/square), and 📏 选择宽高 (Select Ratio). The ratio dropdown is dynamically filtered by the frontend based on model and orientation, so you only ever see valid combos. The backend then returns the preset width and height, which you wire into your empty-latent node, Wan loader, or whatever needs dimensions.

    When you'd reach for it

    Anytime you're building a Qwen-Image or Wan 2.2 workflow from scratch and you don't want to consult a table. It also protects you from the classic mistake of feeding a video model a portrait ratio it wasn't configured for - picking "landscape" plus "16:9" and getting 832×480 for Wan is exactly what the model wants, not what you'd guess. And because it outputs plain INTs, it composes with any size-dependent node in the graph, not just this pack's own.

    Installation

    It ships in the DD-Nodes pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Dontdrunk/ComfyUI-DD-Nodes
    cd ComfyUI-DD-Nodes && pip install -r requirements.txt
    

    Restart, or install via ComfyUI Manager (search "ComfyUI-DD-Nodes"). No models or keys needed - it's pure lookup logic plus a small frontend piece for the dropdown filtering.

    Honest take

    The limitation is obvious: it only knows two models. If you're on Z-Image, LTX, or a newer Wan-adjacent model, the presets won't exist and you're back to manual. It's also a recommendation node, not a validator - it can't stop you from feeding the numbers into something that ignores them. But within its two-model scope it's exactly right, and the values it picks line up with what the model cards actually recommend. The field labels default to Chinese; the pack has an English locale if you prefer it. One small warning: since it returns fixed INTs, treat it as a reference table you can trust, not magic - Qwen-Image's native buckets have changed between versions, so if a model update changes the recommended sizes, the node's table is what goes stale first.

    Category🍺DD系列节点

    Inputs (3)

    NameTypeDefaultDescription
    🤖 选择模型COMBOQwen-image2 options: Qwen-image, Wan2.2
    📐 选择比例COMBO横屏3 options: 横屏, 竖屏, 方形
    📏 选择宽高COMBO16:93 options: 16:9, 4:3, 3:2

    Outputs (2)

    NameTypeDescription
    宽度INT
    高度INT