ComfyUI Node

萌宝AI·提示词读取

Pull a saved prompt into the graph without retyping it

By Corkery520·Created 3 days ago·Updated 3 days ago· 0
萌宝AI·提示词读取
    • prompt
    • status
    groupall
    titleUntitled
    fallback_prompt

    WANGPromptReader (萌宝AI·提示词读取) is the read half of the pack's prompt library, and it's the node you actually want in a production graph. The organizer can fetch a prompt too, but it errors when nothing matches and it does eight other things. This one is narrow on purpose: pick a grouping in a dropdown, get a string out.

    The two dropdowns, and how they're built

    group and title are combo widgets whose values are generated from the saved prompt store when ComfyUI loads the node's definitions - all, default, then your groups; and Untitled, then each saved prompt as group / title. So selection is a pick-list rather than typing, which is the entire ergonomic win: no more copying a prompt out of a notes app and hoping you grabbed the current version.

    fallback_prompt is the third input, and it's the good design decision here: if nothing matches, the node returns your fallback text instead of throwing. That makes the node safe to leave in a shared workflow - someone with an empty library gets a working (if generic) run plus a clear status line, not a red error.

    Two outputs: prompt (the STRING you wire into whatever consumes it) and status, which reads either Loaded prompt: group / title or No saved prompt matched. Returned fallback_prompt.

    How the lookup actually resolves

    It's more forgiving than the dropdown suggests, and that's deliberate:

    1. If title contains " / " - the full group / title label the dropdown shows - it splits it and looks up that pair directly, regardless of what group says. This is why a label copied from the picker always resolves.
    2. If the pick-list value isn't a full label, and group isn't all, it looks up that exact group + title pair.
    3. If that fails, it does a filtered search - group and title treated as loose criteria - and takes the first hit.

    So a stale dropdown entry that no longer matches exactly still tends to resolve, and picking all on a group that no longer exists widens rather than zeroes out. The fallback catches only the genuine misses.

    Why it beats pasting text

    Two reasons that have nothing to do with convenience. First, prompts on this class of node are one place to change - you edit the saved prompt once and every workflow that reads it picks up the change on the next run, which is the difference between updating twenty graphs and updating zero. Second, it makes the prompt auditable: the text lives in ComfyUI/user/mengbaoai/prompts.json where it can be searched, tagged and exported, instead of being scattered across widgets inside workflow JSON files.

    Pair it with the pack's output nodes and the loop closes: MengBaoSaveImage / MengBaoPreviewImage can add a generation prompt to the library from the panel, and this node reads it back into the next run. Worth knowing if you use those nodes' auto-detection: they only recognise the pack's generation node and a stock positive CLIPTextEncode behind a KSampler, so if your prompt arrives through this reader, wire the optional generation_prompt input on the save/preview node explicitly. That connection always wins over graph-walking.

    Installing it

    One of 17 nodes in ComfyUI-MengBaoAI (Corkery520, MIT, Registry id mengbaoai). Manager: search MengBaoAI, mengbaoai, 萌宝AI. CLI: comfy node install mengbaoai. Git route while the Registry listing is pending:

    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 live in ComfyUI/user/mengbaoai/prompts.json, and the pack migrates from the legacy WANG_prompt_organizer_nodes plugin's data/prompts.json on first load. If you still have that plugin enabled, disable it - the README names it as one of the packs that produces duplicate node IDs and duplicate HTTP routes. After installing or updating, Ctrl+F5; the front-end panels and the combo population both depend on freshly loaded definitions.

    Things that bite

    • New prompts don't appear in the dropdown until the node definitions reload. Save a prompt in the organizer, come back to a workflow that already had this node on the canvas, and the title combo may still be stale - the reader's fuzzy lookup usually saves you, but a page refresh (or re-adding the node) is the reliable fix.
    • No fallback on a typo'd group when title carries a full label. The label wins; if it points at a deleted group, you fall through to fallback even though a similar prompt exists.
    • Empty store, empty result. A fresh install has no prompts, so fallback_prompt is doing all the work until you save one. Fill it in - it's the difference between a generic image and an error.
    • Prompts aren't part of the workflow. Share the JSON without your library and the recipient needs this node's fallback, or their own saved prompt under the same name.
    Category萌宝AI/提示词

    Inputs (3)

    NameTypeDefaultDescription
    groupCOMBOall2 options: all, default
    titleCOMBOUntitled1 options: Untitled
    fallback_promptSTRING

    Outputs (2)

    NameTypeDescription
    promptSTRING
    statusSTRING