ComfyUI Node

text_sum_edit

Save and delete named prompts in the pack's YAML prompt library

By cardenluo·Created 2 years ago·Updated a day ago· 324
text_sum_edit
    • status
    select_yaml00_blank.yaml
    custom_yaml
    edit_item
    edit_modetrue
    prompt
    negative

    If you've used this pack for any length of time you've met text_sum - the dropdown node that spits out a ready-made positive/negative prompt pair from a named library. text_sum_edit is how that library gets its entries. It's a tiny editor: give it a YAML file, an entry name, a prompt and a negative, and it saves that pair (or deletes it) from disk. New entries show up in the text_sum dropdown immediately, no restart. It's the pack's answer to "stop retyping the same five prompts."

    How it works

    The library is just YAML files living in custom_nodes/ComfyUI-Apt_Preset/NodeChx/yaml/. Each file is a mapping of entry name → {prompt, negative}. The node writes to the file you pick with select_yaml, using edit_item as the key. Flip edit_mode to delete and it removes that key instead. The output status string confirms what happened ("Saved 换人 in minimaxH3.yaml").

    The shipped files are per-model template collections - minimaxH3.yaml ships with H3 video-editing templates (face swap, background swap, that kind of thing, named in Chinese), wan2.2.yaml with prompt formulas, plus Image2text.yaml, QwenEdit.yaml, edit_light.yaml and a blank starter. You don't have to use any of them - select_yaml has a custom_yaml option where you type your own filename and start a fresh library.

    A couple of details that keep it from foot-gunning you: the filename is validated to stay inside the yaml directory (no ../ escapes), the YAML is loaded and saved as a proper mapping, and a file-watcher (watchdog) refreshes the text_sum dropdown live, so the node you're saving for reflects the change on the same run.

    The inputs that matter

    • select_yaml - which library file. Default 00_blank.yaml, or one of the shipped model templates, or custom_yaml.
    • custom_yaml - only used when custom_yaml is selected; type a filename (.yaml is appended if you forget).
    • edit_item - the entry name. Required; empty raises "edit_item needs a name."
    • edit_mode - True = save, False = delete. The widget labels it "save / delete" so you don't have to guess.
    • prompt / negative - the content saved under the entry.

    Output is a single status string. Nothing else comes out - this is a write-only editor; the reading side is text_sum.

    Where you'd use it

    Build a personal library per model. Save your best H3 edit templates into minimaxH3.yaml or your own file, then pull them via text_sum whenever you start a similar shot. It's the kind of node that feels like overkill for one-off prompts and indispensable once you've got ten reused ones. The delete mode is also how you prune a library that's accumulated cruft - the "save" default on edit_mode means deleting is a deliberate choice, not an accident.

    Install

    Ships in ComfyUI-Apt_Preset: ComfyUI Manager → search "ComfyUI-Apt_Preset", or git clone https://github.com/cardenluo/ComfyUI-Apt_Preset into custom_nodes and run install.bat, then restart. No models; it does pull in pyyaml and watchdog via the pack's requirements. The usual trap: entries are keyed by exact edit_item name, so saving the same name overwrites silently, and deleting a name that doesn't exist is an error - check your spelling when pruning.

    CategoryApt_Preset/prompt

    Inputs (6)

    NameTypeDefaultDescription
    select_yamlCOMBO00_blank.yaml7 options: 00_blank.yaml, Image2text.yaml, QwenEdit.yaml, edit_light.yaml, minimaxH3.yaml, wan2.2.yaml, +1
    custom_yamlSTRING
    edit_itemSTRING
    edit_modeBOOLEANtrue
    promptSTRING
    negativeSTRING

    Outputs (1)

    NameTypeDescription
    statusSTRING