EasyUse/Promptgenerated

PromptReplace(promptReplace)

PromptReplace is a string utility node in the EasyUse/Prompt category.

prompt Replace

output_prompt
prompt
STRING
find1
STRING
replace1
STRING
find2
STRING
replace2
STRING
find3
STRING
replace3
STRING
Easy Use

PromptReplace is a string utility node in the EasyUse/Prompt category. It takes a base prompt and up to three find/replace pairs, applies those replacements to the prompt text, and outputs the resulting string.

Inputs

  • prompt (STRING, required): The original prompt text to be modified.
  • find1 (STRING, optional, default ""): The text to search for in the first replacement step.
  • replace1 (STRING, optional, default ""): The text that replaces every occurrence of find1.
  • find2 (STRING, optional, default ""): The text to search for in the second replacement step.
  • replace2 (STRING, optional, default ""): The text that replaces every occurrence of find2.
  • find3 (STRING, optional, default ""): The text to search for in the third replacement step.
  • replace3 (STRING, optional, default ""): The text that replaces every occurrence of find3.

The find and replace inputs are optional and default to empty strings. Leave a find/replace pair blank to skip that replacement step.

Outputs

  • STRING: The resulting prompt after all specified replacements have been applied.

Usage Notes

  • The replacements are applied in order: find1/replace1 first, then find2/replace2 on the result of the first replacement, then find3/replace3 on the result of the second replacement.
  • Because replacements are sequential, later find patterns search the already-modified prompt. If you intend to match the original prompt text in a later pair, account for the changes made by earlier replacements.
  • This node works purely on the prompt string; it does not modify conditioning, embeddings, or other node data directly.

Comments

Sign in with GitHub to join the discussion.

Loading comments…