PlaceholderText:
PlaceholderText builds a piece of text from a reusable template. It looks for two marker strings in the template and substitutes the text you provide for each one. This lets you keep the wording and layout of a prompt consistent while changing selected parts, such as a subject or setting. The substitution is literal: the node does not interpret the text as instructions or apply special formatting.
PlaceholderText Input Parameters:
text1
The text inserted wherever $1 appears in the template. You can enter multiple lines. Every occurrence of $1 is replaced, so the same text can appear in several places. This is a required STRING input; the source specifies no default, minimum, maximum, or list of options.
text2
The text inserted wherever $2 appears in the template. You can enter multiple lines, and every occurrence of $2 is replaced. This is a required STRING input; the source specifies no default, minimum, maximum, or list of options.
placeholder
The template that determines the final wording and where substitutions appear. Write $1 where you want text1 and $2 where you want text2; text without those markers remains in place. Its default is $1,$2, which places a comma between the two substituted texts. This is a required STRING input with no specified minimum, maximum, or list of options.
PlaceholderText Output Parameters:
text
The resulting STRING after substitutions have been applied to placeholder. The node replaces $1 first, then $2, and returns the resulting text for use by another node. If the template contains neither marker, the output is the unchanged template.
PlaceholderText Usage Tips:
- To build a consistent prompt, set
placeholderto something likeA $1 in a $2. Withtext1set toportraitandtext2set togarden, the output isA portrait in a garden. - Add spaces and punctuation directly in
placeholder. The default$1,$2produces no space after the comma unless you add one. - Repeat a marker when you need the same text more than once. For example,
$1 with colors inspired by $1insertstext1in both places. - If you need the literal characters
$1or$2to survive in the output, this node does not provide an escape option. Those markers will be replaced. - Be aware of replacement order: if
text1itself contains$2, that marker will be replaced withtext2during the second pass.
PlaceholderText Common Errors and Solutions:
$1 or $2 appears in the output
- Explanation: The node replaces only those exact, case-sensitive marker strings. A similar-looking marker, such as
$ 1or$3, is not replaced. - Solution: Check the template and use exactly
$1or$2where substitution is intended.
The output contains only the template text
- Explanation: If
placeholdercontains neither marker, there is nothing for the node to substitute. - Solution: Add
$1or$2at the positions where you want the supplied text to appear.
The output has unexpected spacing or punctuation
- Explanation: The node does not add separators or tidy whitespace. It preserves the template’s surrounding characters, including the default comma without a following space.
- Solution: Put the desired spaces, punctuation, and line breaks in
placeholderor in the supplied text.
Text inserted through text1 changes again unexpectedly
- Explanation: Substitutions happen in order. After
text1replaces$1, any$2within that inserted text is also replaced. - Solution: Remove
$2fromtext1if you do not want that second substitution, or arrange the template so the marker occurs only where intended.
A string-type error occurs during replacement
- Explanation: The implementation uses string replacement, which requires the substituted values to be strings. The interface declares all three inputs as STRING, but a value that bypasses that expectation could cause an error; the source does not define a custom error message.
- Solution: Ensure connected nodes provide STRING values for
text1,text2, andplaceholder.
