πΉ CYH Latent | Qwen Aspect Ratio
Qwen-Image's odd-looking resolutions, pre-solved
- LATENT
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.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 16:9 (Widescreen) - 1664Γ928 | 5 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 |
| orientation | COMBO | Portrait | 2 options: Portrait, Landscape |
| multiplier | FLOAT | 1.00.1β10 | β |
| batch_size | INT | 11β64 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |