Nodes/Y7Nodes for ComfyUI/Y7 Prompt Library
ComfyUI Node

Y7 Prompt Library

Your best prompt is in a notes app you can't search — Y7 Prompt Library fixes that

By yushan777·Created 2 years ago·Updated 6 days ago· 10
Y7 Prompt Library
    • prompt
    ◄library►
    ◄entry_id►

    Prompts stopped being a handful of comma-separated tags somewhere around 2025 and turned into paragraphs. Krea 2 wants you to "describe an image to a person", long and specific, and it rewards being picky about disambiguation like Teen Titans (2003) instead of Teen Titans. Once a prompt is 200 words of deliberate wording, it stops being something you retype and becomes an asset. And assets get lost.

    The usual ComfyUI answer is a Text node you keep in the workflow, or a notepad file with twenty prompts and no idea which one made that image you liked. Y7 Prompt Library is the other answer: a grid of saved prompts, each optionally carrying an example image, that outputs the selected one as a plain string.

    How it actually works

    The node is two halves. On the node itself you get a gallery UI - click a card to select it, click again to deselect, double-click to edit, right-click for Edit / Copy prompt / Delete. The ☰ / ▦ button toggles between thumbnails and a compact list with a small preview, a name and the start of the prompt, and each node remembers which view you left it in.

    Underneath, there is almost no node to speak of. The two inputs - library and entry_id - are hidden socketless strings driven by the gallery, and the single output is prompt, a STRING you wire into a CLIP Text Encode or whatever else wants text. That's the whole interface.

    Storage lives in ComfyUI's user directory, not in your workflow:

    ComfyUI/user/<profile>/y7_prompt_lib/
    ├── libraries/<name>.json      # entries: id, name, prompt, preview flag
    └── previews/<id>.webp         # example images, downscaled to 512px
    

    Entries are tracked by an internal id rather than by name, which is the reason renaming an entry - or moving it to a different library - doesn't break the workflows that point at it. Workflows store the id, and the id survives cosmetic changes. Nice bit of design for something this small.

    There's a quiet mechanism worth knowing about, too: the node fingerprints on the prompt text, so editing the prompt of the selected entry picks up on the next queue without you reselecting the card. No stale prompt, no "why is it still generating the old thing".

    Getting prompts in and out

    + Entry opens an editor with library, name and prompt, plus an optional image you can click, drag or paste in (PNG, JPEG, WebP). That image gets downscaled to 512px and stored as a WebP next to the library, so a thousand entries don't turn into a gigabyte of thumbnails.

    Bulk import is where this gets genuinely useful. Point Import at a folder or a .zip and it takes paired files: name.txt holds the prompt, name.png / .jpg / .webp with the same stem is its image, and underscores in the filename become spaces in the entry name. A .txt with no image becomes a text-only entry; an image with no .txt is skipped. Which is exactly the shape of a downloaded Civitai "prompt + sample image" folder, so migrating a collection is one dialog. The import previews everything before writing, and names that already exist in the target library are skipped rather than duplicated.

    The ⋯ menu renames, reloads, deletes, or exports the current library as a zip (library.json plus previews/). That zip is your backup, and it's also how you move a library between machines.

    Install

    ComfyUI Manager → Custom Nodes Manager → search Y7 or Y7Nodes → Install → restart. Manual, if you prefer:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/yushan777/ComfyUI-Y7Nodes
    pip install -r ComfyUI-Y7Nodes/requirements.txt
    

    Then restart ComfyUI. Worth saying plainly: the pack's requirements.txt pulls color-matcher and opencv-python-headless for two other nodes in the pack. This one doesn't use either - it wants Pillow, which ComfyUI already ships. So if pip fails on the pack install, the prompt library isn't the thing that's broken, but you still need the pack to import cleanly for the node to register.

    These nodes are written against ComfyUI's newer V3 node API (comfy_api.latest.io). On a ComfyUI old enough to predate that, they simply won't appear in the node list - no error, just an empty search. Update ComfyUI first.

    Where people get burned

    • An empty string is not an error. With no card selected, prompt outputs "" and your workflow runs happily with a blank prompt. If generations come out generic, look at the node before you look at the sampler.
    • Libraries don't travel with the workflow. Duplicate a workflow to another machine and the entries it points at aren't there. Export the library zip and import it there.
    • Library names are picky - letters, numbers, spaces and . + ( ) - _ only, 80 characters. A name with a colon or a slash gets rejected.
    • Your .txt sidecars only count if the stem matches exactly, case included. Cat.txt next to cat.png is a text-only entry and an orphan image.

    If you run one prompt forever, a Text node is fine and this is overhead. If you have a stable of twenty looks you keep coming back to - and most people who've used Krea 2 or Klein for a month do - this is the first node in the pack I'd install.

    CategoryY7Nodes/Prompt

    Inputs (2)

    NameTypeDefaultDescription
    librarySTRING—
    entry_idSTRING—

    Outputs (1)

    NameTypeDescription
    promptSTRING—