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:
add the
wildcards.pyto yourComfyUI/custom_nodesdirectoryadd a
wildcardsdirectory to your ComfyUI installation directoryadd
txtfiles to your new directory for your wildcardsreference these wildcards in your prompt with double underscores (ie:
__name__)add the node to the ui and hook it up
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)
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.)
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
@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?
I found a math node batch. Ugh. Not a unified node. Still sorting it out.
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
thanks for the prompt node!


