Nodes/SeargeSDXL/Integer Scaler
ComfyUI Node Runs on cloud

Integer Scaler

Multiply a number and snap it to a multiple

By SeargeDP·Created 3 years ago·Updated 2 years ago· 874
Integer Scaler
    • value
    value0
    factor1.00
    multiple_of1

    A tiny math node with one genuinely useful trick: it takes a number, multiplies it by a factor, and rounds the result to the nearest multiple of something you choose. That last part is why it exists. Image dimensions in diffusion have to be multiples of 8 (or 64, depending on what you're feeding), and this node lets you scale a width or height and land on a legal value automatically instead of eyeballing it.

    It lives under Searge/_deprecated_/Integers, part of the pack's older set of little arithmetic helpers. These exist because in a big procedural workflow you sometimes want dimensions computed from each other - "make the hi-res pass 1.5× the base width, rounded to a multiple of 8" - rather than hand-typed. That's exactly this node's job.

    How it works

    Three inputs, one line of math: output = round(value × factor), snapped to the nearest multiple_of. Give it a base resolution of 1024, a factor of 1.5, and a multiple_of of 8, and you get 1536 - cleanly divisible, ready to feed a latent. Set multiple_of to 1 and it's just plain rounding after the multiply.

    The value it emits is an INT, so it wires straight into any integer socket - a width field, a step count, whatever you're driving procedurally.

    The inputs and outputs that matter

    • value - the number to scale (e.g. your base width or height).
    • factor - the multiplier, a float (e.g. 1.5 for a 1.5× upscale target).
    • multiple_of - snap the result to this. Use 8 for latent-safe image dimensions; 64 if a downstream node is pickier.
    • value (output) - the scaled, snapped INT.

    Where it fits

    Honestly, this is workflow-builder plumbing, not something a casual user places by hand. If you're just running Searge's provided workflow, the resolution math is already wired for you. You'd reach for this node when you're constructing your own graph and want one dimension to derive from another - keeping a hi-res or upscale pass proportional to the base without a fixed number that breaks when you change aspect ratio. For SDXL specifically, the multiple-of-8 snapping is the point: off-grid dimensions get silently rounded or rejected downstream anyway, so doing it explicitly here keeps things predictable.

    How to install it

    ComfyUI Manager: search SeargeSDXL, install, restart. Manual: python -m pip install opencv-python in ComfyUI's Python env first (the pack requires it), then cd ComfyUI/custom_nodes && git clone https://github.com/SeargeDP/SeargeSDXL.git, restart. Windows portable users can run the installer script.

    No models involved - it's arithmetic.

    Where people get burned

    • Forgetting the snap. If a downstream node complains about dimensions, check multiple_of. Setting it to 1 means no snapping, and a factor like 1.333 will hand you an off-grid odd number.
    • Treating it as a float node. The output is an integer. Fractional results get rounded - that's the whole design, but it surprises people expecting exact 1.333× values.
    • Using it when you don't need to. If you're not building a procedural graph, you almost certainly don't need this. The stock workflow already handles resolution scaling.
    CategorySearge/_deprecated_/Integers

    Inputs (3)

    NameTypeDefaultDescription
    valueINT00–18446744073709550000
    factorFLOAT1.00
    multiple_ofINT10–65536

    Outputs (1)

    NameTypeDescription
    valueINT