ComfyUI Node

Path Builder

Stop building filename prefixes with three text nodes

By swqa7697·Created 5 days ago·Updated about 12 hours ago· 4
Path Builder
    • path
    segment_1
    segment_2
    segment_3
    segment_4
    segment_5
    segment_6
    segment_7
    segment_8
    segment_9
    segment_10
    segment_11
    segment_12
    segment_13
    segment_14
    segment_15
    segment_16

    Path Builder joins a handful of text fields into one /-separated string you can drop straight into a filename_prefix input - the thing on Save Image, Save Video, and the latent-save nodes that decides which subfolder and base name your files get. If you've ever wanted files under projects/sunset/run_3 instead of a flat wall of ComfyUI_00042_.png, this is the node that makes it manageable.

    It's solving a genuinely boring problem that every ComfyUI user runs into eventually: filename_prefix is a small template language (subfolders via /, plus %year%, %width%-style tokens), and the usual way to feed it from multiple values is a chain of String primitives into a Concatenate Text node. Fine once. Annoying the fiftieth time, because every piece lives in its own node and editing any one of them means finding it. Path Builder keeps the pieces as separate fields on a single node and hands you one clean path output to wire. That's the whole value: fewer nodes, fewer links, each part still editable on its own.

    The inputs and outputs that matter

    • segment_1segment_16 - up to sixteen optional text fields, joined in order. Blank fields are skipped, and each field is trimmed of surrounding slashes and spaces, so videos/ and /h3_clip become videos/h3_clip. A leading / on the first field is dropped too - ComfyUI won't accept absolute prefixes anyway.
    • path (output) - the joined string, ready for any filename_prefix socket.

    The node ships every one of those 16 fields, which would be ugly; the pack's frontend script is what saves it. You start with one field and a +/- button row. + reveals the next one (up to 16), - removes the last visible field - and removing a field takes its input socket and any link into it with it, so nothing invisible gets silently concatenated. The visible-field count saves with the workflow, and on load a field that holds text or a link is shown even if it sits past the saved count.

    Wiring it

    Path Builder ─▶ (filename_prefix) Save Image
                 └▶ (path) Preview & Save Image
    

    The output is a plain STRING, so it also feeds the path input on this pack's Preview & Save Image nodes, or anything else that takes a string and wants a path.

    Installing it

    Path Builder is one node in ComfyUI-Arisu-Nodes (swqa7697, GPL-3.0, released September 2026 - new, so judge it by its docs rather than reputation). The pack declares zero runtime dependencies: it only uses APIs ComfyUI already ships, so there's no pip install step and nothing to download.

    ComfyUI Manager: Manager → Install Custom Nodes → search "ComfyUI-Arisu-Nodes", install, restart. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/swqa7697/ComfyUI-Arisu-Nodes.git
    

    Restart ComfyUI and it appears under Add Node → Arisu Nodes.

    Gotchas

    The separator is always /, which is correct on every platform - ComfyUI treats slashes in filename_prefix as subfolder separators regardless of OS. The one thing to remember is that the fields only do their trimming after you've typed them; a blank middle field is skipped rather than producing a double slash, so projects//test can't happen by accident. And since filename_prefix is read at save time, changing a segment and re-running is all it takes to land files in a new folder.

    If you don't need subfolder math at all, don't bother - the default ComfyUI prefix is fine. Reach for this when your output starts looking like a junk drawer.

    CategoryArisu Nodes/Common

    Inputs (16)

    NameTypeDefaultDescription
    segment_1optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_2optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_3optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_4optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_5optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_6optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_7optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_8optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_9optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_10optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_11optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_12optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_13optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_14optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_15optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.
    segment_16optSTRINGOne path piece. Blank pieces are skipped; surrounding slashes and spaces are trimmed.

    Outputs (1)

    NameTypeDescription
    pathSTRINGThe fields joined with '/', blanks skipped.