ComfyUI Node
π§ Image Size Calculator
Calculates width and height based on an aspect ratio and a target dimension size, rounding to a specific multiple.
π§ Image Size Calculator
- width
- height
- aspect_w
- aspect_h
βaspect_w1βΊ
βaspect_h1βΊ
βmodeβΎβΊ
βsize1024βΊ
βmegapixels1.00βΊ
βmultiple_of16βΊ
CategorySuperNodes/Tools
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_w | INT | 11β1024 | The width ratio of the desired aspect ratio (e.g., 16 for 16:9). |
| aspect_h | INT | 11β1024 | The height ratio of the desired aspect ratio (e.g., 9 for 16:9). |
| mode | COMBO | Determines if the size applies to max/min dimension, or if target is total megapixels. | |
| size | INT | 10241β32768 | The target length for the dimension specified by dimension mode. |
| megapixels | FLOAT | 1.000.01β1024 | The target total megapixels when mode is 'megapixels'. |
| multiple_of | INT | 161β1024 | The final dimensions will be rounded to the nearest multiple of this value. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | The calculated width. |
| height | INT | The calculated height. |
| aspect_w | INT | Passthrough width aspect. |
| aspect_h | INT | Passthrough height aspect. |