ComfyUI > Nodes > WAS Node Suite > Text Add Tokens

ComfyUI Node: Text Add Tokens

Class Name

Text Add Tokens

Category
WAS Suite/Text/Tokens
Author
WASasquatch (Account age: 4688days)
Extension
WAS Node Suite
Latest Updated
2024-08-25
Github Stars
1.07K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Add Tokens Description

Define and add custom tokens to text data for dynamic text generation and manipulation, enhancing text processing workflows.

Text Add Tokens:

The Text Add Tokens node is designed to allow you to define and add custom tokens to your text data, which can be particularly useful for dynamic text generation and manipulation. This node enables you to specify tokens and their corresponding values, which can then be used to replace placeholders in your text with the defined values. This functionality is beneficial for creating more flexible and reusable text templates, enhancing the efficiency of your text processing workflows. Additionally, the node provides an option to print the current set of custom tokens, allowing you to verify and debug the tokens you have added.

Text Add Tokens Input Parameters:

tokens

This parameter allows you to input a string containing the tokens and their corresponding values. Each token-value pair should be separated by a colon (:) and each pair should be on a new line. For example, [hello]: world. This input supports multiline text, making it easy to add multiple tokens at once. The default value is [hello]: world.

This parameter is a boolean option that determines whether the current set of custom tokens should be printed to the console. It accepts two values: false and true. When set to true, the node will output the current custom tokens, which can be useful for debugging and verification purposes. The default value is false.

Text Add Tokens Output Parameters:

This node does not produce any direct output parameters. Instead, it modifies the internal state by adding the specified tokens, which can then be used by other nodes or processes within your workflow.

Text Add Tokens Usage Tips:

  • Use the tokens parameter to define multiple tokens at once by separating each token-value pair with a newline. This can save time and make your token definitions more organized.
  • Set print_current_tokens to true if you need to verify the tokens you have added. This can help you ensure that the tokens are correctly defined and available for use in subsequent text processing steps.
  • Combine this node with other text manipulation nodes to create complex and dynamic text generation workflows.

Text Add Tokens Common Errors and Solutions:

A token_name is required for a token; token name provided is empty.

  • Explanation: This error occurs when the token name is empty or consists only of whitespace.
  • Solution: Ensure that each token name is properly defined and not left blank. Check your input string for any missing token names and correct them.

Invalid token format

  • Explanation: This error occurs when the token-value pairs are not correctly formatted, such as missing a colon (:) separator.
  • Solution: Verify that each token-value pair in your input string is correctly formatted with a colon separating the token and its value. Each pair should be on a new line.

No tokens defined

  • Explanation: This error occurs when the input string does not contain any valid token definitions.
  • Solution: Ensure that your input string contains at least one valid token-value pair. Check for any formatting issues or empty lines that might be causing the problem.

Text Add Tokens Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.