image scale pixel option
The advanced settings panel for image scale pixel v2
- refer_to
- s
image_scale_pixel_option doesn't resize anything by itself - it's a settings bundle you plug into image_scale_pixel_v2's option input when the defaults on that node aren't enough. Skip it entirely and image_scale_pixel_v2 behaves the same as if you'd connected this node with every setting left at its own default; connect it only once you need to control how the target size gets reached, not just what the target is.
It's part of the small ratio toolset inside ComfyUI-WJNodes, a large personal utility pack from GitHub user 807502278 that spans cropping, video slicing, color tools, and file operations.
How it works
The core scaling node picks a total pixel budget and an alignment multiple, but doesn't otherwise decide how to get an odd-shaped source image to a specific target aspect ratio. This node fills that gap: pick a target scale (a ratio like "16:9" or "original" to keep the source's own proportions), then decide what happens when the source doesn't already match - fill the frame and let content spill past the edges, crop to fit, or pad out to a bounding box with a fill color. It also controls the resample filter and how fractional pixel counts get rounded.
The inputs and outputs that matter
scale(defaultoriginal) - target aspect ratio:original,1:1,3:4,4:3,2:3,3:2,9:16, or16:9.size_mode(defaultcrop) - how the image reaches that ratio:fill,crop, orbbox(pad out to a bounding box).crop_bbox_method_width/crop_bbox_method_hight(both defaultcenter) - which edge the crop or bbox padding favors on each axis (center, left/right, up/down).fill_color(default#ffffff) - the padding color used inbboxmode.round_width/round_hight(both defaultround) - how fractional pixel counts get rounded: round, ceil, or floor.method(defaultLANCZOS) - the resample filter used for the actual resize.Enable_TotalPixels(default on) - leave this on to respect the pixel budget set onimage_scale_pixel_v2; the description notes turning it off makes the node crop/fit to your chosen ratio using the original image size instead of the target pixel budget.any_alignment(default 0, meaning no override) - set this above 0 to override whatever alignment multiple you picked on the main node, for an arbitrary integer alignment instead of the preset list.refer_to(optional,*type) - connect another image, mask, or latent here to borrow its size directly, overriding thescaleratio setting entirely.
Output is a single s (an SO-typed bundle) that plugs straight into image_scale_pixel_v2's option input - nothing else consumes it.
How to install it
Via ComfyUI Manager, search "ComfyUI-WJNodes." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
Restart ComfyUI. No models needed - this is a settings node, nothing runs inference.
Common issues & troubleshooting
Connecting this node changed nothing. Its defaults are explicitly designed to match image_scale_pixel_v2's own built-in defaults, so if you haven't changed any of its settings, connecting it shouldn't alter behavior - the whole point is you only need it once you deviate from a default.
Output resolution ignores your TotalPixels setting from the main node. Check Enable_TotalPixels - if it's off, the description says the node crops/fits to your target ratio using the original image size rather than respecting the pixel budget on image_scale_pixel_v2.
Padded regions show up in a color you didn't expect. That's fill_color, only relevant in bbox size mode, defaulting to white (#ffffff) rather than black or transparent.
Alignment override doesn't seem to apply. any_alignment only takes effect above 0 - left at its default of 0, the main node's own alignment dropdown selection is used instead, not overridden.
No outside reference for this specific settings node. It's a companion to a niche resize node in a personal pack with no public discussion - when in doubt, test one setting change at a time against the main node's output rather than adjusting several at once.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| scale | COMBO | original | 8 options: original, 1:1, 3:4, 4:3, 2:3, 3:2, +2 |
| size_mode | COMBO | crop | 3 options: fill, crop, bbox |
| crop_bbox_method_width | COMBO | center | 3 options: center, left, right |
| crop_bbox_method_hight | COMBO | center | 3 options: center, up, down |
| fill_color | STRING | #ffffff | — |
| round_width | COMBO | round | 3 options: round, ceil, floor |
| round_hight | COMBO | round | 3 options: round, ceil, floor |
| method | COMBO | LANCZOS | 6 options: LANCZOS, BILINEAR, BICUBIC, BOX, HAMMING, NEAREST |
| Enable_TotalPixels | BOOLEAN | true | — |
| any_alignment | INT | 00–8192 | — |
| refer_toopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| s | SO | — |