ComfyUI > Nodes > ComfyUI-outputlists-combiner > Formatted String

ComfyUI Node: Formatted String

Class Name

FormattedString

Category
Utility
Author
geroldmeisinger (Account age: 1214days)
Extension
ComfyUI-outputlists-combiner
Latest Updated
2025-12-23
Github Stars
0.06K

How to Install ComfyUI-outputlists-combiner

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

Formatted String Description

The `FormattedString` node creates dynamic strings by replacing placeholders with specified values, supporting advanced formatting and data insertion for AI art projects.

Formatted String:

The FormattedString node is a versatile utility designed to create dynamic strings by replacing placeholders with specified values. It leverages Python's str.format() method, allowing you to format strings with precision and flexibility. This node is particularly useful for generating filenames, labels, or any text that requires variable content. It supports advanced formatting options, such as rounding numbers or padding with zeros, and can handle special characters by doubling curly braces. Additionally, it incorporates a "search & replace" feature using a JavaScript context, enabling you to insert dynamic data like timestamps or other node outputs before execution. This makes the FormattedString node a powerful tool for both string manipulation and data retrieval in your AI art projects.

Formatted String Input Parameters:

fstring

The fstring parameter is the template string containing placeholders that will be replaced with actual values. It supports multiline input and defaults to the format {a}_{b}_{c}_{d}. This parameter is crucial as it defines the structure of the output string, allowing you to specify where and how each input value should appear. The placeholders within the string should match the names of the input parameters to ensure correct substitution.

a

The a parameter is an optional input that provides a value to replace the {a} placeholder in the fstring. It can be of any type, and if not specified, it defaults to an empty string. This parameter allows you to dynamically insert content into your formatted string, making it adaptable to various contexts.

b

The b parameter is an optional input that provides a value to replace the {b} placeholder in the fstring. Like a, it can be of any type and defaults to an empty string if not provided. This flexibility enables you to customize the output string based on different input scenarios.

c

The c parameter is an optional input that provides a value to replace the {c} placeholder in the fstring. It accepts any type of input and defaults to an empty string if not specified. This parameter further enhances the node's ability to generate tailored strings by incorporating diverse data inputs.

d

The d parameter is an optional input that provides a value to replace the {d} placeholder in the fstring. It can be of any type and defaults to an empty string if not provided. This parameter completes the set of inputs that can be used to populate the placeholders in the formatted string, offering comprehensive customization options.

Formatted String Output Parameters:

string

The string output parameter is the final formatted string with all placeholders replaced by their respective values. This output is a single string that reflects the template defined in the fstring parameter, populated with the data provided through the input parameters. It is the primary result of the node's execution, delivering a customized string ready for use in your projects.

Formatted String Usage Tips:

  • Use specific formatting codes like {a:.2f} to control the appearance of numbers, such as rounding floats to two decimal places.
  • To include special characters like curly braces in your string, double them as in {{ }} to prevent them from being interpreted as placeholders.
  • Leverage the "search & replace" feature to dynamically insert data like timestamps or other node outputs, enhancing the node's utility in generating context-aware strings.

Formatted String Common Errors and Solutions:

KeyError: 'a'

  • Explanation: This error occurs when the fstring contains a placeholder {a} but no corresponding input value is provided.
  • Solution: Ensure that you provide a value for the a parameter or remove the {a} placeholder from the fstring.

ValueError: unexpected '{' in field name

  • Explanation: This error is raised when the fstring contains unmatched curly braces, which are interpreted as placeholders.
  • Solution: Double any curly braces you want to include as literal characters in the string, like {{or}}.

TypeError: not all arguments converted during string formatting

  • Explanation: This error can occur if the placeholders in the fstring do not match the input parameter names.
  • Solution: Verify that all placeholders in the fstring correspond to the provided input parameters.

Formatted String Related Nodes

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