ComfyUI > Nodes > DJZ-Nodes > Prompt Inject V2

ComfyUI Node: Prompt Inject V2

Class Name

PromptInjectV2

Category
Custom-Nodes
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes 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

Prompt Inject V2 Description

Enhance text prompts by injecting phrases strategically for dynamic text manipulation and creativity.

Prompt Inject V2:

PromptInjectV2 is a versatile node designed to enhance text prompts by strategically injecting additional phrases into existing text. This node is particularly useful for AI artists who want to modify or enrich textual descriptions, such as those used in creative writing or AI-generated art prompts. The primary function of PromptInjectV2 is to insert a specified injection phrase either before or after a target phrase within a given text. This capability allows for dynamic text manipulation, enabling users to subtly alter the narrative or emphasis of a text without rewriting it entirely. By providing a flexible and user-friendly interface, PromptInjectV2 empowers users to experiment with text modifications, enhancing creativity and expression in their projects.

Prompt Inject V2 Input Parameters:

text

The text parameter is the main body of text where the injection will occur. It is a multiline string, allowing for complex and lengthy text inputs. This parameter serves as the canvas for the injection process, and its content will be modified based on the target and injection parameters. There are no specific minimum or maximum values, but the text should be meaningful and relevant to the intended modification.

target

The target parameter specifies the exact phrase within the text where the injection will be applied. It is a single-line string with a default value of "the scene is captured." This parameter is crucial as it determines the location within the text where the injection will occur. The target phrase should be chosen carefully to ensure the injection enhances the text as intended.

injection

The injection parameter is the phrase that will be inserted into the text. It is a single-line string with a default value of "Screeching tires." This parameter allows users to introduce new elements or emphasis into the text, providing a means to alter the narrative or tone. The injection should be crafted to seamlessly integrate with the surrounding text for optimal results.

inject_after

The inject_after parameter is a boolean that determines whether the injection should occur after the target phrase. By default, it is set to False, meaning the injection will occur before the target. This parameter offers flexibility in how the text is modified, allowing users to control the flow and emphasis of the text. Setting this to True will place the injection after the target, which can be useful for creating a more natural or impactful modification.

Prompt Inject V2 Output Parameters:

STRING

The output of the PromptInjectV2 node is a modified version of the input text, returned as a single string. This output reflects the changes made by the injection process, with the specified injection phrase inserted at the designated location relative to the target phrase. The modified text can be used for further processing or as a final output, providing users with a dynamically altered version of their original text.

Prompt Inject V2 Usage Tips:

  • Experiment with different injection phrases to see how they alter the tone and narrative of your text. This can help you find the perfect balance for your creative projects.
  • Use the inject_after parameter to control the placement of the injection. Placing the injection after the target can create a more natural flow in some contexts, enhancing the readability and impact of the text.
  • Test different target phrases to ensure the injection occurs at the most effective point in your text. This can help you achieve the desired emphasis or narrative shift.

Prompt Inject V2 Common Errors and Solutions:

Target phrase not found

  • Explanation: This error occurs when the specified target phrase is not present in the input text, preventing the injection from taking place.
  • Solution: Double-check the target parameter to ensure it matches a phrase in the text exactly. Consider using variations or synonyms if the target phrase is not found.

Injection phrase is empty

  • Explanation: An empty injection phrase will result in no changes to the text, as there is nothing to insert.
  • Solution: Ensure the injection parameter contains a meaningful phrase that you want to add to the text. Avoid leaving this parameter empty unless intentionally testing the node's behavior.

Prompt Inject V2 Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.