2025-07-21 09:06:35 +05:00
2025-07-21 19:55:10 +05:00
2025-07-21 06:47:11 +05:00
2025-07-21 00:52:58 +05:00
2025-07-21 00:54:17 +05:00
2025-07-21 06:47:11 +05:00
2025-07-21 07:55:15 +05:00
2025-07-21 01:42:36 +05:00
2025-07-21 09:36:20 +05:00
2025-07-21 19:55:10 +05:00
2025-07-21 09:28:13 +05:00

"Do one thing and do it well." — Peter H. Salus / Doug McIlroy, core Unix principle

"Simple is better than complex." — Zen of Python

String Constructor (Text-Formatting) nodes

There's already a plenty of string-formatting nodes for ComfyUI. But this node pack takes a different approach:

  • First, you prepare a dictionary of named sub-strings (chunks of text with assigned keyword/tag to reference them with).
  • Then, right before CLIP Text Encode, you construct a final prompt fom this dictionary of available parts, connected as a single input. The compilation itself is done using python's string formatting syntax... Don't panic! You don't need to be a programmer - just look below for a quick introduction.
  • Unlike many other (giant uber-mega) node packs, this one strictly adheres to the modular philosophy: it's minimal and self-sufficient.

🔄 Updates ChangeLog

image

Syntax

For those who are unfamiliar with python's string formatting, the rules are very simple:

  • You need to name (set tags/keys for) your sub-strings the same way python variables are named: only ASCII letters, digits and underscore are allowed + the name can't start with a digit. So:
    • ✅ valid_name, other_valid_name, YetAnother_ValidName, name3.
    • ❌ wrong name with spaces, wrong-name.with:punctuation, 3name.
  • Then, you simply put your {substring_name} inside curly braces (no spaces between) in the formatting template - and voila! This pattern will be replaced with the actual sub-string.

Note

For advanced users: Internally, a built-in str.format() is called with keyword arguments from str_dict, which is literally just a dict... though, an immutable one. So any formatting patterns are available (like {float_value:.3f}) + Add ANY to Format-Dict node is there for exactly that.

S
Description
No description provided
Readme
2 MiB
Languages
Python 100%