Nodes/comfyui-artify/Image Resize (Artify)
ComfyUI Node

Image Resize (Artify)

Resize that won't scale you twice — Image Resize (Artify)

By ArtifyGames·Created 7 months ago·Updated 27 days ago· 0
Image Resize (Artify)
  • image
  • mask
  • IMAGE
  • MASK
  • WIDTH
  • HEIGHT
custom_width0
custom_height0
megapixels0.00
scale_by1.00
resize_modelongest_side
resize_value0
upscale_methodlanczos
devicecpu
divisible_by2
divisible_modefloor
output_modestretch
crop_positioncenter
pad_color#FFFFFF

Image Resize (Artify) is one of those utility nodes you don't think you need until a workflow gives you a weirdly oversized latent and you realize the standard resize nodes were never quite telling you the truth. It's from a small, brand-new pack (first release early 2026, still near-zero install base) whose whole pitch is: the target size is computed once, and scale_by is applied exactly once. If you've ever stacked an ImageScale to a target and then an ImageScaleBy on top and watched the output come back at 1.5× what you asked for, you know the trap this one exists to remove. It's not flashy, but the math is genuinely more careful than ComfyUI's defaults.

How it picks the target size

The node works down a priority list, first match wins:

  1. megapixels - if above 0, it derives width/height from your image's aspect ratio and that many megapixels. Handy detail: a "megapixel" here is counted as 1024×1024 blocks, not 1,000,000 pixels, which is how models actually think about area. Max 16.
  2. resize_value + resize_mode - target the longest or shortest side to an exact number of pixels.
  3. custom_width / custom_height - set one and the other preserves aspect ratio automatically; set both and you get exactly that box.
  4. Original image size (so zeros across the board = no-op, which is useful for a passthrough branch).

Then scale_by is applied once on top of whatever base you chose (it's ignored when megapixels is active), and finally divisible_by snaps the result to a multiple - default 2, with floor/ceil/nearest rounding. Set it to 8 when you're feeding a Flux-family latent and need the grid alignment.

The inputs a beginner actually sets

  • megapixels or resize_value - pick one way to express "how big".
  • scale_by - the 1.25×-style multiplier, applied exactly once.
  • divisible_by - keep it at 2 or bump to 8 for model-friendly sizes.
  • output_mode - this is where it gets opinionated. stretch is the default (distorts to fill). crop keeps aspect ratio and crops off the overflow, anchored by crop_position. pad, pad_edge, and pad_edge_pixel letterbox with a solid pad_color, replicated edge pixels, or plain edge fill respectively. pillarbox_blur is the nice one: it fills the bars with a darkened, blurred version of the image itself - the classic look for fitting a 4:3 photo into a 9:16 video without a stark white border.

Watch the device switch

Default is cpu, and the tooltip is honest: "CPU is safest; GPU can be faster (Lanczos requires CPU)." If you set device to gpu and leave the default upscale_method at lanczos, it throws a ValueError - Lanczos is the sharpest of the plain interpolation kernels (the "more pixels, no invention" category, per the KB's upscaling hierarchy) and it doesn't run on the GPU path here. So either drop to bicubic/bilinear or just stay on CPU; for a single resize pass the speed difference is negligible.

Outputs

  • IMAGE - the resized image.
  • MASK - the same geometry applied to your optional input mask, or a black (zero) mask if you didn't supply one, so downstream mask nodes never choke.
  • WIDTH and HEIGHT - integers you can wire into an Empty Latent or a text node so your sampler genuinely uses the size you computed, instead of you re-typing it.

Install

It's one small pack with zero real dependencies - the requirements.txt contains only a comment. Install it via ComfyUI Manager (search ComfyUI-Artify or comfyui-artify in Custom Nodes Manager), or the classic way:

cd ComfyUI/custom_nodes
git clone https://github.com/ArtifyGames/comfyui-artify.git

Then restart ComfyUI and refresh the browser tab.

Troubleshooting

  • "Lanczos is not supported on GPU mode" - flip device back to cpu or switch the kernel.
  • "Target size exceeds MAX_RESOLUTION" - your scale or divisible_by pushed past 16384; lower it.
  • Size isn't what you typed - that's divisible_by snapping. Set it to 1 to skip rounding and get exactly what you asked for.
  • Sanity check from the README: feed a 1328×1328 image, all target fields at 0, scale_by = 1.25, and you should get 1660×1660. If it comes out 2075×2075, the old double-scale bug has crept back into your workflow somewhere else.
CategoryArtify/Image

Inputs (15)

NameTypeDefaultDescription
imageIMAGEInput image batch (BHWC).
custom_widthINT00–16384Target width. If only one side is set, the other preserves aspect ratio.
custom_heightINT00–16384Target height. If only one side is set, the other preserves aspect ratio.
megapixelsFLOAT0.000–16If > 0, computes size from megapixels and aspect ratio (highest priority).
scale_byFLOAT1.000.01–8Scale factor applied exactly once (ignored when megapixels > 0).
resize_modeCOMBOlongest_sideHow resize_value is interpreted: longest_side or shortest_side.
resize_valueINT00–16384Target side value used with resize_mode.
upscale_methodCOMBOlanczosInterpolation/upscale kernel.
deviceCOMBOcpuCPU is safest; GPU can be faster (Lanczos requires CPU).
divisible_byINT21–512Snap final width/height to a multiple of this value.
divisible_modeCOMBOfloorRounding mode for divisible snapping.
output_modeCOMBOstretchFinal fit behavior: stretch, crop, or padding variants.
crop_positionCOMBOcenterAnchor for crop and asymmetric padding placement.
pad_colorSTRING#FFFFFFPadding color for pad mode (#RRGGBB or #RGB).
maskoptMASKOptional mask resized with the same geometry as image.

Outputs (4)

NameTypeDescription
IMAGEIMAGE
MASKMASK
WIDTHINT
HEIGHTINT