Nodes/Computational LSNet/Text Join (拼接提示词)
ComfyUI Node

Text Join (拼接提示词)

The Boring Node That Fixes Half Your Prompt Wiring

By let-the-name-be-x1·Created 24 days ago·Updated 24 days ago· 2
Text Join (拼接提示词)
  • part1
  • part2
  • part3
  • part4
  • text
◄separator,►
◄skip_emptytrue►

Yes, it's a string concatenator. No, that isn't a reason to skip it, because the thing it replaces is promptConcat from ComfyUI-Easy-Use, and pulling in a whole suite for one join is a bad trade - every custom node in ComfyUI installs into the same Python environment, with no isolation, so the pack that adds zero dependencies is the one you want on the critical path.

So: four inputs, one separator, one output. Assembled by the same author as the rest of this pack because Artist Tags → Prompt only decorates individual artist names, not the whole string - something has to put masterpiece, best quality in front of it.

What it does

Inputs:

  • separator (, by default) - what goes between the parts.
  • skip_empty (on) - empty pieces vanish instead of producing ,,.
  • part1…part4 - any type. Strings obviously, but also STRING lists, which is the interesting case.

Output: text, a single STRING you can feed CLIPTextEncode, a save-text node, or another join.

Three behaviours worth knowing, because they're what separate it from a naive ",".join():

  1. Lists get flattened. ComfyUI nodes that emit a list of strings - a WD14 tagger's tag list being the obvious one - can be wired straight in, and each element becomes its own part. That's the difference between getting 1girl, solo as two tags and getting a Python list dumped into your prompt.
  2. Repeated separators collapse. If one part already ends in a comma and the next begins with one, you get one comma, not three. Leading and trailing separators get trimmed too. Since prompt fragments usually arrive pre-punctuated, this is the whole reason the node exists rather than a generic join.
  3. Non-strings are stringified. It'll happily str() a number or something odd. Convenient, occasionally surprising.

Where it fits

The classic anime-base captioning pipeline: a WD14 tagger for the booru tags it knows, a describer (Florence-2 or JoyCaption) for the scene context it can't express, then concatenate. Two inputs, one separator - that's this node.

The other use, and the one this pack ships for, is the genetic-algorithm workflow's prompt assembly: prefix + generated artist string + fixed scene description, per individual, per generation. The artist string changes; the scaffolding around it doesn't.

The one gotcha

Keep the separator to a single simple character. The join is the obvious part, but the cleanup does a character-wise strip of the separator from both ends of the result - so a clever multi-character separator gets you tidying you didn't ask for. "," or " " are safe; ", " is asking for trouble.

And the obvious one: there are only four slots, and their order is fixed by position. Need six fragments? Chain two joins, or nest one inside another. Unconnected parts are simply skipped, so leaving part3 and part4 empty costs you nothing.

This node also does no deduplication - if your tagger already emitted 1girl and you add it again by hand, you get it twice. It's a joiner, not a prompt optimiser.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/let-the-name-be-x1/Computational-LSNet.git
# restart ComfyUI; nodes appear under category "Computational LSNet"

The pack ships an intentionally empty requirements.txt and declares dependencies = [] in pyproject.toml - deliberately, so Manager can't pip-install a torch that replaces your CUDA build. Every custom node shares the same Python environment, so a pack that installs nothing is a feature.

Manager users: search Computational LSNet, or comfy node install computational-lsnet once it's in the Registry.

This node needs no model, no image, and no upstream plugin - install it standalone and use it in a graph that has nothing to do with LSNet. That's the honest pitch: if you came for the artist classifier, this is a utility you'll keep; if you came for a string joiner, ignore the other six nodes entirely (they'll just complain that LSNET_MODEL isn't connected if you drag one in).

Troubleshooting

Stray commas at the start of your prompt. Turn on skip_empty, and check the front of your first part - a part of ", 1girl" is text, not a separator, so the leading comma stays.

Two tags jammed together with no separator. The separator widget was cleared. An empty separator is legal, but it means literal concatenation and no cleanup at all.

Your tag list arrived as one long blob. The upstream node handed over a single string containing commas rather than a STRING list, so there's nothing to split. Joining can't fix a node that never split.

Missing after install. The directory name contains a hyphen (Computational-LSNet), which some assume breaks package loading. It doesn't - the pack falls back to loading vmath.py by file path. Just restart ComfyUI fully; refreshing the browser tab won't pick up new node classes.

CategoryComputational LSNet

Inputs (6)

NameTypeDefaultDescription
separatorSTRING,—
skip_emptyBOOLEANtrue—
part1opt*—
part2opt*—
part3opt*—
part4opt*—

Outputs (1)

NameTypeDescription
textSTRING—