Nodes/Doom_Flux_NodePack/Doom Get Image Size
ComfyUI Node

Doom Get Image Size

Get an image's real dimensions — and force them into the divisibility your model needs

By PeterMikhai·Created about a year ago·Updated 6 days ago· 1
Doom Get Image Size
  • image
  • Width
  • Height
modenone
aspect_ratio1:1

Doom Get Image Size is a two-number utility: feed it an image, and it returns the width and height as integers. If that were all, it'd be a curiosity. The reason it's worth knowing is the second input - mode - which can normalize those dimensions before returning them. It doesn't resize the image; it just tells you what the dimensions should be to satisfy a model's constraints, so you can wire the result into a latent size or a resize node.

This matters more than it sounds. ComfyUI's samplers are picky about dimensions in different ways: Flux wants step-8-friendly sizes, and the video models are worse - MiniMax H3 and LTX demand multiples of 32. Feeding a 1023×767 image (or, worse, an odd size from an upscaler) into those models is a classic source of silent errors, black frames, or outright OOMs. This node is the "measure twice, cut once" step.

How it works

The mode combo decides what comes out:

  • none - dimensions as-is. Plain width/height readout.
  • even - round each side down to even.
  • multiple_of_16 - round each side down to a multiple of 16 (Flux-friendly territory).
  • multiple_of_32 - round each side down to a multiple of 32. The tooltip flags it explicitly: MiniMax H3 / video.
  • aspect_ratio - recompute so the image matches a target ratio (1:1, 3:4, 4:5, 1:3, 9:16), keeping the long side. Good when you want a uniform format across a batch regardless of source.

Outputs: Width and Height ints, ready to feed into a Latent size, EmptyLatentImage, or the pack's DoomImageResize. That's the whole node - no image comes back out, because it's a measurement node, not a transform node.

Note the rounding is always down - it never rounds up past the input, so the result stays within the source image's bounds. A 1025×769 image under multiple_of_32 reports 1024×768, not 1056×800.

Installing it

Same pack, same one-liner:

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

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

Common issues

  • "It just prints numbers, what's the point?" Wire the ints into a downstream size. The node's whole job is making sure those numbers are model-safe before they reach a sampler. Use it in front of any video-model img2img.
  • aspect_ratio looks wrong for extreme sources - a 21:9 panorama forced to 1:1 reports a square based on the short side (it keeps the smaller dimension for 1:1), which is a heavy crop. That's the ratio doing its job; just know it's destructive for extreme aspect sources.
  • Rounding down surprises people with "stretched" latents - if you asked for multiple_of_16 and the actual image is 1025 wide, the sampler now runs at 1024. Pair the reported size with DoomImageResize (fill_crop or pad_center) when the difference matters.

It's a tiny node, but it's the difference between a video workflow that runs and one that fails with a dimension error on frame one.

CategoryDoom/Utils

Inputs (3)

NameTypeDefaultDescription
imageIMAGEВходное изображение
modeCOMBOnoneРежим нормализации: none — как есть; even — чётные стороны; multiple_of_16 — кратность 16; multiple_of_32 — кратность 32 (MiniMax H3 / видео); aspect_ratio — привести к аспекту
aspect_ratioCOMBO1:1Целевой аспект при mode=aspect_ratio

Outputs (2)

NameTypeDescription
WidthINTШирина после нормализации
HeightINTВысота после нормализации