Complete toolkit for generating optimized dimensions for Wan 2.2 video generation in ComfyUI.
Two complementary nodes that generate Wan 2.2 compliant video dimensions:
| Node | Best For | Input | Ratios |
|---|---|---|---|
| Aspect Ratio Helper | I2V workflows | IMAGE (required) | Any (auto-detected) |
| Size Preset | T2V workflows | None (dropdowns only) | 15 predefined |
Both nodes follow official Wan 2.2 specifications:
- ✅ Divisibility by 8 pixels
- ✅ Aspect ratio range: 1:3 to 3:1 (0.333 to 3.0)
- ✅ Smart hybrid algorithm using 28 documented training sizes
Load Image → Wan 2.2 Aspect Ratio Helper → Empty Latent Video
- Auto-detects aspect ratio from input image
- Generates optimized dimensions matching your reference
Wan 2.2 Size Preset → Empty Latent Video
- Select aspect ratio from 15 presets
- Choose size preset (tiny to gigantic)
- Perfect for starting from scratch
- 📷 Analyzes input image aspect ratio automatically
- 🎯 Generates 6 optimized sizes (tiny → gigantic)
- 🔄 Change size preset without rewiring
- 📊 Smart hybrid: uses known Wan 2.2 sizes when available
- ⚡ Handles any ratio from 1:3 to 3:1
- image: IMAGE tensor (required)
- size_preset: tiny | small | medium | large | extra-large | gigantic (default: medium)
- width: INT - Selected width based on preset
- height: INT - Selected height based on preset
- info_text: STRING - Formatted display of all 6 sizes
Load Image (1920×1080)
↓
Aspect Ratio Helper
├─ Detects: 16:9 ratio (1.778)
├─ size_preset: "medium"
└─ Output: 1080×608
- 📐 15 predefined aspect ratios
- 🎯 6 size presets (tiny → gigantic)
- 🚫 No image input needed
- 🔄 Change ratio or size without rewiring
- ⚡ Perfect for platform-specific formats
- aspect_ratio: 15 predefined options (default: "16:9 Widescreen")
- size_preset: tiny | small | medium | large | extra-large | gigantic (default: medium)
- width: INT - Selected width
- height: INT - Selected height
- info_text: STRING - Formatted display of all 6 sizes
Portrait (Vertical)
- 1:3 Ultra-Tall Portrait
- 9:21 Tall Portrait
- 9:19.5 Tall Portrait
- 9:16 Tall Portrait (Instagram, TikTok)
- 3:4 Portrait
- 5:6 Portrait
Square
- 1:1 Square (Instagram)
Landscape (Horizontal)
- 6:5 Landscape
- 4:3 Standard
- 16:10 Widescreen
- 16:9 Widescreen (YouTube, HD)
- 19.5:9 Widescreen
- 21:9 Ultra-Wide (Cinematic)
- 3:1 Ultra-Wide Landscape
Size Preset
├─ aspect_ratio: "16:9 Widescreen"
├─ size_preset: "medium"
└─ Output: 1080×608
Both nodes offer 6 size options:
| Preset | Target Pixels | Example (16:9) | Use Case |
|---|---|---|---|
| Tiny ⚡ | ~200K | 592×336 | Ultra-fast testing, iteration |
| Small | ~400K | 848×480 | Quick tests |
| Medium ✨ | ~650K | 1080×608 | Standard quality (default) |
| Large | ~900K | 1280×720 | High quality |
| Extra-Large | ~1.4M | 1600×904 | Very high quality |
| Gigantic 🎯 | ~2M | 1896×1072 | Maximum quality, production |
1. TINY → Test ideas quickly (seconds)
2. SMALL/MEDIUM → Refine composition
3. LARGE → Quality validation
4. GIGANTIC → Final production render
Size Preset
├─ aspect_ratio: "16:9 Widescreen"
├─ size_preset: "large"
└─ Output: 1280×720
Size Preset
├─ aspect_ratio: "9:16 Tall Portrait"
├─ size_preset: "medium"
└─ Output: 408×720
Size Preset
├─ aspect_ratio: "1:1 Square"
├─ size_preset: "medium"
└─ Output: 720×720
Size Preset
├─ aspect_ratio: "21:9 Ultra-Wide"
├─ size_preset: "extra-large"
└─ Output: 1408×608
Use this to pick the right node:
| Your Situation | Use This Node |
|---|---|
| Have reference image | Aspect Ratio Helper |
| Starting from scratch | Size Preset |
| I2V workflow | Aspect Ratio Helper |
| T2V workflow | Size Preset |
| Need exact ratio from artwork | Aspect Ratio Helper |
| Know target platform | Size Preset |
| Custom/unusual ratio | Aspect Ratio Helper |
| Standard ratio (16:9, 9:16) | Size Preset |
Both nodes use the same intelligent sizing:
- Check Known Sizes: Searches 28 documented Wan 2.2 training sizes
- Match Criteria: Ratio within 5% AND pixels within 30%
- Use Documented: If match found, use known size (better model performance)
- Calculate Optimal: If no match, calculate ideal dimensions
- Round to 8: Ensures all dimensions divisible by 8
Square: 720×720
Portrait: 560×720, 560×896, 560×1088, 560×1280, 688×880, 688×1072, 848×1088
Landscape: 720×560, 896×560, 1088×560, 1280×560, 880×688, 1072×688, 1088×848, 1280×720, 1280×800, 1280×544, 1600×640
Additional: 1088×672, 672×1088, 1088×704, 704×1088, 1072×672, 672×1072, 1280×768, 768×1280
When no known size matches:
height = sqrt(target_pixels / aspect_ratio)
width = aspect_ratio × height
# Round both to nearest multiple of 8Both nodes integrate seamlessly with:
[Aspect Ratio Helper OR Size Preset]
├─ width ──→ Empty Latent Video (width)
└─ height ──→ Empty Latent Video (height)
Multi-LoRA Loader (Wan T2V/I2V/Qwen)
└─ model ──→ Wan Model Node
- Empty Latent Video
- Show Text (for info_text)
- Note (for documentation)
- Reroute (for clean connections)
Both nodes print detailed information:
==================================================
Wan 2.2 Aspect Ratio Helper
==================================================
Input Image Dimensions: 1920×1080
Detected Aspect Ratio: 16:9 Widescreen (1.778)
All Available Sizes:
tiny: 592×336 (198,912 pixels)
small: 848×480 (407,040 pixels)
→ medium: 1080×608 (656,640 pixels)
large: 1280×720 (921,600 pixels)
extra-large: 1600×904 (1,446,400 pixels)
gigantic: 1896×1072 (2,032,512 pixels)
Selected Output: 1080×608
==================================================
A: Restart ComfyUI - new nodes load on startup.
A: Check console output for detailed breakdown. All dimensions guaranteed divisible by 8.
A: Start with "medium" (default) for best balance. Use "tiny" for testing, "gigantic" for final renders.
A: Yes! Edit ASPECT_RATIOS dictionary in Wan22_Size_Preset.py.
A: Aspect Ratio Helper automatically clamps to valid range (1:3 to 3:1) with console warning.
- ✨ Added "tiny" preset (~200K pixels) for ultra-fast testing
- ✨ Added "gigantic" preset (~2M pixels) for maximum quality
- Now 6 size presets total
- ✨ Simplified to 3 outputs (width, height, info_text)
- ✨ Size Preset node created as T2V companion
- ✨ Change presets without rewiring
- ✨ Dynamic calculation with official Wan 2.2 specs
- ✨ Divisibility by 8 (not 16)
- ✨ Full ratio range 1:3 to 3:1
- 🎉 Initial Aspect Ratio Helper release
nodes/Wan22_AspectRatio_Helper.py- Image-based aspect ratio nodenodes/Wan22_Size_Preset.py- Preset-based size selection node
documentation/WAN22_NODES_README.md- This fileCHANGELOG.md- Detailed version history
Author: Eric
Category: Wan 2.2 / Video Generation
License: MIT
Created: January 2025
Updated: October 2025
- ComfyUI - Main framework
- Wan 2.2 Model - Video generation model
- Multi-LoRA Loaders - Compatible LoRA management nodes
For issues, feature requests, or questions:
- Check console output for error details
- Review this documentation
- Open an issue on GitHub
Quick Links: