FL NFT Generator
FL_NFTGenerator — pick images by rarity weights encoded in their filenames
- IMAGE
- IMAGE
Despite the name, this isn't a mint-your-jpeg-to-the-blockchain node - it's a weighted random image picker. You point it at a folder of images whose filenames encode a rarity percentage, and it randomly selects one, respecting those weights, so common traits show up often and rare ones rarely. It comes from the generative-collection world (where you assemble artwork from randomly-drawn traits at set rarities), but the mechanic is useful anywhere you want seeded, weighted random selection from a pool of assets.
It lives in the pack's experiments category, and honestly it's a niche tool. But if you're building anything that draws from a weighted asset library - procedural backgrounds, random props, a trait-based character generator - this does the weighted draw for you deterministically.
How it works
The rarity lives in the filename, in the format name-XXXper-val - the XXXper chunk is the weight. The node reads every image in the folder, parses those weights, and does a weighted probability pick using your seed. Because it's seed-driven, the same seed always picks the same image, which is what makes runs reproducible. It also returns the selected image's matching mask file if one exists (a blank mask if not), so a picked trait can carry its own transparency/placement mask along with it.
The inputs and outputs
folder_path- the directory of candidate images, named with thename-XXXper-valrarity convention.dummy_seed(0–1,000,000) - the seed that drives the weighted selection. Same seed, same pick.
Outputs: two IMAGE outputs - the first is the selected image, the second carries its corresponding mask (blank if no mask file was found for that image). Wire the second into wherever you need the trait's mask.
How to install it
Part of filliptm's Fill-Nodes pack. ComfyUI Manager → search ComfyUI_Fill-Nodes → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt
No model download. You supply the folder of images.
Common issues & troubleshooting
Nothing gets picked / the weighting is ignored. The filename format is strict. If your files aren't named with the name-XXXper-val pattern, the node can't parse the rarity and the weighting falls apart. Rename your assets to the exact convention before pointing the node at them - this is the number-one gotcha.
The second output is blank. That's the mask output, and it returns a blank mask when there's no matching mask file for the selected image. If you need real masks, they have to exist in the folder alongside the images under whatever naming the node expects to pair them; otherwise you just get an empty mask, which is harmless if you're not using it.
I want a different image but keep getting the same one. It's seed-deterministic by design - a fixed dummy_seed always yields the same pick. Change the seed to draw again, or randomize it if you want variety each run. That determinism is a feature (reproducible results), not the node being stuck.
Rarities don't feel right across many draws. Remember it's probability, not a quota. A rare trait is unlikely per draw, not guaranteed to appear exactly once per N runs. Over a large number of seeds the distribution follows your weights; any single draw is just a weighted coin flip.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | — | |
| dummy_seed | INT | 00–1000000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| IMAGE | IMAGE | — |