Nodes/ComfyUI-CitronNodes/Int Literal (Citron Image Saver)
ComfyUI Node

Int Literal (Citron Image Saver)

The 0-to-a-million integer box, and when it's the wrong one

By citronlegacy·Created about a year ago·Updated 22 days ago· 0
Int Literal (Citron Image Saver)
    • INT
    ◄int0►

    An integer box that goes from 0 to 1,000,000. Output is INT. That ceiling is the whole personality of this node - and the reason it's the wrong choice for at least one job people try to use it for.

    How it works

    One required input, int, default 0, min 0, max 1000000, no step (so it's a whole-number field). One output, INT. Straight pass-through, no arithmetic, no randomisation.

    What it's good for: counts and indices that live in the low thousands. Batch size. Number of frames. A tile grid's column count. A slice index for a batch-of-images node. A repeat count on a loop. All of those are comfortably inside a million, and the range is small enough that the widget's arrow keys are actually usable - unlike a 64-bit field where a stray keystroke sends you to a number with nineteen digits.

    What it's bad for: seeds. This is the trap. A seed is a 64-bit value in ComfyUI, and the practical values people copy around are routinely nine or ten digits long - more than a million. If you wire an Int Literal into a sampler's seed input and type a real seed into it, you'll be silently recording a different seed than the one you meant, because the field clamps. That's what the pack's Seed Generator is for: same idea, 64-bit range, plus a control_after_generate control and an offset field. Use that for seeds, use this for counts.

    The other limitation is the absence of a negative floor. Anything that wants a negative - an offset, a signed delta - can't be expressed here. When you need that, use a widget whose range actually allows it rather than fighting this one; the pack's Seed Generator accepts a signed increment, for example.

    And like every literal in this family, it records a value rather than guaranteeing one. If you wire it to a node's converted input, that wire wins and the node's own widget is dead weight - but if you forget the conversion, the widget wins and your carefully placed literal does nothing. That failure is silent, which is why the "convert widget to input" step is worth doing carefully the first time you build a graph you plan to reuse.

    ComfyUI's own PrimitiveInt covers the same ground if you're not already using this pack; there's no unique feature here beyond the tighter, arrow-key-friendly range and living in the same family as the other Citron literals. Nothing in this node will improve an image.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/citronlegacy/ComfyUI-CitronNodes
    # restart ComfyUI
    

    ComfyUI Manager may not have the pack indexed - the README still marks support "coming soon" and the repo's package metadata is placeholder - so use the clone. Only pip dependency is piexif, needed by the saver module; without it the pack's import fails wholesale:

    pip install piexif
    

    No model downloads. Category: Citron_ImageSaver/utils.

    Common issues

    • My seed got truncated. Above 1,000,000 the field clamps. Use Seed Generator.
    • Negative number rejected. No signed range on this widget - pick a different source.
    • Nothing downstream changed. The target widget wasn't converted to an input, so it's still authoritative.
    • The value appears in metadata but the run used something else. Same as above - a wired-looking socket that's really still a widget value.
    CategoryCitron_ImageSaver/utils

    Inputs (1)

    NameTypeDefaultDescription
    intINT00–1000000integer number

    Outputs (1)

    NameTypeDescription
    INTINTint (INT)