Nodes/was-node-suite-comfyui/Number Multiple Of
ComfyUI Node Runs on cloud

Number Multiple Of

Snap a number to a valid latent size before it breaks your run

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Number Multiple Of

      This one does a single, boring, extremely useful thing: it snaps a number to the nearest (or next) multiple of another number. If that sounds too small to have its own node, you haven't hit the bug it exists to prevent yet. Diffusion models care a lot about the math behind your resolution - SD 1.5 and SDXL want dimensions that play nice with the VAE's 8x downsampling, and Flux specifically wants things divisible by 64. Type a resolution in by hand and you'll naturally pick a round number that satisfies this. Compute it from a formula - an aspect ratio, an upscale factor, some percentage of a source image - and you'll eventually land on an illegal number and get a cryptic tensor-shape error, or worse, a silent crop that shaves a few pixels off one edge without telling you.

      Number Multiple Of is the fix for the second case. Wherever your width or height is coming out of math instead of a typed-in value, you run it through this node before it hits Empty Latent Image (or a resize node) and it rounds to something the model will actually accept.

      The mechanics are exactly what the name implies: you give it a number and the multiple you want it snapped to, and it hands back the nearest legal value. Given how the rest of WAS's number-node family behaves, expect a choice of rounding direction - nearest vs. always-round-up - once the node's on your canvas; check its widget list for the exact option, since that detail isn't something you can see without the node in front of you. The output is a NUMBER, which you'd typically feed straight into a Number to Int or directly into whatever downstream node's width/height socket accepts a wired numeric input rather than a fixed widget value.

      Installing it: search "WAS Node Suite" in ComfyUI Manager and install - that's the easy path. Manually, it's cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui, then pip install -r requirements.txt (portable installs: python_embeded\python.exe -s -m pip install -r requirements.txt; manual installs: activate your venv first), then restart. This is a pure-math node with no models or extra dependencies attached to it, so once the suite itself imports cleanly you're done - there's nothing specific to this node to configure in was_suite_config.json.

      Where it bites: the node itself is about as low-risk as ComfyUI nodes get - there's no model to fail to download and no external dependency riding on it. The actual risk is upstream: WAS Node Suite has been unmaintained since December 2023 (its own README says "Retired" in the title), and the recurring complaint in the community is the whole suite failing to import after a ComfyUI or Python update, not this node specifically misbehaving. If Number Multiple Of vanishes from your node list, that's almost certainly the suite failing to load as a whole rather than anything wrong with this node - check your console for the actual import error before assuming it's this one. Beyond that, the only real gotcha is a conceptual one: make sure you're feeding it the multiple your model actually needs (8 for SD1.5/SDXL, 64 for Flux) rather than a number you assume is safe - get that wrong and the node will happily round to a value that's still illegal for the model you're running.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs