Nodes/DOGMA Nodes/DOGMA Vision Resize — Max Side
ComfyUI Node

DOGMA Vision Resize — Max Side

Your VLM doesn't need a 4000px photo — this node is the bouncer

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA Vision Resize — Max Side
  • image
  • image
  • info
max_side1024
multiple16

Vision-language models tokenize an image into patches. Feed one a 24-megapixel photo and you're paying for an enormous vision tensor - VRAM, seconds, sometimes an outright OOM - to describe a scene the model would have described just as well from a 1024px thumbnail. This node is the small, boring bouncer at that door: cap the longest side, keep the aspect ratio, hand the VLM something sane.

It's also a "gotcha insurance" node rather than a glamorous one. If you're running the pack's semantic-detailer graph - VLM inventories the scene, plan node turns the inventory into segmentation jobs - this sits between your image and the VLM, in front of the whole chain.

What it does to your image

Downscale only. If the longest side is already at or under max_side, you get the batch back byte-for-byte and an info string reading Qwen input unchanged: WxH. No resample, no VAE-ish round trip, nothing to second-guess. That's why it's safe to leave in a chain you're not sure needs it.

Otherwise it scales the longest side down to max_side, rounds both dimensions to the nearest multiple of multiple, and then corrects for the rounding so the cap is never exceeded - if the rounding pushed the long side over, it snaps that side down to a multiple and recomputes the short side proportionally to keep the aspect. The resample itself is bicubic with antialiasing, which is the right choice for downscaling: bilinear on a big reduction is how you get aliased sparkle in fine texture, and fine texture is precisely what a VLM is being asked to notice.

The info string then reads Qwen input: 4000x3000 -> 1024x768 (max side 1024). Wire it to a Show Text node. It's the receipt for what the VLM actually saw - and if it says "unchanged" while your VLM is still crawling, the resize isn't your bottleneck.

The two settings

max_side defaults to 1024 and ranges 256–4096 in steps of 64. Set it to whatever your VLM wants - the pack's own info strings name Qwen throughout, so 1024 is a good default for Qwen3-VL-class nodes, but if your node documents 768 or 1280, use that. There's no benefit to feeding it more than it accepts; the model's own preprocessor just crops or downsamples it again.

multiple defaults to 16 and ranges 1–64. Vision transformers cut images into fixed patches, and 16 is a friendly alignment for the patch sizes in common use - it keeps your dimensions from getting rounded somewhere else along the way. If you need an exact aspect ratio and don't care about patch alignment, drop it to 1. That's the only reason to touch it.

Both inputs are plain widgets here, unlike the text nodes in this pack. image is an IMAGE batch, and the two outputs are image (the resized batch) and info (STRING).

Inputs and outputs at a glance

image      IMAGE  -> in
max_side   INT    -> default 1024
multiple   INT    -> default 16
image      IMAGE  -> out, to your VLM node
info       STRING -> out, to Show Text

Install

Manager → search DOGMA Nodes. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes

Restart ComfyUI. There are no third-party dependencies to chase - the pack's requirements.txt is a comment and its pyproject.toml declares an empty dependency list. In the node menu, search "vision resize"; it lives under category DOGMA/Semantic Detailer rather than one of the numbered DOGMA/v5x categories, which is why people who go looking in the v52 group don't find it.

Two things to know before you wire it

It drops alpha. The resize slices image[..., :3], so a fourth channel is gone. That's correct for VLM input and wrong for a compositing chain - don't reach for this as your general-purpose image resizer. It's a pre-VLM step, and it's honest about it.

It raises on anything that isn't an image batch. Feed it a mask or a latent by accident and you get DOGMA Vision Resize expects IMAGE [B,H,W,C]. That's an unusually clear error message for a ComfyUI node; take it literally and check the wire rather than the node's settings.

One more thing worth internalizing: because it never upscales, it can't be blamed for a VLM reading your image poorly. If the model can't find your subject, the problem is the image or the prompt, not the scale you fed it.

CategoryDOGMA/Semantic Detailer

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
max_sideINT1024256–4096
multipleINT161–64

Outputs (2)

NameTypeDescription
imageIMAGE
infoSTRING