Nodes/Pseudocomfy/Int Variable
ComfyUI Node

Int Variable

Pass a whole number around without losing it in a widget

By Pseudotools·Created 2 years ago·Updated 7 days ago· 4
Int Variable
    • int
    val0

    PseudoVarInt ("Int Variable") is the integer sibling of the pack's float and string variables. You feed it a whole number, it hands the same whole number back. No rounding, no clamping, no side effects - just a value that lives in a named, wireable node instead of buried in a widget.

    Which sounds pointless until you need an integer in a place ComfyUI doesn't easily let you put one. Some nodes only expose their ints as widgets. Others want an INT wire - a literal you can route around the graph. And in a scripted or parametric workflow, the thing you most want is a stable address for a value: "batch count = 4" written once, feeding every node that needs it, and driven externally when automation decides to change it.

    That last one is the real reason this node is in Pseudocomfy. The pack's Rhino Pseudorandom integration rewrites these variable nodes on every submitted run, so an int that's a named node - not a widget inside a KSampler - is a value the plugin can reach. It's also handy in hand-built workflows: type 4 once, wire it to the batch size on the empty latent and the count on anything else that takes a batch, and you stop editing the same number in three places.

    Inputs and outputs

    The whole schema, both halves of it:

    • val (INT) - the value, default 0.
    • Output int (INT) - the same value, passed through.

    Feed it into any INT input that accepts a wire - batch sizes, step counts, frame counts, seed math. Note the output is a plain INT, not a seed, so ComfyUI won't attach its control_after_generate behavior like it does on PseudoSeed. If you want a randomize/increment control, that's what the dedicated seed node is for.

    When to bother

    Be honest with yourself here. For a one-off generation, editing the widget on the target node is fewer clicks than wiring up a variable. PseudoVarInt pays off when:

    • One integer needs to drive several inputs at once.
    • You're building a workflow for someone else and want named, obvious controls.
    • Something external - the Rhino plugin, a script, another tool - needs a stable place to write a value.

    If you're doing none of that, skip it. It's a plumbing node, not a feature.

    Installation

    Same pack, same two routes as every other Pseudocomfy node:

    # ComfyUI Manager: Custom Nodes Manager > search "Pseudocomfy" > Install
    
    # or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/Pseudotools/Pseudocomfy.git
    

    Then restart ComfyUI. On the Windows portable build, follow the README's first step and install diffusers into the embedded Python (.\python_embeded\python.exe -m pip install diffusers) - the pack's bigger pipeline needs it even though this node doesn't.

    Troubleshooting

    • The console prints [pseudocomfy] PseudoVarInt: <n> on every run. That's normal, and it's your easiest way to confirm external tooling actually wrote the value you expected.
    • If a downstream node still ignores your value, check whether that node accepts an INT wire or only a widget - some ComfyUI nodes read their widget and ignore incoming wires. The variable node is innocent; the target node is being stubborn.
    • Values arrive as plain Python ints via int(val), so 2.0 from a float feed would become 2 - but since the input is typed INT, you won't normally be feeding it floats anyway.

    That's the whole node: a named integer you can wire everywhere and let external automation reach. Simple, boring, and occasionally exactly what a shared workflow is missing.

    CategoryPseudocomfy/Vars

    Inputs (1)

    NameTypeDefaultDescription
    valINT0

    Outputs (1)

    NameTypeDescription
    intINT