Nodes/Chye ComfyUI Toolset/πŸ”Ή CYH Latent | Qwen Aspect Ratio
ComfyUI Node

πŸ”Ή CYH Latent | Qwen Aspect Ratio

Qwen-Image's odd-looking resolutions, pre-solved

By chyerΒ·Created about a year agoΒ·Updated 6 months agoΒ· 1
πŸ”Ή CYH Latent | Qwen Aspect Ratio
    • LATENT
    β—„aspect_ratio16:9 (Widescreen) - 1664Γ—928β–Ί
    β—„orientationPortraitβ–Ί
    β—„multiplier1.0β–Ί
    β—„batch_size1β–Ί

    Qwen-Image doesn't follow the same resolution rules as SDXL or Flux. Its base is 1328Γ—1328, not 1024Γ—1024 - an odd-looking number until you remember the model was trained on it and everything else degrades relative to that sweet spot. This node exists to stop you from guessing: pick a ratio, get an empty latent at the resolution Qwen-Image actually likes.

    It's one of the six aspect-ratio generators in the Chye ComfyUI Toolset pack, and it's the one you reach for specifically when your workflow is built around Qwen-Image (the 20B image generation model, usually running through its ComfyUI wrapper). The presets in the dropdown are tuned to Qwen's training resolutions rather than inherited from SDXL.

    How it works

    Same skeleton as every latent node in this pack: the dropdown label carries the resolution in the text (16:9 (Widescreen) - 1664Γ—928), the node parses the ratio, applies orientation and multiplier, rounds to a multiple of 32, and creates a zeroed latent tensor:

    latent = torch.zeros([batch_size, 4, final_height // 8, final_width // 8])
    

    Output is a plain LATENT - same type ComfyUI's Empty Latent Image produces, so it drops straight into a KSampler's latent input.

    The presets

    Five ratios, and notice how they differ from the SDXL and Flux versions of this node:

    • 1:1 - 1328Γ—1328 (the Qwen native base)
    • 4:3 - 1472Γ—1140
    • 3:2 - 1536Γ—1024
    • 16:9 - 1664Γ—928
    • 21:9 - 1984Γ—864

    Because the base is already ~1.32MP, these land comfortably in the 1MP–2MP band most current image models handle well. The multiplier (0.1–10.0) scales from there - 21:9 at 1.0 is 1984Γ—864, right around 1.7MP, which is fine; don't push past ~1.25 without a hires-fix second pass. Batch size (1–64) lets you generate a stack of blank latents for grid runs, and orientation (default Portrait) swaps width/height if you want the rotated version.

    The one trap

    The default orientation is Portrait, but the preset list is written in landscape terms - 1664Γ—928 is the landscape 16:9. If you pick 16:9 and leave the default, you'll actually get 928Γ—1664 (a portrait image) because the node swaps the dimensions. That's not a bug, it's the intended behavior, but it catches people who assume the label and the output match. Decide whether you want tall or wide, and set the orientation to match explicitly.

    Install

    ComfyUI Manager (search "Chye ComfyUI Toolset") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chyer/Chye-ComfyUI-Toolset
    cd Chye-ComfyUI-Toolset
    pip install -r requirements.txt
    

    Then restart ComfyUI. Nothing model-specific to download - this is pure code, no weights. Heavy dependencies are scipy and opencv-python; torch/numpy you already have. If you installed from a zip rather than git, drop a .git/.cnr-id file (content Chye-ComfyUI-Toolset) into the pack's .git folder as the README instructs, or workflow loads can complain.

    Honest verdict

    This one earns its keep only if you actually run Qwen-Image. If you don't, it's a curiosity. If you do, having the right resolutions one click away beats re-checking a Reddit table for the ninth time.

    Categorylatent

    Inputs (4)

    NameTypeDefaultDescription
    aspect_ratioCOMBO16:9 (Widescreen) - 1664Γ—9285 options: 1:1 (Square) - 1328Γ—1328, 4:3 (Standard) - 1472Γ—1140, 3:2 (Photo) - 1536Γ—1024, 16:9 (Widescreen) - 1664Γ—928, 21:9 (Ultrawide) - 1984Γ—864
    orientationCOMBOPortrait2 options: Portrait, Landscape
    multiplierFLOAT1.00.1–10β€”
    batch_sizeINT11–64β€”

    Outputs (1)

    NameTypeDescription
    LATENTLATENTβ€”