Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-Text > PlaceholderText

ComfyUI Node: PlaceholderText

Class Name

PlaceholderText

Category
MK/text
Author
markoca1 (Account age: 2507days)
Extension
ComfyUI-Text
Latest Updated
2024-12-16
Github Stars
0.01K

How to Install ComfyUI-Text

Install this extension via the ComfyUI Manager by searching for ComfyUI-Text
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Text in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

PlaceholderText Description

Replaces $1 and $2 in a reusable text template with supplied strings to create consistent prompts.

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 placeholder to something like A $1 in a $2. With text1 set to portrait and text2 set to garden, the output is A portrait in a garden.
  • Add spaces and punctuation directly in placeholder. The default $1,$2 produces 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 $1 inserts text1 in both places.
  • If you need the literal characters $1 or $2 to survive in the output, this node does not provide an escape option. Those markers will be replaced.
  • Be aware of replacement order: if text1 itself contains $2, that marker will be replaced with text2 during 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 $ 1 or $3, is not replaced.
  • Solution: Check the template and use exactly $1 or $2 where substitution is intended.

The output contains only the template text

  • Explanation: If placeholder contains neither marker, there is nothing for the node to substitute.
  • Solution: Add $1 or $2 at 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 placeholder or in the supplied text.

Text inserted through text1 changes again unexpectedly

  • Explanation: Substitutions happen in order. After text1 replaces $1, any $2 within that inserted text is also replaced.
  • Solution: Remove $2 from text1 if 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, and placeholder.

PlaceholderText Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Text
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

PlaceholderText