CivArchive
    ComfyUI Wildcards Custom Node - v1.0
    Preview 1617933
    Preview 1617935
    Preview 1617937

    Wildcard node for ComfyUI

    This is a custom node for ComfyUI to add in wildcard functionality from files. I really liked this one for A1111, so I wrote a node for ComfyUI. This node creates a Seed, and can be wired to the KSampler to reuse the same seed. This is beneficial if you want to replicate the same image, without replacing the wildcard with actual text.

    Usage:

    1. add the wildcards.py to your ComfyUI/custom_nodes directory

    2. add a wildcards directory to your ComfyUI installation directory

    3. add txt files to your new directory for your wildcards

    4. reference these wildcards in your prompt with double underscores (ie: __name__)

    5. add the node to the ui and hook it up

    6. enjoy!

    Known Issues:

    • if you use a batch greater than 1, it will use the same wildcard prompt for the whole batch. i'm not sure if there is a way yet to modify the clip to handle multiple values with multiple latents

    • currently only looks for files with letters (upper and lower case), numbers, and hyphens

    github source: https://github.com/lordgasmic/ComfyUI-Wildcards

    Description

    FAQ

    Comments (7)

    duemellon142Jul 21, 2023
    CivitAI

    Is it possible to have a true random # generator created for ComfyUI?

    1 -- A node that can generate random values between set parameters that can be fed into any numeric-receiving node/data point?

    1a -- A node that can pull from a dataset (non-number, like a text list) and be randomized?

    2 -- A node that can take in or spit out basic numeric math solutions

    2a -- A node that can take in/out basic dataset logic functions (if, then, combine, etc.)

    lordgasmic
    Author
    Jul 21, 2023

    Without getting into the nature of TRUE random numbers in computing, i'll try to answer your questions:
    1 -- yes, relatively easily. If you want one, I can make one
    1a -- If I understand your question correctly, that is the problem I am trying to solve with this node. At the core, this node takes "seed MOD num_file_lines". It's random enough, but then also can be replicated if necessary
    2 -- prolly. Without more clarity, I cant be certain
    2a -- prolly, but more difficult than 2

    duemellon142Jul 22, 2023· 1 reaction

    @lordgasmic 1 & 1a - can the range/dataset be set at the Node GUI interface? or only pulled from a external file? That's the difference between 1a & what you have here, right?

    2 & 2a - I'm thinking 2 would be the biggest gain.

    As an example:
    I want to create a 2 prompt combination for an image. Where p1 takes up C amount of X-range and p2 takes up D amount of X-range, where C+D =100% of the x-range (also 100-C = D, etc.). And that's what I'd like to use the random & math node for

    Input at Node (gui) level:
    1. Random Node: set value of C = [0...100], then
    2. C feeds the X-range for P1
    3. C feeds Math node
    4. Math node: 100-C = D
    5. D feeds X-range for P2

    The Seed for the Random Node can be
    - static (GUI input),
    - fed from file,
    - fed from other node,
    - randomized

    But the Seed could also be run through the Math Node (separately) for other calculations
    ** since basically any value can be run through the Math Node

    Basically, relying on on-disk file dataset (number or words) is difficult to visualize & work with. Seeing the dataset/range & being able to edit it in-node-gui is more intuitive. And this would introduce math node & value generator (random) in a way Blender & UE have.

    Still possible?

    duemellon142Jul 22, 2023· 1 reaction

    I found a math node batch. Ugh. Not a unified node. Still sorting it out.

    AlamonelfSep 3, 2023· 1 reaction
    CivitAI

    ILY that convert seed to input is one of the best tips in comfyui solved a little problem for me with Efficiency's new sampler TY

    notruthsagaApr 7, 2025
    CivitAI

    thanks for the prompt node!

    Wildcards
    Other

    Details

    Downloads
    1,068
    Platform
    CivitAI
    Platform Status
    Available
    Created
    7/18/2023
    Updated
    5/11/2026
    Deleted
    -

    Files

    comfyuiWildcards_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.