Nodes/comfyui-huyl2-nodes/Adaptive Resolution πŸ“
ComfyUI Node

Adaptive Resolution πŸ“

Adaptive Resolution πŸ“

By huyl3-cpuΒ·Created 9 months agoΒ·Updated 4 months agoΒ· 1
Adaptive Resolution πŸ“
    • resolution
    • batch_size
    β—„width512β–Ί
    β—„height512β–Ί

    This is a small decision node: give it the width and height of whatever you're about to process, and it tells you what resolution class and batch size to use, based on a rule the author hardcoded into it.

    The rule, straight from the node's own description. If the shorter side of your input is 720px or less, it calls that "720p" territory and recommends a batch_size of 7. If the shorter side is above 720px, it calls that "1080p" territory and drops the recommended batch size down to 2. That's a genuinely sensible trade-off to automate: smaller frames are cheaper per-item, so you can afford to push more of them through a batch at once; cross into 1080p-and-up territory and you back the batch size off to keep VRAM in bounds. It's the kind of rule of thumb you'd otherwise have to remember and manually adjust every time your input size changes.

    Inputs and outputs. width and height are both integers, defaulting to 512, with a range of 64–8192 in steps of 8 - their tooltips just say "Input width" / "Input height," nothing more nuanced than that. The two outputs are resolution (an integer - 720 or 1080, per the rule above) and batch_size (an integer - 7 or 2 to match).

    Worth being honest about the limit here: this is a two-bucket rule, not a smooth curve. Feed it 719px versus 721px and you get meaningfully different batch-size recommendations for two inputs that are, practically speaking, almost identical. Treat the output as a sane starting point you're free to override, not a value to wire blindly into your sampler and forget about.

    It's also worth noting what this node isn't: it doesn't touch your actual image or resize anything. It only produces numbers - resolution and batch_size - that you're expected to wire into other nodes that do the real work, like a resize node or a sampler's batch-size field. Think of it less as a processing step and more as a lookup table with two rows, one for "small," one for "big."

    Installing it. This ships inside comfyui-sortlist, published under the title comfyui-huyl2-nodes. Search that title in ComfyUI Manager, or clone it directly if the registry hasn't picked it up:

    cd ComfyUI/custom_nodes
    git clone https://github.com/huyl3-cpu/comfyui-sortlist
    

    Restart ComfyUI afterward.

    Troubleshooting. There's genuinely not much that can go wrong here - it's pure arithmetic with no external dependency, no model, no file I/O. If the numbers coming out don't match what you expected, the first thing to check is what's actually feeding width/height: a common mistake in bigger workflows is accidentally wiring in a canvas or output-target resolution instead of the source media's actual dimensions, which will silently give you a "correct" answer to the wrong question.

    Categoryutils

    Inputs (2)

    NameTypeDefaultDescription
    widthINT51264–8192Input width
    heightINT51264–8192Input height

    Outputs (2)

    NameTypeDescription
    resolutionINTβ€”
    batch_sizeINTβ€”