Nodes/ComfyUI-mnemic-nodes/✏️ Literal Int
ComfyUI Node

✏️ Literal Int

The whole-number source you wire when three nodes need the same int

By MNeMoNiCuZ·Created 3 years ago·Updated a day ago· 105
✏️ Literal Int
    • value
    value0

    ✏️ Literal Int is a single integer field with an output socket. The range is absurdly wide (a signed 64-bit range, so effectively 0 to 18 quintillion on the positive side), which makes it fine for seeds as well as ordinary counts.

    The use case is the oldest trick in ComfyUI: turn a number that lives in three widgets into a number that lives in one node. Right-click the widget - width on an empty latent, steps on a KSampler, max_length on a text node - choose Convert widget to input, and the box becomes a socket. Now a Literal Int can feed all of them.

    Where that pays off

    • Width and height across a base pass, an upscale pass and a resize node. Bake the same two numbers into one place and stop discovering that your first pass is 1024 and your second is 1216.
    • Steps, when you want the second pass to be cheap. One int feeding both samplers, then change it once when you're testing.
    • Seed, when you want the same seed in several places. The engine's own control_after_generate widget only belongs to one node; if four nodes need to agree on a seed, this is how they agree.

    The flip side of converting a widget is that the widget is gone. You can't type a one-off override into that node any more - disconnect the wire if you want the field back, or use a switch.

    Don't confuse it with the random/seed nodes

    This node does not randomise. It outputs exactly the number you typed, every run, forever. The same pack has Random Int in Range and Random Seed for when you want variation, and those are different tools with different caching behaviour. Picking the wrong one is a classic five-minute confusion: your "random" values look suspiciously stable because you dropped a literal in there.

    Also worth knowing if you're returning after a while: core ComfyUI now ships typed primitives (PrimitiveInt and friends), so this isn't the only way to get a typed value node any more. In an older workflow you may also see the polymorphic Primitive node, which adopts whatever type it's plugged into - same idea, less explicit.

    Install

    ComfyUI Manager → ComfyUI-mnemic-nodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
    

    Restart. Nothing downloads for this node specifically. The pack is a ~40-node bundle, though, so its requirements.txt (transformers, opencv-python, tiktoken, imageio, piexif, groq, wonderwords and more) installs as one block - the heaviest possible way to obtain an integer field, and the price of the grab-bag format.

    Category⚡ MNeMiC Nodes

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0-18446744073709550000–18446744073709550000Integer value.

    Outputs (1)

    NameTypeDescription
    valueINTThe number entered above, passed straight through.