A ComfyUI custom node for handling image resolutions with smart, model-aware presets for 2026 diffusion models.
| Model | Use Case | Resolution Multiple | Source |
|---|---|---|---|
| Qwen-Image | Text-image-to-image | 28px | Official docs |
| Illustrious | Anime | 32px | Community standard |
| Z-Image | Text-image-to-image | 32px | Official docs |
| Flux2-Klein/Flux | Text-image-to-image | 32px | Similar to Z-Image/Illustrious |
- Dynamic Dropdowns: Size dropdown filters to show only relevant presets for your selected model
- Model-Aware Snapping: Automatically rounds resolutions to required multiples (28px or 32px)
- Robust Resizing: Multiple resize modes—
Center Crop,Scale to Fit,Stretch to Fill
Category: latent/AutoSize
Generates an empty latent tensor at a model-aligned resolution.
| Input | Description |
|---|---|
model |
Target model (qwen-image, z-image, flux, illustrious) |
size |
Preset or "Full Custom" |
custom_longer_size |
Longer side in pixels (set to 0 to use preset) |
custom_ratio |
Aspect ratio for custom mode |
batch_size |
Number of latents |
Outputs: latent, width, height, size
Category: image/AutoSize
Resizes an existing image and/or mask to target dimensions.
| Input | Description |
|---|---|
crop_method |
Center Crop, Top-Left Crop, Scale to Fit, Stretch to Fill |
scale_method |
lanczos, bicubic, bilinear, nearest |
image |
Optional input image |
mask |
Optional input mask |
Outputs: image, mask, width, height, size
cd ComfyUI/custom_nodes
git clone https://github.com/jluo-github/comfyui-auto-size.gitRestart ComfyUI and reload the browser.
- Custom Override (
custom_longer_size > 0): Calculates resolution from longer side + ratio, snapped to model's multiple - Preset Mode (
custom_longer_size = 0): Uses the Size dropdown value directly
nodes/ ComfyUI node definitions
utils/ Core logic (presets, resizing)
js/ Dynamic dropdown behavior
tests/ Unit tests
Made with ❤️ for the ComfyUI community