Nodes/comfyui-mask-util/Image Resolution Limit With 8K
ComfyUI Node

Image Resolution Limit With 8K

A Safety Rail Against Oversized Images

By longgui0318·Created 3 years ago·Updated about a year ago· 8
Image Resolution Limit With 8K
  • image
  • image
limit8192

If your workflow ever takes user-supplied images from an unpredictable source - a phone photo, a scanned document, a stock file someone downloaded without checking dimensions first - you've probably had the experience of something absolutely enormous sneaking into your graph and either eating all your VRAM or just taking forever to process for no good reason. Image Resolution Limit With 8K is the guard rail: it caps an image's size so nothing bigger than you've asked for gets through.

There are exactly two inputs. image is what you're checking, and limit is an integer, default 8192, ranging from 512 up to 8192 in steps of 128 - the maximum you'll allow on the image's largest dimension. Set below the image's actual size and this node scales it down to fit; set above it and it's a no-op, your image passes through untouched. The output is a single image.

Where this earns its place is right after any node that pulls in images you don't fully control - right after a Load Image With Name driven by user input, right after an upload step, or right before anything expensive (a big sampler pass, an upscale chain) where you'd rather fail fast on dimensions than discover the problem forty seconds into a run that's going to time out or OOM anyway. It's a cheap, unglamorous insurance policy, and the fact that it defaults to exactly 8192 - the conventional "8K" ceiling - tells you it was built with that specific worst case in mind rather than as a generic clamp.

Installing it: part of comfyui-mask-util, a small utility pack from longgui0318 (also the author of comfyui-magic-clothing, a virtual-try-on node that briefly picked up Reddit attention in 2024 and has since gone quiet). This pack reads as general-purpose plumbing split out of that bigger project - crop math, device/dtype handling, and safety-rail nodes like this one. The GitHub README doesn't go beyond the repo title, so there's no official usage guide to draw from here.

Install via ComfyUI Manager (search "comfyui-mask-util") or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/longgui0318/comfyui-mask-util

Restart ComfyUI afterward. No downloads beyond the code - this is a size check and a downscale, nothing that needs model weights.

Where it bites: this only limits the largest dimension, so a very wide, short image and a very tall, narrow image can both come out looking quite different in scale relative to each other even under the same limit - it's not normalizing aspect ratio, just capping one axis. And because the minimum you can set is 512, you can't use this node to enforce a smaller ceiling than that if your pipeline genuinely needs tighter bounds - you'd need a different resize node for that case. Finally, remember this is a downscale-only safety net: it will never upscale an image that comes in under your limit, so don't expect it to do double duty as a "normalize everything to exactly this size" node - that's a different job.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
limitINT8192512–8192

Outputs (1)

NameTypeDescription
imageIMAGE