π Wildcard Importer
You already own a thousand wildcard files β here's how this pack can use them
- output_yaml_path
- status_message
- files_processed_count
There's a huge ecosystem of .txt wildcard files out there - the {a|b|c} dynamic-prompt libraries that Impact Pack and the A1111 crowd have been trading for years, where each file holds a list of clothing options, backgrounds, poses, whatever. This pack's categorization nodes don't speak that format; they want a single YAML file with categories. The π Wildcard Importer is the adapter that bridges the two. Point it at a folder of .txt files and it converts the lot into one YAML the other four nodes can consume.
That's its whole job, and it's the right kind of boring. You don't hand-edit anything. The filename becomes the category name, each non-comment line becomes a tag, and the result lands in a imported_wildcards.yaml.
How it works
Drop your wildcard files into the pack's wildcards/ subfolder (ComfyUI/custom_nodes/ComfyUI-Prompt-Formatter/wildcards/), run the node, and it scans for .txt files. Each file's stem is the category (clothing.txt β clothing), each line is a tag, # comments are skipped, and everything is written out sorted. The output_yaml_path output is the absolute path to the file it just wrote - and that's the elegant part: you wire it straight into the category_definition_file input of the Random Formatter or Formatter, and those nodes immediately see all your imported categories. No manual path typing.
The inputs that matter
wildcard_directory- defaults to the pack's ownwildcards/folder. You can point it at any folder, including a shared wildcard library you keep elsewhere. (If the default shows as a path starting with/tmp/..., ignore that - it's just how the schema was captured; on your machine it resolves to your actual install path.)wildcards_to_import-*for everything (default), or a comma-separated list of filenames without the.txt.write_mode-Overwriteis the default and nukes the old YAML each run. The three Merge modes matter if you're iterating: skip categories that already exist, overwrite them, or append only new unique tags. Appending is the safe choice once you have a curated YAML you don't want clobbered.ignore_private_wildcards- on by default; skips files starting with_, which the wildcard community uses for helper/partial files.
Outputs: output_yaml_path (wire into the other nodes), status_message (a human-readable "Processed 12 wildcards, added 340 tags" line), and files_processed_count.
Installing
ComfyUI Manager (search "ComfyUI-Prompt-Formatter"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/xLegende/ComfyUI-Prompt-Formatter
Restart ComfyUI. PyYAML is the only dependency; no model downloads. One thing to know: the importer writes its output inside the pack's own directory - you'll see imported_wildcards.yaml appear next to the node code, not in your wildcards folder. That's by design (self-contained), but it also means a git pull update of the pack can potentially interact with that file, so don't rely on it as your only copy of a carefully merged category set. The README's example loop is the pattern: importer β output_yaml_path β Random Formatter β generate. Set that up once and your whole wildcard library becomes random-prompt fodder.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| wildcard_directory | STRING | /tmp/ComfyUI/custom_nodes/ComfyUI-Prompt-Formatter/wildcards | β |
| output_yaml_file | STRING | imported_wildcards.yaml | β |
| wildcards_to_import | STRING | * | β |
| write_mode | COMBO | Overwrite | 4 options: Overwrite, Merge (Skip Existing Categories), Merge (Overwrite Existing Categories), Merge (Append Unique Tags) |
| ignore_private_wildcards | BOOLEAN | true | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output_yaml_path | STRING | β |
| status_message | STRING | β |
| files_processed_count | INT | β |