ComfyUI Node

Int

Integer params as recipes — how you feed rank, maxiter, and seed into a merge

By ljleb·Created 3 years ago·Updated about a month ago· 101
Int
    • recipe
    value0

    Int Mecha Hyper is the integer twin of Float Mecha Hyper: you type a whole number, it hands you a MECHA_RECIPE. In the Mecha Merge Node Pack, every parameter a merge method takes - including integers like ranks, iteration counts, and seeds - is passed as a recipe, so this little node is how you speak "the number 32" to a merge.

    What it feeds

    The interesting integer parameters in this pack:

    • rank on Truncate Rank Mecha Recipe - how many singular values to keep in the low-rank approximation.
    • maxiter on Geometric Median Mecha Recipe - cap on Weiszfeld iterations (default 100).
    • seed on Dropout and the TIES-with-DARE family - reproducibility knob for the random pruning.
    • count-style values in list builders, if you're scripting a workflow.

    One value input (an INT, default 0, step 1), one recipe output of type MECHA_RECIPE. The output is a literal param recipe - nothing executes until the whole graph reaches Mecha Merger, and even then it's just a scalar riding along in the key-by-key merge.

    The clever cousin of this node is Get Rank From Ratio Mecha Recipe, which computes a rank recipe from a model's shape and a ratio - so you can skip Int entirely for the rank case and let the merge size itself. For everything else, Int is the manual dial.

    Install

    ComfyUI Manager → search mechaMecha Merge Node Pack, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ljleb/comfy-mecha.git
    pip install -r comfy-mecha/requirements.txt
    

    Restart after. Sole Python dependency is sd-mecha==1.1.7; no models are downloaded by the pack.

    Gotchas

    Same family of foot-guns as the other Hyper nodes: the default 0 is meaningful, so a stray Int set to zero will zero out whatever it feeds - a rank of 0 on a truncate merge is a very flat result. And integer params are still recipes, so if a socket won't accept your Int output, check whether it's expecting a MECHA_RECIPE_LIST (that's Mecha Recipe List, not this) or a different space. For most workflows you'll touch this node rarely - but when a merge needs a rank or a seed, it's the only plain-input way to say it.

    Categorymecha

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    recipeMECHA_RECIPE