Nodes/Pond Nodes/🐳Prompt解析
ComfyUI Node

🐳Prompt解析

Split [bracketed] fields into separate wires

By Pondowner857·Created about a year ago·Updated 2 months ago· 45
🐳Prompt解析
    • 输出_1
    • 输出_2
    • 输出_3
    • 输出_4
    • 输出_5
    • 输出_6
    • 输出_7
    • 输出_8
    • 输出_9
    • 输出_10
    • 输出_11
    • 输出_12
    • 输出_13
    • 输出_14
    • 输出_15
    • 输出_16
    • 输出_17
    • 输出_18
    • 输出_19
    • 输出_20
    • 输出_21
    • 输出_22
    • 输出_23
    • 输出_24
    • 输出_25
    • 输出_26
    • 输出_27
    • 输出_28
    • 输出_29
    • 输出_30
    • 输出_31
    • 输出_32
    • 输出_33
    • 输出_34
    • 输出_35
    • 输出_36
    • 输出_37
    • 输出_38
    • 输出_39
    • 输出_40
    • 输出_41
    • 输出_42
    • 输出_43
    • 输出_44
    • 输出_45
    • 输出_46
    • 输出_47
    • 输出_48
    • 输出_49
    • 输出_50
    • 输出_51
    • 输出_52
    • 输出_53
    • 输出_54
    • 输出_55
    • 输出_56
    • 输出_57
    • 输出_58
    • 输出_59
    • 输出_60
    • 输出_61
    • 输出_62
    • 输出_63
    • 输出_64
    • 输出_65
    • 输出_66
    • 输出_67
    • 输出_68
    • 输出_69
    • 输出_70
    • 输出_71
    • 输出_72
    • 输出_73
    • 输出_74
    • 输出_75
    • 输出_76
    • 输出_77
    • 输出_78
    • 输出_79
    • 输出_80
    • 输出_81
    • 输出_82
    • 输出_83
    • 输出_84
    • 输出_85
    • 输出_86
    • 输出_87
    • 输出_88
    • 输出_89
    • 输出_90
    • 输出_91
    • 输出_92
    • 输出_93
    • 输出_94
    • 输出_95
    • 输出_96
    • 输出_97
    • 输出_98
    • 输出_99
    • 输出_100
    ◄textCategory: [clothing] Color: [red] Instruction: [Put a clothing on the model.]►
    ◄output_count3►

    Prompt Parser (🐳Prompt解析) is a tiny text-splitting utility that exists because of a formatting convention: when a structured prompt or template looks like

    Category: [clothing]
    Color: [red]
    Instruction: [Put a clothing on the model.]
    

    you want each [bracketed] chunk on its own wire, not jammed into one string. This node extracts every bracketed piece and gives you each one as a separate STRING output. Its default input text is literally that three-line example - the author ships it self-documenting, which tells you exactly what it's for.

    The mechanism is one regex: it finds everything inside [...] (non-greedy, so nested-looking brackets don't over-consume), strips the surrounding whitespace, and returns them in order. The output_count input (1-100, default 3) controls how many output slots get filled: if you extracted fewer fields than output_count, the leftover outputs come back as empty strings; if more, the extras are dropped. That padding is why the node always gives you a stable number of outputs to wire up even when your input text varies.

    The node declares 100 STRING outputs (输出_1 through 输出_100), but the pack's JavaScript hides the ones you're not using - you only see as many as output_count asks for. So don't be intimidated by the schema; on the canvas it just looks like a node with however many wires you set.

    Where it earns its place

    This pattern - structured bracketed templates - is exactly what this pack's other prompt and selector nodes produce. Pose Selector, Clothing Selector, and the Wan2.2/Qwen prompt templates in the pack all work by building structured prompt text with fields you'd want to separate before they hit different parts of your graph (an instruction field into one conditioning, a category field into another, a color field into a color-using node). Text Format Parser is the adapter that unpacks them.

    It's also handy if you have an LLM node or API upstream that returns bracketed output and you want per-field routing. Feed the raw response in, set output_count to your known field count, and each field becomes a first-class wire.

    Honest limits: it only extracts bracketed text - if your fields use {} or () or a colon-separated scheme, this won't see them. And it's purely positional; if the template is missing a field, your downstream node gets an empty string, which may or may not be what you want (empty strings are often fine for text encoders, but they don't silently "skip"). For the bracketed-template world this pack lives in, though, it's the right tool.

    Install

    Part of Pond Nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Pondowner857/comfy_Pond_Nodes
    cd comfy_Pond_Nodes
    pip install -r requirements.txt
    

    Restart after (or Manager → "comfy_Pond_Nodes"). No models, no optional deps - pure regex plus a small JS file for the dynamic outputs. Standard pack caveat: the README warns of console spam if comfyui_HiDream-Sampler is installed alongside.

    Category🐳Pond/prompt

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGCategory: [clothing] Color: [red] Instruction: [Put a clothing on the model.]—
    output_countINT31–100—

    Outputs (100)

    NameTypeDescription
    输出_1STRING—
    输出_2STRING—
    输出_3STRING—
    输出_4STRING—
    输出_5STRING—
    输出_6STRING—
    输出_7STRING—
    输出_8STRING—
    输出_9STRING—
    输出_10STRING—
    输出_11STRING—
    输出_12STRING—
    输出_13STRING—
    输出_14STRING—
    输出_15STRING—
    输出_16STRING—
    输出_17STRING—
    输出_18STRING—
    输出_19STRING—
    输出_20STRING—
    输出_21STRING—
    输出_22STRING—
    输出_23STRING—
    输出_24STRING—
    输出_25STRING—
    输出_26STRING—
    输出_27STRING—
    输出_28STRING—
    输出_29STRING—
    输出_30STRING—
    输出_31STRING—
    输出_32STRING—
    输出_33STRING—
    输出_34STRING—
    输出_35STRING—
    输出_36STRING—
    输出_37STRING—
    输出_38STRING—
    输出_39STRING—
    输出_40STRING—
    输出_41STRING—
    输出_42STRING—
    输出_43STRING—
    输出_44STRING—
    输出_45STRING—
    输出_46STRING—
    输出_47STRING—
    输出_48STRING—
    输出_49STRING—
    输出_50STRING—
    输出_51STRING—
    输出_52STRING—
    输出_53STRING—
    输出_54STRING—
    输出_55STRING—
    输出_56STRING—
    输出_57STRING—
    输出_58STRING—
    输出_59STRING—
    输出_60STRING—
    输出_61STRING—
    输出_62STRING—
    输出_63STRING—
    输出_64STRING—
    输出_65STRING—
    输出_66STRING—
    输出_67STRING—
    输出_68STRING—
    输出_69STRING—
    输出_70STRING—
    输出_71STRING—
    输出_72STRING—
    输出_73STRING—
    输出_74STRING—
    输出_75STRING—
    输出_76STRING—
    输出_77STRING—
    输出_78STRING—
    输出_79STRING—
    输出_80STRING—
    输出_81STRING—
    输出_82STRING—
    输出_83STRING—
    输出_84STRING—
    输出_85STRING—
    输出_86STRING—
    输出_87STRING—
    输出_88STRING—
    输出_89STRING—
    输出_90STRING—
    输出_91STRING—
    输出_92STRING—
    输出_93STRING—
    输出_94STRING—
    输出_95STRING—
    输出_96STRING—
    输出_97STRING—
    输出_98STRING—
    输出_99STRING—
    输出_100STRING—