ComfyUI > Nodes > DJZ-Nodes > String Weights

ComfyUI Node: String Weights

Class Name

StringWeights

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

String Weights Description

Enhance text processing by applying specified weights for nuanced control in AI art and text-based models.

String Weights:

The StringWeights node is designed to enhance text processing by applying a specified weight to a given string. This node is particularly useful in scenarios where you need to emphasize or de-emphasize certain parts of a text, such as in AI art generation or text-based models where weighted inputs can influence the output. By formatting the text with a weight, it allows for more nuanced control over how the text is interpreted or processed in subsequent operations. The node's primary function is to take a string and a numerical weight, and then output a formatted string that encapsulates the original text with its associated weight, making it a versatile tool for artists and developers looking to fine-tune text inputs in their creative workflows.

String Weights Input Parameters:

text

The text parameter is a string input that allows you to provide the text you wish to apply a weight to. This parameter supports multiline text, making it flexible for various text lengths and formats. The text you input here will be the basis for the weighted string output, and its content will directly affect the resulting formatted string.

weight

The weight parameter is a floating-point number that specifies the weight to be applied to the text. This parameter has a default value of 1.0, with a minimum value of 0.0 and a maximum value of 10.0. The weight determines the emphasis or importance of the text in the formatted output. A higher weight increases the emphasis, while a lower weight reduces it. The weight is formatted to one decimal place in the output, allowing for precise control over the text's influence.

String Weights Output Parameters:

STRING

The output parameter is a formatted string that combines the original text with its specified weight. The output is structured as "(text:weight)", where text is the input string and weight is the numerical value formatted to one decimal place. This output is crucial for applications that require weighted text inputs, as it provides a clear and standardized way to represent the text's importance or influence in further processing or analysis.

String Weights Usage Tips:

  • Use the weight parameter to adjust the emphasis of specific text segments, which can be particularly useful in AI models that interpret text inputs differently based on their weights.
  • Experiment with different weight values to see how they affect the output in your specific application, especially if you're using this node in a creative or generative context.

String Weights Common Errors and Solutions:

Invalid weight value

  • Explanation: The weight value provided is outside the allowed range of 0.0 to 10.0.
  • Solution: Ensure that the weight value is within the specified range. Adjust the value to be between 0.0 and 10.0.

Empty text input

  • Explanation: The text input is empty, which may lead to unexpected results or errors in the output.
  • Solution: Provide a valid string in the text input to ensure the node functions correctly. If no text is needed, consider using a placeholder or default text.

String Weights 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.