ComfyUI Node

Wildcard Loader

The loader half of a two-node wildcard system — and yes, the folder is lowercase

By OmniCromn·Created 5 months ago·Updated 5 months ago· 0
Wildcard Loader
    • wildcard_data
    wildcard_file
    seed0
    prepend
    append

    WildcardLoader is the boring half of a two-node system, and it's fine with that. It reads a .txt file from your wildcards folder, parses it into tagged, weighted entries, bundles them with a seed, and hands the bundle off to a Wildcard Injector (Dynamic) - the node that actually does the random replacing. On its own it outputs nothing you can see. Think of the pair as "load the deck" and "draw the cards," and this node is the deck.

    Why would you reach for a whole second wildcard system? Because the ecosystem default - Impact Pack's WildcardProcessor and its __filename__ tokens - is a lot of machinery if all you want is "pick a random animal from a list." This pack is a single Python file, zero dependencies, no model downloads. You trade Impact's enormous feature surface for something you can read in one sitting. Just know that wildcard libraries made for Impact or Dynamic Prompts won't drop in cleanly: the token syntax here is its own thing (__wildcard1/...__, not __filename__), so expect to reformat.

    What it does

    When ComfyUI starts, the node scans ComfyUI/models/wildcards/ and builds a dropdown of every .txt file it finds. At run time it parses the chosen file line by line: a line like <mammals> opens a tag, </mammals> closes it, and anything else becomes an entry tagged with the stack that's open at that moment. A value:weight line like cat:3 gets a weight of 3 - but nothing is random here. The randomness lives in the injector; the loader just parses and packages.

    The inputs that matter

    • wildcard_file - dropdown of .txt files in models/wildcards/. This is the one you'll actually touch.
    • seed - integer, defaults to 0. Seeded random selection downstream, so the same seed plus the same file reproduces the same pick.
    • prepend / append - the README advertises these as "built in," but here's a source-grounded heads-up: in the version I read, both are accepted, stored in the data, and then never read by anything. They're inert. Don't wire your workflow around them yet.

    Output: one wildcard_data socket, which you plug into any of the wildcard1wildcard5 inputs on a Wildcard Injector.

    Installing

    This is the easy case. ComfyUI Manager → search Simple-wildcards-for-comfyui → install → restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OmniCromn/Simple-wildcards-for-comfyui
    

    Restart ComfyUI. There's no requirements.txt - the whole pack is wildcards.py plus an example file, so there's nothing to pip install and nothing heavy to download.

    Gotchas, in the order they'll bite

    • The folder is lowercase wildcards. The README writes "Wildcards," but the code joins models_dir with "wildcards". On Linux or macOS that case difference is real - a Wildcards/ folder silently won't be found.
    • New files need a restart. The dropdown is built at startup, so a .txt you just dropped in won't appear until you restart ComfyUI.
    • Seeds are reproducible, but only within a session. The pick is seeded from seed + hash(file path), and Python's string hashing is randomized per process. The same seed can give you a different animal after a restart. Lock the seed to replay a run while it's running; don't expect it to survive a reboot.
    • Nothing here forces a rerun. The loader has no IS_CHANGED override, so it only fires when an input changes. If you want a fresh pick every generation, wire its seed input from a Seed node set to randomize - then the input actually changes, and the cache lets go.

    It's a small tool with two sharp edges: the folder name and the startup-time dropdown. Get past those and it just quietly feeds the injector.

    CategoryWildcards

    Inputs (4)

    NameTypeDefaultDescription
    wildcard_fileCOMBO0 options:
    seedINT00–999999999
    prependSTRING
    appendSTRING

    Outputs (1)

    NameTypeDescription
    wildcard_dataWILDCARD_DATA