Nodes/mewins_node_pack/Simple Expression
ComfyUI Node

Simple Expression

Give your graph an if-statement

By efuentesamin·Created 7 months ago·Updated 7 months ago· 0
Simple Expression
    • result
    operand_a
    operand_b
    operator

    Of the nodes in this pack, Simple Expression is the one that actually does something you can't trivially swap for the arithmetic pair. It compares two integers and returns a boolean - True or False. And that single BOOL output is how you give a ComfyUI workflow a decision.

    Why you'd care: most of ComfyUI is a straight line - do this, then that, then that. But real workflows get conditional. If the step count is above X, run the hires pass. If this seed is even, pick batch one. A boolean signal is the switch that lets a graph branch, and this node manufactures one out of a plain comparison.

    Mechanically it's a match statement over six comparison operators: =, !=, >, <, >=, <=. Both operands are INT. Note the = means "equal to" - single equals, matching the dropdown, not Python's ==. Everything in, and out comes a clean result BOOL.

    The honest take: modern core ComfyUI already ships a Compare node in its Logic category, and Compare does more - it accepts floats and strings too, with the same operator set. Simple Expression is a two-integer subset of that. Where it earns its place is where the whole pack earns its place: it's tiny, it's visible, and it gets a single comparison on screen without pulling in machinery. If you're on a recent ComfyUI you probably want Compare instead. If you grabbed this pack anyway, this is the node that does the interesting thing.

    The inputs that matter:

    • operand_a, operand_b - the two INT values being compared.
    • operator - the dropdown: =, !=, >, <, >=, <=.

    Output is result (BOOL). Wire it into any node that exposes a BOOLEAN input - the classic target is core ComfyUI's IfElse, which branches on exactly this kind of signal. It also feeds switch nodes and any custom node with a bool port.

    Installing it

    ComfyUI Manager, search "Mewins Node Pack", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/efuentesamin/mewins_node_pack
    

    No dependencies, no model downloads - the pack's pyproject.toml lists zero runtime deps. Watch the Python >= 3.12 requirement if your ComfyUI env is on 3.10/3.11.

    Gotchas

    • INT operands only. You can't compare two floats directly - the connection refuses to type-match. Convert first (the pack ships a Float-to-Int node) or use core Compare, which accepts floats.
    • One comparison per node. No AND/OR, no "steps > 10 and cfg < 8" - that needs chained booleans plus a logic node, or a math-expression node.
    • = is equality. It looks like an assignment when you're auditing someone else's graph; read it as "is equal to."

    Keep the scale in mind: this is a single-commit, cookiecutter-scaffolded pack whose README still says "A list of features." Simple Expression is its most interesting node - a clean, dependency-free comparison that hands your graph a boolean. For anything more than that one comparison, core ComfyUI's Logic nodes are the grown-up version.

    CategoryMewins Node Pack

    Inputs (3)

    NameTypeDefaultDescription
    operand_aINT
    operand_bINT
    operatorCOMBO6 options: =, !=, >, <, >=, <=

    Outputs (1)

    NameTypeDescription
    resultBOOL