Nodes/MengBaoAI · 萌宝AI 综合节点套件/萌宝AI·提示词整理器
ComfyUI Node

萌宝AI·提示词整理器

One node, eight jobs, and the widget that picks which

By Corkery520·Created 3 days ago·Updated 3 days ago· 0
萌宝AI·提示词整理器
    • selected_prompt
    • results_json
    • titles_text
    • status
    actionsave_or_update
    groupdefault
    titlenew prompt
    prompt
    query
    tags
    note
    merge_modeupdate
    new_group
    import_json
    import_path
    export_path

    Everyone has a text file of prompts. The problem with the text file is that it lives outside ComfyUI, so the good prompt you wrote in March is invisible from the graph you're building in September. WANGPromptOrganizer (萌宝AI·提示词整理器) is a database for prompts that lives inside the workflow - saved by group and title, searchable, importable, exportable - and it also drives a front-end panel you'll reach for more than the node itself.

    The one thing to understand first

    This node is action-multiplexed. It does exactly one thing per execution, and the action widget decides which. Eight options:

    save_or_update, get, search, list, delete, import_json, export_json, rename_group.

    So it's not "the prompt node" - it's eight nodes wearing a trench coat. If you want to save a prompt and also search the library in the same graph, that's two organizer nodes, each with its own action set.

    Inputs and outputs

    All twelve inputs are widgets: action, group, title, prompt, query, tags, note, merge_mode, new_group, import_json, import_path, export_path. Which ones matter depends entirely on the action:

    • save_or_update - needs group, title, prompt, optionally tags and note. Same group+title updates the record in place, which is why "save" and "update" are one action.
    • get - needs group and title. If title contains " / " it splits it into group and title first, so you can paste a full group / title label. Not found is an error, not a fallback: Prompt not found: group / title.
    • search - uses query (and optionally group) and returns everything matching.
    • list - everything in a group, query ignored.
    • delete - matches group+title case-insensitively and removes the record.
    • import_json - takes a payload from the import_json field or a file at import_path, then merges using merge_mode: update, append, skip_existing or replace_all.
    • export_json - writes {"version": 1, "exported_at": ..., "prompts": [...]} to export_path. Give it a directory and it generates a timestamped filename inside it; leave it blank and it writes into the pack's user data directory. Paths are resolved on the machine running ComfyUI.
    • rename_group - needs group and new_group, and moving a whole group is one action instead of N edits.

    Four outputs, all STRINGs: selected_prompt (the single most relevant prompt for the action - the one you just saved, the one you got, or the first search hit), results_json (the matching records as indented JSON with non-ASCII preserved, so Chinese prompts stay readable), titles_text (a formatted list of titles), and status (a human sentence like Imported 12 prompt(s). Created: 9. Updated: 3.). In real graphs status goes to a text display and selected_prompt goes to a generation node's prompt input - that's the whole reason get and search exist as actions.

    Caching, and why it matters here

    The node's cache key is the prompt store file's modification time. Good news: change a prompt in the panel and the next run picks it up without you clearing anything. Bad news: the same mechanism invalidates everything downstream of the node whenever the store changes, so a graph that felt fast can suddenly re-run its whole generation chain because you edited an unrelated prompt. If you're doing prompt-library surgery, do it with the workflow idle.

    Installing it

    Part of ComfyUI-MengBaoAI (Corkery520, 17 nodes, MIT, Registry id mengbaoai). Manager: search MengBaoAI, mengbaoai or 萌宝AI. CLI: comfy node install mengbaoai. Git while the Registry release clears scanning:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Corkery520/ComfyUI-MengBaoAI.git
    cd ComfyUI-MengBaoAI
    python -m pip install -r requirements.txt
    

    numpy, Pillow, requests. Prompts are stored in ComfyUI/user/mengbaoai/prompts.json - not in the workflow, not in git - and the pack migrates from the old standalone WANG_prompt_organizer_nodes plugin's data/prompts.json on first load. Disable that plugin before running this one; the README lists it among the packs that cause duplicate node IDs and routes. The old /wang_prompt_organizer/* HTTP endpoints are still served, so existing front-end integrations keep working.

    Things that bite

    • Local-file import/export. import_path and export_path are server-side paths, so they don't work the way people expect on a remote ComfyUI instance. Pasting JSON into the field is the portable option.
    • get errors where the reader falls back. If you want "use what's saved, otherwise use this text", that's WANGPromptReader's job, not this node's.
    • Merge modes are destructive in the wrong order. replace_all replaces the whole store, not the group. Export first.
    • It's a library, not a structured prompt builder. Grouping and tags are your only organising tools - no folders within folders, no version history beyond timestamps.
    Category萌宝AI/提示词

    Inputs (12)

    NameTypeDefaultDescription
    actionCOMBOsave_or_update8 options: save_or_update, get, search, list, delete, import_json, +2
    groupSTRINGdefault
    titleSTRINGnew prompt
    promptSTRING
    querySTRING
    tagsSTRING
    noteSTRING
    merge_modeCOMBOupdate4 options: update, append, skip_existing, replace_all
    new_groupSTRING
    import_jsonSTRING
    import_pathSTRING
    export_pathSTRING

    Outputs (4)

    NameTypeDescription
    selected_promptSTRING
    results_jsonSTRING
    titles_textSTRING
    statusSTRING