Skip to content

Add conditional INT/FLOAT ops, choose nodes, and fix BOOLEAN socket types#15

Open
dnnagy wants to merge 1 commit intoevanspearman:mainfrom
dnnagy:feature/conditional-ops-and-choose
Open

Add conditional INT/FLOAT ops, choose nodes, and fix BOOLEAN socket types#15
dnnagy wants to merge 1 commit intoevanspearman:mainfrom
dnnagy:feature/conditional-ops-and-choose

Conversation

@dnnagy
Copy link
Copy Markdown

@dnnagy dnnagy commented Feb 2, 2026

This PR adds a set of control/math utility nodes that make it easier to build graphs with optional/gated arithmetic.

Changes

  • Conditional unary/binary ops for FLOAT
    • CM_FloatUnaryOperationConditional
    • CM_FloatBinaryOperationConditional
    • Inputs: condition: BOOLEAN, operands, plus fallback_mode and fallback_value
  • Conditional unary/binary ops for INT
    • CM_IntUnaryOperationConditional
    • CM_IntBinaryOperationConditional
    • Same behavior as float nodes
  • Choose (mux) nodes
    • CM_ChooseInt, CM_ChooseFloat
    • Output a if condition else b
  • Fix: boolean socket compatibility
    • Standardize condition node outputs from ("BOOL",) to ("BOOLEAN",) so they can connect into BOOLEAN inputs reliably (e.g. into the new conditional-op nodes).

Files touched

  • src/comfymath/float.py
  • src/comfymath/int.py
  • src/comfymath/control.py
  • src/comfymath/number.py
  • src/comfymath/vec.py

- Add conditional unary/binary ops for INT and FLOAT with fallback mode\n- Add ChooseInt/ChooseFloat mux nodes\n- Standardize boolean socket type to BOOLEAN for compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant