Artist Tags → Prompt (画师串→提示词)
From Classifier Output to a Prompt String You Can Actually Paste
- prompt
- report
The classifier hands you names like poki_(j0ch3fvj6nd), bbul_horn and huhi \(huhi 1211\) - as a comma-joined string, or as a JSON blob of name → confidence. Neither is a prompt. Class names carry underscores and parentheses (which will break (name:weight) syntax the moment you touch them), and confidence is not a weight.
This node is the adapter. Feed it the classifier's json_output or a bare tag string, get back a string you can wire straight into CLIPTextEncode, plus a report telling you exactly what it did to each name.
Artist tags are the strongest single lever on the Illustrious / NoobAI / Anima line - which is exactly why they're worth automating.
The inputs that matter
Four required widgets, then a pile of optional ones:
- weight_mode - the strategy, and the single most consequential setting.
rank(default) assigns weights by position, linearly frommax_weightdown tomin_weight:(a:0.80),(b:0.65),(c:0.50),(d:0.35),(e:0.20). It ignores saturation, which is why it's the default.equalwrites all names at weight 1.0 with no parentheses - a plain list, for when you just want candidates and the model to sort it out.relmin-max normalizes the selected confidences into your range andprobscalesp/pmax- both for when the confidence spread is real.as_givenpasses through weights you wrote yourself, falling back torankwhen there are none. - top_n (5, max 60), max_weight (0.8), min_weight (0.2) - how many names, and the weight band they're mapped into.
- json_output / tag_string - connect the classifier's
json_output, or paste your own string. Duplicate names merge (highest confidence, highest weight) rather than doubling up. - name_style -
spaces(default) rewritesbbul_horn→bbul horn, matching how most SDXL-lineage models were prompted;as_isleaves the class names verbatim. - escape_parens (on by default) - escapes
( ) [ ]inside names so they can't terminate your weight syntax, and strips characters that would break(name:weight)- commas, colons, pipes, semicolons. - decimals (2) -
0.80vs0.8. - name_prefix / name_suffix - inserted into each artist name, inside the parentheses;
@gives(@bbul horn:0.80). Per-name only - whole-string prefixes likemasterpiece, best qualityare Text Join's job.
Outputs: prompt (the string for CLIPTextEncode.text) and report (JSON with the mode actually used, the count, the prefix/suffix, the weight list, the final prompt, and per-tag name / cleaned / weight / prob). When a name comes out mangled, the report shows the before and after.
Be honest about what the weights are
Here's the part I'd underline: those weights are a ranking aid, not a style strength. The confidence values come from the LSNet feature space; prompt weight acts in CLIP's text-embedding space. There is no analytic mapping between them, and the author says so directly in the README - the node gives you usable ordering, not real intensity.
Two practical consequences. First: the 0.8→0.2 defaults sit under the 0.5–1.5 band most CLIP-era prompting uses, so if artist names barely register, max_weight is the knob. Second, and this one people miss - on LLM-encoded models like Anima, (artist:1.2) weight syntax is not honoured at all; it's passed through as literal punctuation. On those bases use equal mode and let word order do the work.
For a real 70/30 blend, reach for Vector Math (mix(V0, V1, 0.3)), classify the result with LSNet Features → Artist Tags, and let this node format it. Mixing vectors is a genuine blend; mixing prompt weights is a negotiation.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/let-the-name-be-x1/Computational-LSNet.git
# restart ComfyUI; the pack is under category "Computational LSNet"
No dependencies to install: empty requirements.txt, dependencies = [] in pyproject.toml, on purpose - Manager must not pip-install a torch that overwrites your CUDA build. In Manager, search Computational LSNet (comfy node install computational-lsnet once it's in the Registry).
Nothing in this node needs a model file - it's string munging. The pieces around it do: spawner1145/comfyui-kaloscope on the legacy branch (Manager's lsnet 1.0.8) plus models/lsnet/kaloscope2.0/ with best_checkpoint.pth (≈2.94 GB), class_mapping.csv and config.json. Stay on 2.0 - Kaloscope 3.0 changed the model handle type and the head geometry, and this pack isn't ported to it.
Troubleshooting
"No usable input" error. Both json_output and tag_string were empty - usually because the classifier's json_output is wired to nothing and the pasted string is blank.
Weights all look flat. You're in equal mode, or rel/prob got names whose confidences were nearly identical - very common on saturated classifier output. rank is immune to that, which is why it's the default.
The model isn't reacting to the artists at all. Artist tags are the superpower on the Illustrious/NoobAI/Anima line, but coverage is uneven: popular Danbooru artists work, thin ones barely register, and nobody documented any of it - which is why the style explorers exist. Run the names through one before spending an evening tuning weights.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| weight_mode | COMBO | rank | 5 options: rank, equal, rel, prob, as_given |
| top_n | INT | 51–60 | — |
| max_weight | FLOAT | 0.800–2 | — |
| min_weight | FLOAT | 0.200–2 | — |
| json_outputopt | STRING | — | |
| tag_stringopt | STRING | — | |
| name_styleopt | COMBO | spaces | spaces: 下划线转空格(bbul_horn → bbul horn,多数 SDXL 底模习惯) |
| escape_parensopt | BOOLEAN | true | 把名字里的 ( ) [ ] 转义成 \( \) \[ \],避免破坏 (name:weight) 语法 |
| decimalsopt | INT | 20–4 | 权重小数位,如 2 → 0.80 |
| name_prefixopt | STRING | 加在【每个画师名前】(在权重括号内)。如填 @ → (@bbul horn:0.8),(@rin31153336:0.4) | |
| name_suffixopt | STRING | 加在【每个画师名后】(在权重括号内)。如填 style → (bbul horn style:0.8) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| report | STRING | — |