ComfyUI Node Runs on cloud

Join

Flatten each item of a sequence-of-tuples into a string

By ali1234·Created 3 years ago·Updated 3 months ago· 130
Join
  • sequence
  • sequence
join_str,

The name is a little misleading if you're expecting "combine the whole sequence into one string" - that's not what this does. Join operates on each element of your sequence individually, flattening it from a tuple into a string. It's built to pair with Combinations (or Permutations): run Combinations on a list of styles and you get back a sequence of tuples like ("moody", "cinematic"); Join turns each of those into a single readable string like "moody, cinematic".

How it works

For every item x in your input sequence, it runs join_str.join(x). That means each item has to already be an iterable of strings - a tuple or list, the kind of thing Combinations produces - not a bare string or number. The output is a new sequence, same length as the input, where every item has been collapsed from a group into one joined string.

The inputs and outputs that matter

  • sequence (SEQUENCE) - a sequence of groups (tuples or lists of strings), not a flat sequence of plain values.
  • join_str (STRING, default , ) - the separator dropped between elements within each group.

Output is a single sequence - a sequence of strings, ready to feed into MakeJob as prompt fragments, filename pieces, or anything else that wants a flat string per step.

How to install it

Via ComfyUI Manager: search comfyui-job-iterator, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ali1234/comfyui-job-iterator

then restart. No dependencies.

Common issues & troubleshooting

"sequence item 0: expected str instance, int found" (or similar). This means the elements inside each group aren't all strings - str.join() only works on strings. If your Combinations input came from a sequence of numbers rather than text, convert them to strings before combining, or don't route numeric sweeps through Join at all.

Feeding it a flat sequence instead of a sequence-of-groups. If you skip Combinations/Permutations and try to run a plain Range or Literal sequence through Join directly, it'll try to .join() each individual number or string as if it were itself a group of characters - which either errors (on numbers, since you can't iterate them) or silently does something you didn't intend (a string does iterate character-by-character in Python, so Join(["cat"], ", ") gives you ["c, a, t"], not ["cat"]). This node expects grouped input; if you don't have groups yet, you don't need Join.

Result looks right but downstream MakeJob complains. Remember the output is still a SEQUENCE of individual strings - feed it into MakeJob with a name the same way you would any other sequence, and each joined string becomes one step's value for that attribute.

Categoryali1234/sequence

Inputs (2)

NameTypeDefaultDescription
sequenceSEQUENCE
join_strSTRING,

Outputs (1)

NameTypeDescription
sequenceSEQUENCE