Nodes/Doom_Flux_NodePack/Doom Image Resize
ComfyUI Node

Doom Image Resize

One resize node for megapixels, exact sizes, scale, or long/short side

By PeterMikhai·Created about a year ago·Updated 6 days ago· 1
Doom Image Resize
  • image
  • image
  • width
  • height
  • status
modemegapixels
megapixels1.00
width1024
height1024
scale_factor1.00
target_side1024
resize_methodstretch
interpolationbicubic
multiple_of0
pad_color_str#000000

Doom Image Resize is the pack's universal image-resize node, and the word "universal" is doing real work: it covers five different ways to decide the target size and four different ways to fit into it, which between them handle almost every resize request you'll hit in a ComfyUI graph. If your current workflow is a knot of ImageScale, ImageScaleBy, and crop nodes with hand-computed constants, this is the node that collapses them.

Where it shines is pre-processing for the pack's own samplers: Flux models have resolution and divisibility requirements (step 8, and Flux.2's 16-channel VAE wants sane dimensions), and video models have stricter ones (MiniMax H3 / LTX want multiples of 32). Instead of doing that arithmetic in your head, you pick a target and a multiple_of and the node handles the rest.

How it works

The mode input picks how the target size is computed:

  • megapixels - scale so the image is N megapixels total (default 1.0). The "fit everything to ~1MP" workhorse for feeding batches to image models.
  • width_height - exact target width × height.
  • scale_factor - multiply both dimensions by a factor (0.5 = half).
  • long_side / short_side - fit the long (or short) edge to target_side, keeping proportions. The classic "make everything 1024 on the long edge" mode.

Then resize_method decides how the image fits that box:

  • stretch - squash to the exact size, distorting aspect. The default; be deliberate about it.
  • keep_proportion - fit inside the box, preserving aspect.
  • fill_crop - scale to cover the box, then crop the overflow. Great for forcing a uniform aspect without distortion.
  • pad_center - fit inside and letterbox with a fill color (pad_color_str, e.g. #000000 or white).

Rounding is handled by multiple_of (0 = off) and interpolation (nearest/bilinear/bicubic/area/lanczos, default bicubic). Outputs: the resized image, the computed width and height ints (handy for wiring into a latent or a VAEEncode), and a status string describing what happened.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/PeterMikhai/Doom_Flux_NodePack

Restart or ComfyUI Manager. No extra deps; current ComfyUI. The README's DoomAI_nodes.git clone line is stale - the live repo is Doom_Flux_NodePack.

Common issues

  • stretch as the default bites people. It's the first resize_method in the list and it destroys aspect ratios silently. If your images come out squished, you left it on stretch - switch to keep_proportion, fill_crop, or pad_center.
  • Odd dimensions downstream. Set multiple_of to 8 for Flux, 32 for the video models; the pack's DoomGetImageSizeNode exists for the same divisibility discipline, and the samplers will silently fail or degrade on wrong sizes.
  • Megapixels mode upscales too. Targeting 1.0 MP will upscale small images to reach 1MP, not just downscale big ones. If you want only-downscale, use long_side/short_side with a cap, or filter inputs upstream.
  • pad_color_str accepts hex or names (#RRGGBB, black, white, grey…). A malformed color string falls back awkwardly; when in doubt, use hex.

It's a "why isn't this in core ComfyUI" kind of node: five sizing modes, four fitting methods, divisibility, and a status readout, all in one green box.

CategoryDoom/Utils

Inputs (11)

NameTypeDefaultDescription
imageIMAGEВходное изображение
modeCOMBOmegapixelsСпособ расчёта размера
megapixelsFLOAT1.000.01–100Целевые мегапиксели (mode=megapixels)
widthINT10240–16384Целевая ширина (mode=width_height)
heightINT10240–16384Целевая высота (mode=width_height)
scale_factorFLOAT1.000.01–10Множитель размера (mode=scale_factor)
target_sideINT10240–16384Целевая сторона (mode=long_side / short_side)
resize_methodCOMBOstretchstretch — растянуть; keep_proportion — вписать; fill_crop — заполнить и обрезать; pad_center — вписать с заливкой
interpolationCOMBObicubicМетод интерполяции (lanczos → bicubic)
multiple_ofINT00–512Кратность сторон (0 — без ограничения)
pad_color_strSTRING#000000Цвет заливки при pad_center: '#RRGGBB' или имя (black/white/grey/...)

Outputs (4)

NameTypeDescription
imageIMAGEИзображение после ресайза
widthINTИтоговая ширина
heightINTИтоговая высота
statusSTRINGСводка операции