Nodes/String Utils/Text Formatter (10 Arguments)
ComfyUI Node

Text Formatter (10 Arguments)

A mini template engine for serious prompts

By exectails·Created 2 years ago·Updated 7 months ago· 3
Text Formatter (10 Arguments)
    • text
    format
    arg0
    arg1
    arg2
    arg3
    arg4
    arg5
    arg6
    arg7
    arg8
    arg9

    When five slots isn't enough, this is the pack going to eleven. Text Formatter (10 Arguments) is the biggest node in the formatter family, and it exists for the workflows where a prompt isn't a sentence you tweak - it's a full template you assemble from a dozen independent variables. Character, expression, pose, location, time of day, camera, lens, film stock, lighting, mood... now you're in ten-slot territory, and this node lets you build that prompt as one fixed format string with ten named inputs feeding in.

    What it does

    Identical mechanism to the 2- and 5-argument siblings in this pack - Python's str.format() with named placeholders. Here that means {arg0} through {arg9}. The format field is your template; ten arg inputs supply the values; one string comes out.

    The value proposition is composition at scale. Keep the template in one place, wire the slots from whatever produces them - an ITOA for a seed, an FTOA for a parameter, Split Text for a tag, other formatters for nested chunks - and you can regenerate a family of prompts by changing one slot instead of editing prose. Combined with wildcard-style dynamic prompts (the author's companion et_dynamicprompts pack is linked from the README), it starts behaving like a real template engine rather than a glorified printf.

    How it works

    format.format(arg0=..., arg1=..., ... arg9=...) - called with all ten keyword arguments. Same rules as the smaller siblings, just more of them:

    • Named placeholders only. {arg0} through {arg9}. Positional {} crashes.
    • No slot beyond 9. Reference {arg10} and you get a KeyError; the node only knows ten names.
    • Unused slots are ignored. A template using three of ten works fine.
    • Literal braces must be doubled ({{, }}).

    Inputs:

    • format - the template. Multiline, typeable.
    • arg0arg9 - STRING inputs, all forceInput. Every single one is a wire-in socket; there are no text boxes. If you want a static value in a slot, feed it from a Primitive.

    Output: text, a single STRING.

    How to install it

    From exectails/comfyui-et_stringutils ("String Utils"). ComfyUI Manager → search "String Utils", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/exectails/comfyui-et_stringutils
    

    Restart, and it's under exectails/Strings. No dependencies, no models - pure Python stdlib, the safest kind of install in this ecosystem.

    Common issues

    Two things, and they're the same two as the 5-arg version, just bigger:

    • KeyError: 'arg10' - your template outran the node. Ten is the ceiling; consolidate slots or accept the limit.
    • Wire spaghetti. Ten forced inputs is ten sockets, and a busy graph turns into a tangle. The 10-arg node is genuinely useful when you have ten independent variables - but if you only need five, use the 5-arg sibling. Fewer wires is a feature, not a shortcoming.

    And the evergreen one: it's a string formatter. Numbers need to arrive as text (via ITOA/FTOA), because str.format gets a string and has no idea you wanted it padded or rounded. Feed it clean strings and this node quietly becomes the backbone of the whole workflow's prompt stage.

    Categoryexectails/Strings

    Inputs (11)

    NameTypeDefaultDescription
    formatSTRING
    arg0optSTRING
    arg1optSTRING
    arg2optSTRING
    arg3optSTRING
    arg4optSTRING
    arg5optSTRING
    arg6optSTRING
    arg7optSTRING
    arg8optSTRING
    arg9optSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING