Nodes/Kemmy Prompt Library/cn_01_kemmy_Prompt Library Selector
ComfyUI Node

cn_01_kemmy_Prompt Library Selector

A prompt library that remembers which outfit belongs to which character

By kemmy2302·Created 7 days ago·Updated 3 days ago· 3
cn_01_kemmy_Prompt Library Selector
    • prompt
    selection_json{"selected_ids": [], "snapshot": []}
    separatorcomma + newline
    simple_combinefalse
    anima_character_clausesfalse

    If you generate anime character scenes, you retype the same fragments endlessly: the blonde character, the school uniform, the watercolor style tag. Most "prompt library" tools answer with a wildcard text file and no eyes on it. cn_01_kemmy_Prompt Library Selector (class OPTPromptLibrarySelector) is different - a thumbnail-backed card library whose real trick is assembling a prompt per character, so the graph knows the red dress belongs to Alice and the uniform to Bob. That's exactly where multi-character generations fall apart.

    What it actually is

    The pack - kemmy2302's cn_01_kemmy_ComfyUI-Prompt-Library, MIT, one maintainer - is a data store plus one thin composing node, found under Ordered Prompt Tools → cn_01_kemmy_Prompt Library Selector. You save named presets with a category (Character, Outfit, Pose, Style ship by default), an optional thumbnail image, and the prompt text. Categories become tabs, search covers name/category/text, and a Selected prompts (output order) area reorders or removes picks. One STRING output then feeds wherever prompt text goes: CLIP Text Encode, an Ollama/LLM node, even your negative prompt.

    How the magic stays boring

    The portability trick: everything you click in that card UI is serialized into one plain widget, selection_json, whose default is the unassuming {"selected_ids": [], "snapshot": []}. The Python node parses that JSON, reorders the snapshots by selected_ids, and joins them with the separator you choose. No Python deps, no model files - a composition node wearing a lot of GUI. Because the state is a real widget, it rides inside the shared workflow JSON, so the text survives even without your library.

    The inputs that matter

    You'll realistically set three things, and never touch one of them by hand:

    • selection_json - the card UI owns it; for everyone else it's read-only state. (Being a plain STRING input, another node could theoretically drive it.)
    • separator - how presets join: comma + newline (default), newline, comma, or BREAK. One caution: BREAK is a CLIP-era chunk-boundary tool that only means something on the 77-token tag models (the Illustrious/NoobAI/Pony line this pack targets). On LLM-encoded models it's inert - stick with comma + newline or newline there.
    • simple_combine and anima_character_clauses - the two output modes. simple_combine ignores grouping and joins everything in selection order into one unlabelled string; leave both unchecked and you get the labeled blocks below.

    Why the character grouping is the point

    Leave simple_combine off and picks get organized into Character 1:, Character 2:, and Shared instructions: sections. Presets whose category is Character, Characters, キャラ, キャラクター, or 人物 auto-assign their own number; other picks you assign per selection - outfits and poses included - into that character's block, while shared scene details stay outside. That's genuinely useful before an Ollama or other LLM node - explicit boundaries instead of one undifferentiated tag list, the exact attribute-blinding failure that plagues multi-subject prompting.

    Check anima_character_clauses and it reformats that same data into (chara1 is a girl, black hair, red eyes, black kimono.), per character, shared content left outside the parens - aimed at Anima's text encoder, which reads clearer character boundaries than loose tags. It takes priority over simple_combine, and the node adds the trailing period, closing parenthesis, and comma for you; you write the identity phrase ("a girl") in the character preset itself. Feeding these clauses to an LLM? Its system prompt must order it to preserve every (charaN is ... .), block, or it will merge your characters into one prose paragraph.

    Installing and keeping it alive

    From ComfyUI/custom_nodes, this is a two-line job:

    git clone https://github.com/kemmy2302/cn_01_kemmy_ComfyUI-Prompt-Library.git
    

    Then restart the backend - not just the browser tab - and hard-refresh with Ctrl+F5. No Python dependencies, nothing to download. The repo is set up for the Comfy Registry, so ComfyUI Manager may find it as "Kemmy Prompt Library" once a release exists; the clone is the guaranteed route.

    Two gotchas up front. This is a single-commit, single-author pack released days ago - small, readable code, but zero battle history. And your library lives at ComfyUI/user/ordered_prompt_tools/ (library.json plus thumbnails/), deliberately outside the plugin so updates don't wipe it - but thumbnails don't travel with a shared workflow, only the text snapshots do. Back that folder up if the library is the asset. If the node ever goes missing, check it isn't nested in an extra ZIP folder and that only one copy is installed.

    Verdict

    It's a convenience node whose value compounds: useless the first day, quietly indispensable once you've built a cast you reuse across fifty generations. If you rarely repeat fragments, a plain text file and a Primitive node do the same job with less ceremony - you don't need this. But if you compose scenes from recurring characters, it's the rare prompt tool that treats "who is wearing what" as first-class data instead of a formatting accident.

    CategoryOrdered Prompt Tools

    Inputs (4)

    NameTypeDefaultDescription
    selection_jsonSTRING{"selected_ids": [], "snapshot": []}
    separatorCOMBOcomma + newline4 options: comma + newline, newline, comma, BREAK
    simple_combineoptBOOLEANfalseCombine selected prompts in order without Character or Shared sections.
    anima_character_clausesoptBOOLEANfalseFormat character groups as (charaN is ... .), clauses. This takes priority over simple_combine.

    Outputs (1)

    NameTypeDescription
    promptSTRING