Nodes/ComfyUI_Dynamic_TagLoader/⚡Dynamic Tag Loader
ComfyUI Node

⚡Dynamic Tag Loader

Folders of .txt files become your prompt combinator

By NineKey1028·Created 8 months ago·Updated 5 days ago· 4
⚡Dynamic Tag Loader
  • model
  • clip
  • model
  • clip
  • positive
  • prompt
  • count
text_input
tag_settings{}

Wildcards are nothing new - Impact Pack has shipped the {a|b|c} syntax for years. What's rarer is the file-based version: ⚡Dynamic Tag Loader reads folders of plain .txt files, cross-multiplies them into every possible prompt combination, and hands the whole list downstream ready to sample. It's a batch-prompt machine with a friendly front end, and it's the flagship node of the small ComfyUI_Dynamic_TagLoader pack.

Why you'd reach for it

The use case is systematic variation without hand-writing a hundred prompts. Say you run an anime model that responds to Danbooru-style tags - characters, poses, backgrounds, styles. Organize each axis as a folder of .txt files in the pack's tags directory, add one Tag Group per folder, and the loader computes the cartesian product: one item from each group, every combination. Three groups with five files each is 125 prompt combos from a handful of text files. That's the entire appeal, and it's a genuinely nice fit for tag-driven checkpoints.

The text_input field is the Global Prompt - text that gets prepended to every single combination, first line. That's where your base prompt (masterpiece, best quality, 1girl or whatever) goes. Right-click inside a Tag Group to move it up/down, top/bottom, or delete it; "+ Add Tag Group" adds another axis. The folder/file pickers are populated from the server-side tag index, and choosing ALL as the file makes every .txt in that folder an option in the group. One thing to internalize: a whole multi-line file is one slot. If you want line-level variation, use separate files - each file is an option.

What's under the hood

The tag_settings input is a JSON string, but you'll almost never touch it - the UI buttons build it for you, and it's kept hidden in the widget. The node reads that config, walks the tags folder, then runs itertools.product across groups to generate combos. Two behaviors worth knowing:

  • LoRA-in-prompt: put <lora:name:weight> inside a .txt file or the Global Prompt and the loader extracts it, loads the LoRA, applies it to the model/CLIP, and strips the syntax from the output prompt. Per-group LoRA variation, fully automatic.
  • Cache bypass: the node returns a nan change-signal, so ComfyUI always re-runs it and re-reads your files. Great while you're editing tags, costs a sliver of speed.

Inputs: text_input, tag_settings, and optional model + clip. Outputs: model, clip, positive (CONDITIONING), prompt (STRING), and count (INT) - everything but count is a list. There's a real gotcha buried here: wire in a MODEL and CLIP or the LoRA/conditioning magic does nothing. Without them you still get the prompt and count outputs, but the per-combo positive conditioning comes back empty. If all you want is the text, that's fine; if you want images, feed it a base model and clip first.

Install

No Python dependencies beyond what ComfyUI already ships, and no model downloads - the pack is pure Python plus a bundled web UI. Install via ComfyUI Manager (search "Dynamic Tag Loader") or:

cd ComfyUI/custom_nodes/
git clone https://github.com/NineKey1028/ComfyUI_Dynamic_TagLoader.git

Then restart ComfyUI. Your tag files go in ComfyUI/custom_nodes/ComfyUI_Dynamic_TagLoader/tags/ - a starter folder is created on first load.

Where it breaks

The loader is a batch prompt engine; it doesn't sample. Feed its list outputs into 🔄 Dynamic Tag Iterator, which picks one combo per queue run or passes the whole batch through. Common frustration points: a group with no readable .txt files quietly contributes nothing (watch count - it tells you how many combos you actually got), and .txt is the only extension the indexer reads. It's also a small, single-maintainer pack - no big community behind it, so treat it as a tool you verify rather than an ecosystem standard.

CategoryCustom/TagLoader

Inputs (4)

NameTypeDefaultDescription
text_inputSTRING
tag_settingsSTRING{}
modeloptMODEL
clipoptCLIP

Outputs (5)

NameTypeDescription
modelMODEL
clipCLIP
positiveCONDITIONING
promptSTRING
countINT