Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > wildcardcluster > Wildcard Cluster

ComfyUI Node: Wildcard Cluster

Class Name

WildcardCluster

Category
wildcards
Author
captaingrock (Account age: 0days)
Extension
wildcardcluster
Latest Updated
2026-08-02
Github Stars
0.0K

How to Install wildcardcluster

Install this extension via the ComfyUI Manager by searching for wildcardcluster
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter wildcardcluster in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Wildcard Cluster Description

Replaces prompt keywords with random or sequential lines from wildcard files to vary image prompts.

Wildcard Cluster:

WildcardCluster builds varied image prompts by replacing keywords in a template with lines selected from wildcard text files. You can use it to combine choices such as a character’s appearance, clothing, and setting while keeping the rest of your prompt consistent. Each configured keyword draws from its own file, and you can choose between repeatable random selections and selections that advance through a file in order. The node replaces every occurrence of a configured keyword in the template, making it useful for generating prompt variations without rewriting the prompt by hand.

Wildcard Cluster Input Parameters:

prompt_template

The required prompt text in which you place keywords to be replaced. Its default is A _gender person with _hair wearing _clo sits on the beach. For example, if _hair is configured and its selected file line is curly hair, that text replaces every occurrence of _hair in the template. Keywords without a usable configured replacement remain unchanged. This is a multiline string field; the source specifies no minimum or maximum length.

wildcards_config

A required string containing a JSON array of wildcard slots. Each slot identifies a keyword, a file containing possible replacement lines, and a mode such as random or sequential; for example, [`{"keyword":"_hair","file":"hair.txt","mode":"random"}`]. The interface stores these slots in this field and indicates that the frontend manages them with add and remove controls. An invalid JSON value, or a valid JSON value that is not an array, results in no slots being processed. A slot with an empty keyword or a file value of none is skipped. The field has a source-defined default named _DEFAULT_CONFIG, but its contents are not included in the provided code; no minimum or maximum length is specified.

base_dir

The required folder location used to find the wildcard text files named in the slot configuration. Its default is an empty string, which uses the node’s own wildcards/ folder. You can enter an absolute folder path, or a relative path resolved from the node’s directory. A file must resolve within the chosen base folder to be eligible for replacement. This is a string field with no specified minimum or maximum length.

prompt_prefix

Optional text placed before the completed template, separated from it by a space. Its default is an empty string, which adds nothing. This is useful when you want to carry text from an earlier node into the final prompt. Leading and trailing whitespace in the prefix is removed before it is added. The source specifies no minimum or maximum length.

seed

An optional integer that controls reproducible selections for slots using random mode. Its default is 0, with a minimum of 0 and a maximum of 4294967295. With the same files, slot positions, and seed, random-mode slots make the same selections; changing the seed can change them. Each slot uses the seed plus its position in the configuration. The seed does not control sequential-mode selections, which advance through their files.

Wildcard Cluster Output Parameters:

prompt

A single string containing the completed prompt. It begins with the template, replaces configured keywords when a usable line is selected from their files, and then adds a nonempty prefix at the beginning if one was supplied. If a slot is skipped or produces no replacement, its keyword remains in the template. The output is prompt text, not an image or a collection of separate choices.

Wildcard Cluster Usage Tips:

  • Put one possible replacement on each line of a wildcard text file, and make each slot’s keyword match the spelling in your template exactly. For example, a _hair slot can point to hair.txt while your template says with _hair.
  • Leave base_dir empty when your files are in the node’s default wildcards/ folder. Set it to the correct folder when your files are elsewhere, and use filenames that resolve inside that folder.
  • Choose random when you want a reproducible choice from a file, and adjust seed to explore different combinations. Choose sequential when you want a slot to move through its file line by line and cycle back to the start.
  • Keep related keywords distinct, such as _hair and _hair_color. The node applies longer keywords first so the shorter one does not alter the longer keyword before it can be replaced.
  • Check the completed prompt for keywords left unchanged. That is a practical sign to check the slot spelling, file selection, folder, and whether the file has usable lines.

Wildcard Cluster Common Errors and Solutions:

Keyword remains unchanged in the prompt

  • Explanation: No usable replacement was collected for that keyword. The slot may have an empty keyword, use none as its file, point outside the base folder, or produce no line; the keyword may also be spelled differently in the template.
  • Solution: Match the slot’s keyword exactly to the template text, select a file inside base_dir, and check that the file contains usable lines.

No keywords are replaced

  • Explanation: wildcards_config may contain invalid JSON or a JSON value that is not an array. In either case, the node processes no slots and returns the template text, apart from any prefix.
  • Solution: Check that the configuration is a JSON array of slot objects, for example [`{"keyword":"_hair","file":"hair.txt","mode":"random"}`]. If you use the frontend’s slot controls, review the slots shown there.

Selected file does not produce a replacement

  • Explanation: A slot whose file is none is skipped. A file path that does not resolve within the selected base folder is also skipped. If file reading yields no usable lines, the node has nothing to insert.
  • Solution: Select the intended text file, confirm base_dir points to its folder, and check that the file has lines available for selection. Keep the file path within that folder.

Random choices do not change when rerunning

  • Explanation: Random mode uses the supplied seed and each slot’s position to make repeatable selections. Reusing the same setup can therefore produce the same prompt.
  • Solution: Change seed to explore other selections. Use sequential instead when you want a slot to advance through its file on successive executions.

Sequential choices differ from the seed setting

  • Explanation: Sequential mode follows its saved position in the file and cycles through its lines; it does not use seed.
  • Solution: Use random mode if you need seed-controlled selections, or keep sequential when cycling through the file is your goal.

AttributeError involving get

  • Explanation: The slot-processing code calls slot.get(...). A configuration array containing a value that is not a slot object, such as a plain string, can therefore raise an error.
  • Solution: Make every entry in the JSON array an object with a keyword and file, plus a mode when you need to specify one.

Wildcard Cluster Related Nodes

Go back to the extension to check out more related nodes.
wildcardcluster
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Wildcard Cluster