BREAKING CHANGE: Output order changed to put primary outputs first
- formatted_string now always in output position 0 (was dynamic)
- saved_file_path now always in output position 1 (was dynamic)
- Variable pass-through outputs now in positions 2+ (were 0+)
This change ensures primary outputs are in fixed, predictable positions,
resolving ComfyUI output mapping issues when dynamic outputs are present.
Changes:
- Updated format_string() return statement to reverse output order
- Updated update_widget() to set RETURN_TYPES/RETURN_NAMES in new order
- Updated all 47 tests to expect new output positions
- Updated all docstrings and examples in format_string.py
- Added comprehensive "Output Structure" documentation to README.md
- Added same documentation to docs/index.md for consistency
- All tests passing ✅
1.9 KiB
comfydv
A collection of workflow efficiency and quality of life nodes that I've created for personal use out of necessity.
- String Formatting: Use either plain python f-strings or more advanced Jinja2 templating to format outputs.
- Random Choice: Add an abitrary number of inputs and then, with seed control, randomly select one for an output.
String Formatting
The FormatString node provides flexible string formatting with dynamic input/output configuration.
Python F-String
A simple python f-string dynamically creates the necessary inputs/outputs for the detected keys.
Jinja 2
Switching to Jinja2 allows you to use more advanced control blocks and other filters/features of that templating language. See Jinja documentation for further details.
Output Structure
The node's outputs are organized for maximum reliability and flexibility:
formatted_string(Output 0): The formatted result string - always in position 0saved_file_path(Output 1): Path to saved state file (if save_path provided) - always in position 1- Variable outputs (Output 2+): Pass-through values for any variables detected in the template, enabling easy chaining
For example, with template "Hello {name}, you are {age}":
- Output 0: The formatted string (e.g., "Hello Alice, you are 30")
- Output 1: The save file path (or empty string)
- Output 2: The value of
name(e.g., "Alice") - Output 3: The value of
age(e.g., "30")
This structure ensures the primary outputs (formatted_string and saved_file_path) are always in predictable, fixed positions for reliable workflow connections.
Random Choice
Ability to take arbitrary length and type of inputs to then output a choice with a controllable seed.


