Nodes/ComfyUI LC123 Nodes/LC Size Pad 📐
ComfyUI Node

LC Size Pad 📐

Stop typing 1216 and hoping the model agrees

By lonecatone23·Created 3 months ago·Updated about 14 hours ago· 46
LC Size Pad 📐
    • width
    • height
    • info
    ◄modelKrea 2►
    ◄aspectfree►
    ◄megapixels1.00►
    ◄width1024►
    ◄height1024►

    Why you'd reach for it

    Every SDXL guide tells you to use "a bucket" - 1024×1024, 1216×832, 1344×768. Every video model has its own idea of a legal size. Those numbers are all multiples of something, and the something changes per architecture: 64 for SDXL, 32 for MiniMax H3 and LTX, 16 for Krea 2 and the Klein models. So you open a calculator, or you type 1920 and get a slightly squashed composition with no error explaining why.

    LC Size Pad is a two-dimensional slider for width × height with those rules baked in. Drag the corner of a frame, pick the model, and it hands you a size the model is happy with: snapped to the right step, capped under that model's megapixel ceiling. It outputs plain integers, so it drops into an Empty Latent Image, a resize, a video latent node - anywhere a width and height are wanted.

    How it works

    The pad itself is a JS canvas widget in the pack's web/ folder: a frame pinned bottom-left, drag its top-right corner, and the aspect lock and megapixel readout update as you go. The Python side snaps and clips.

    Each preset carries three numbers: a step that both sides must be a multiple of, a default size in megapixels (roughly what the model was made for), and a ceiling at which the drag simply refuses to go further. Snapping rounds to the nearest step, halves up. If the result exceeds the ceiling, both sides are scaled down by the square root of the ratio and floored to the step, so the shape is preserved and the cap is respected.

    The ceilings are the interesting bit, because they're opinions and mostly good ones:

    | Preset | Step | Stops at | |---|---|---| | MiniMax H3 | 32 | 1.6 MP (trained around 1344×768) | | Krea 2 | 16 | 2.0 MP | | SDXL | 64 | 1.5 MP (its buckets) | | LTX | 32 | 2.1 MP (1280×704 to 1920×1088) | | Klein 9B | 16 | 4.0 MP | | Wan 2.2 | 16 | 0.93 MP (720p is 1280×720) | | Custom | 8 | 16 MP, no real limit |

    That Wan 2.2 ceiling is the most useful thing on the node: Wan wants roughly 720p, and the pad physically stops you dragging into a size that generates mush.

    The inputs that matter

    • model - the whole point. It defines step, default size and ceiling. Custom gives you steps of 8 and gets out of the way.
    • aspect - free or one of eleven locked ratios (1:1, 4:5, 2:3, 9:16, 21:9 and friends). Locking keeps the shape while you drag, which is how you explore "how big can I go at 21:9" without doing algebra.
    • megapixels - the size at the current shape. Change it and the frame resizes; drag the frame and it updates. It never exceeds the model's limit.
    • width / height - the actual size, editable, and snapped on the way out.

    No optional inputs. This node doesn't consume anything, which is why it's safe to drop into any graph.

    What comes out

    width and height as INT, already snapped for the preset, and info, a string like 1344 x 768 · 1.03 MP · Krea 2. The info output is worth wiring to a Show Text or into your filename - it's the fastest way to confirm that what you asked for is what the sampler got.

    Install

    ComfyUI Manager → ComfyUI LC123 Nodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
    

    No pip step, no models - the repo ships no requirements.txt. But this node does have a frontend half, so after installing or updating, restart ComfyUI and hard-refresh the browser (Ctrl+F5). Without the refresh you'll get a node with no pad on it, which looks broken and isn't.

    Common issues

    No pad, just widgets. Browser cache - Ctrl+F5. If it persists, check that __init__.py sits directly in ComfyUI/custom_nodes/ComfyUI_LC123_nodes/.

    The size keeps changing back. You dragged past the cap. The pad clamps, and the clamp is the preset's whole value - if you genuinely want 3 MP on Wan 2.2, switch model to Custom and accept that you're outside tested territory.

    My model isn't in the list. Use Custom (steps of 8, no ceiling). The presets are guidance, not enforcement: nothing stops you feeding an unsnapped width to a latent node, you just get whatever the model does with it.

    Width and height are off the grid I expected. The preset decides, not the widget's step of 8. SDXL snaps to 64 and will happily move 1216 to 1216 or 1280 depending on your drag - watch the info readout.

    The preset isn't your checkpoint. These are the pack's opinions, not the model's hard limits. If your variant has a tighter budget than the ceiling suggests, set the megapixels yourself and stop trusting the pad.

    CategoryLC123/utils

    Inputs (5)

    NameTypeDefaultDescription
    modelCOMBOKrea 2Snaps the size to what this model wants (its step and size) and stops the drag at its megapixel limit. Custom: steps of 8, no real limit.
    aspectCOMBOfreeLocks the frame to this shape while you drag. free: any shape.
    megapixelsFLOAT1.000.1–16The size at the current shape. Changing it resizes the frame; dragging updates it. It never goes past the model's limit.
    widthINT102464–16384—
    heightINT102464–16384—

    Outputs (3)

    NameTypeDescription
    widthINTWidth, snapped for the model.
    heightINTHeight, snapped for the model.
    infoSTRINGe.g. 1344 x 768 · 1.03 MP · Krea 2