Nodes/ComfyUI-RyuuNoodles/test Is Multiple Of x Check 🐲
ComfyUI Node

test Is Multiple Of x Check 🐲

Does this number divide evenly by 64? This node's entire personality

By DraconicDragonΒ·Created about a year agoΒ·Updated 2 months agoΒ· 12
test Is Multiple Of x Check 🐲
  • number_a
  • number_b
  • is_a_multiple_of
  • is_b_multiple_of
β—„multiple64β–Ί
β—„error_if_b_nonefalseβ–Ί
β—„false_instead_nonefalseβ–Ί

The display name still says "test" in front of it - as in "test Is Multiple Of x Check 🐲" - which tells you everything about how the author ships things: built it, works, never renamed it. And what it does is exactly what the name says: it checks whether a number is a multiple of another number, and hands you booleans you can act on.

What it does

You give it a number_a (required) and a multiple (default 64). It computes number_a % multiple and reports whether it's zero. Optionally give it a number_b and it checks that one too. Outputs:

  • is_a_multiple_of - boolean, is number_a a clean multiple?
  • is_b_multiple_of - boolean for number_b, or None if number_b wasn't provided.

It's float-safe: the check uses a small tolerance (1e-8) so a float that's technically 64.0000000001 doesn't fail the check. And it has two knobs for handling the optional input:

  • error_if_b_none - raise an error if number_b is missing. Turn this on if the absence of number_b is itself a workflow failure.
  • false_instead_none - output False instead of None for is_b_multiple_of when number_b is missing. Useful when you're wiring the boolean into a switch or condition that expects a real boolean.

Why you'd use it

It's a guard node. The classic use is right after a Scale To Multiple or a latent size node: "did my width actually land on a multiple of 8/64?" Wire is_a_multiple_of into a switch or a validation branch, and you can halt or redirect the workflow when the math didn't come out clean. Video pipelines that demand specific multiples are a natural fit - you can check before feeding a sampler rather than discovering the mismatch three nodes later. Both number_a and number_b are *-typed, so you can feed them INT or FLOAT from anywhere.

The inputs

  • number_a - required. The primary number to test.
  • multiple - the divisor. Default 64; set to 8 or 16 for video-model conventions.
  • number_b - optional second number to test.
  • error_if_b_none / false_instead_none - the None-handling options above.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/DraconicDragon/ComfyUI-RyuuNoodles

Restart ComfyUI, or use ComfyUI Manager (search "RyuuNoodles"). No models, no extra dependencies.

Gotchas

The None behavior is the thing that'll surprise you once: with number_b disconnected and both error/false options off, is_b_multiple_of outputs None - and some downstream nodes choke on None where they'd accept False. That's exactly what false_instead_none exists for; switch it on if you're feeding a boolean socket. Also note it's marked experimental in the code, and if number_a itself is None it raises a ValueError - keep the required input fed.

CategoryRyuuNoodles 🐲/Numbers

Inputs (5)

NameTypeDefaultDescription
number_a*The number to check if it is a multiple of the 'multiple' value. Required input.
multipleINT64β€”
error_if_b_noneBOOLEANfalseIf True, will raise an error if number_b is None.
false_instead_noneBOOLEANfalseIf True, will output False instead of None if number_b is None. This does not bypass the error_if_b_none option.
number_bopt*Optional second number to check if it is also a multiple of the same value.

Outputs (2)

NameTypeDescription
is_a_multiple_ofBOOLEANβ€”
is_b_multiple_ofBOOLEANβ€”