ComfyUI > Nodes > D2 Nodes ComfyUI > D2 Prompt

ComfyUI Node: D2 Prompt

Class Name

D2 Prompt

Category
D2
Author
da2el-ai (Account age: 713days)
Extension
D2 Nodes ComfyUI
Latest Updated
2025-05-04
Github Stars
0.03K

How to Install D2 Nodes ComfyUI

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

D2 Prompt Description

Enhances text input with token counting and comment removal for AI artists to manage and format prompts efficiently.

D2 Prompt:

The D2 Prompt node is designed to enhance your text input experience by integrating token counting and comment removal functionalities. This node is particularly useful for AI artists who need to manage and format text prompts efficiently. By automatically calculating the number of tokens in a given text and removing comments based on specified types, it streamlines the process of preparing text for further processing or analysis. This functionality is crucial for ensuring that your text inputs are clean and optimized, which can be particularly beneficial when working with models that have token limits or when you need to maintain a specific format for your text data.

D2 Prompt Input Parameters:

prompt

The prompt parameter is a multiline string input where you can enter the text that you want to process. This text can include comments that you may want to remove, and the node will handle the token counting for you. The input should be a well-structured text, as the node will parse it to perform its functions effectively.

comment_type

The comment_type parameter specifies the type of comments you want to remove from the text. This allows you to customize the comment removal process based on your specific needs. The parameter helps in cleaning up the text by eliminating unnecessary parts, which can be crucial for maintaining the clarity and focus of your prompts.

D2 Prompt Output Parameters:

STRING

The output of the D2 Prompt node is a cleaned and processed string. This string is the result of the initial text input after comments have been removed and tokens have been counted. The output is crucial for ensuring that the text is ready for subsequent processing steps, such as feeding into a model or further text manipulation tasks.

D2 Prompt Usage Tips:

  • Use the comment_type parameter to specify which comments should be removed, ensuring that your text is as clean and concise as possible before further processing.
  • Regularly check the token count to ensure that your text input does not exceed any model-specific token limits, which can prevent errors during model execution.

D2 Prompt Common Errors and Solutions:

Error in token counter API

  • Explanation: This error occurs when there is an issue with the token counting process, possibly due to an invalid input or a malfunction in the API.
  • Solution: Ensure that your input text is correctly formatted and does not contain any unexpected characters or structures. If the problem persists, check the API's status or consult the documentation for any known issues.

Invalid comment type

  • Explanation: This error arises when the specified comment_type is not recognized by the node, leading to a failure in the comment removal process.
  • Solution: Verify that the comment_type you have entered is supported by the node. Refer to the documentation for a list of valid comment types and adjust your input accordingly.

D2 Prompt Related Nodes

Go back to the extension to check out more related nodes.
D2 Nodes ComfyUI
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.