test Is Multiple Of x Check π²
Does this number divide evenly by 64? This node's entire personality
- number_a
- number_b
- is_a_multiple_of
- is_b_multiple_of
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, isnumber_aa clean multiple?is_b_multiple_of- boolean fornumber_b, orNoneifnumber_bwasn'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 ifnumber_bis missing. Turn this on if the absence ofnumber_bis itself a workflow failure.false_instead_none- outputFalseinstead ofNoneforis_b_multiple_ofwhennumber_bis 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| number_a | * | The number to check if it is a multiple of the 'multiple' value. Required input. | |
| multiple | INT | 64 | β |
| error_if_b_none | BOOLEAN | false | If True, will raise an error if number_b is None. |
| false_instead_none | BOOLEAN | false | If 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)
| Name | Type | Description |
|---|---|---|
| is_a_multiple_of | BOOLEAN | β |
| is_b_multiple_of | BOOLEAN | β |