ComfyUI Node

text_sum

Apt_Preset's YAML-backed prompt library, with find-and-replace built in

By cardenluo·Created 2 years ago·Updated 21 days ago· 309
text_sum
    • pos
    • neg
    select_yamldraw_prompt.yaml
    select
    prompt
    negative
    add_pos
    add_neg
    styleNone
    remove
    replace_target
    replace

    Apt_Preset ships several dropdown-driven prompt builders (excel_Prompter, excel_VedioPrompt, and friends), but they all bake their option lists into the node's Python code. text_sum works differently: it reads its presets from external YAML files, which makes it the pack's most flexible prompt tool and the one to reach for when you want a saved prompt template rather than a menu of individual tag pieces.

    Two-level selection. select_yaml picks which preset file to pull from - ten ship with the pack, and their names tell you what each is for: draw_prompt.yaml for general image prompts, kontext_presets.yaml and kontext_propmpt.yaml for Flux Kontext editing setups, wan2.2.yaml for Wan video, QwenEdit.yaml for Qwen-Image-Edit workflows, edit_light.yaml for lighting-edit presets, material.yaml for material/texture prompts, AI_roles.yaml for character/role prompts, Image2text.yaml for image-captioning-style prompts, and 00_blank.yaml as an empty starting point. Once you've picked a file, select narrows down to a specific named preset inside it - 343 across all ten files combined, things like draw_AB-dynamic, Kontext_提示词技巧 (Kontext prompt tips), or draw_Personification.

    Then you layer your own text on top. prompt and negative are your own free-text fields, and add_pos/add_neg append extra text onto whatever the selected preset already contributes - so you're not limited to the preset verbatim, you can extend it. style (323 choices) is a separate styling layer, drawing on categories that echo Stability AI's own official SDXL style list (things like "general-realistic" or "SAI official-3D model") alongside the pack's own custom categories.

    The editing tools are the part worth knowing about specifically. remove strips words out of the final assembled text, and per the node's own description it supports removing several words in one pass by separating them with @ - "a@b@c" removes all three at once, rather than needing three separate remove nodes chained together. replace_target/replace is a straightforward find-and-replace pair on top of that. Between the preset system, the free-text layering, and this cleanup step, text_sum functions less like a tag picker and more like a small prompt-templating pipeline: load a base, extend it, then scrub or swap specific words before it goes out.

    Outputs - both at once. pos and neg, two STRING outputs, so unlike the excel_* nodes (which only produce a positive prompt), this one hands you a matched negative prompt too, pulled from whichever preset you selected and modified by your own negative/add_neg fields.

    Installing it. Standard for the whole pack - search "ComfyUI-Apt_Preset" in ComfyUI Manager, or clone directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
    

    Run install.bat on Windows for dependencies, then restart ComfyUI. The YAML preset files ship inside the pack's own repository, so there's nothing extra to download for this node specifically.

    Troubleshooting. If a preset from select looks wrong or empty, double-check you've got the matching select_yaml file chosen first - the ten files are separate preset pools, and select's full list only makes sense in the context of whichever file is active. If remove isn't stripping what you expect, verify you're using @ between terms rather than a comma or space, since that's the specific separator the node documents. As with the rest of the pack, if text_sum doesn't show up at all after installing, that's most likely the documented pack-wide IMPORT FAILED issue from a missing dependency elsewhere - check the ComfyUI console log on startup and reinstall via Manager's "install missing custom nodes" rather than assuming this node is the problem.

    CategoryApt_Preset/prompt

    Inputs (10)

    NameTypeDefaultDescription
    select_yamlCOMBOdraw_prompt.yaml10 options: 00_blank.yaml, AI_roles.yaml, Image2text.yaml, QwenEdit.yaml, draw_prompt.yaml, edit_light.yaml, +4
    selectCOMBO343 options: , 00_blank, Kontext_提示词技巧, draw_AB-dynamic, draw_AB-static, draw_Assembly, +337
    promptSTRING
    negativeSTRING
    add_posSTRING
    add_negSTRING
    styleCOMBONone323 options: None, 通用-基础, 通用-写实, 通用-效果图, 通用-纯净, SAI官方-3d模型, +317
    removeSTRING
    replace_targetSTRING
    replaceSTRING

    Outputs (2)

    NameTypeDescription
    posSTRING
    negSTRING