Nodes/GraftingRayman/GRPromptViewer
ComfyUI Node

GRPromptViewer

A file-backed prompt library, built into a node

By GraftingRayman·Created 2 years ago·Updated about a month ago· 76
GRPromptViewer
    • content
    • image
    folder
    file
    seed0
    content
    editedfalse

    Everyone who's used ComfyUI for more than a week has lost a good prompt - closed a tab, overwrote a text box, forgot which run produced which image. This node exists to make that stop happening by accident. It's a small prompt library that lives inside the node itself: browse folders, pick a saved prompt file, edit it in place, and every prompt you actually queue gets auto-saved to disk whether you asked it to or not.

    How it works

    Prompts live as text files on disk, under ComfyUI_GraftingRayman/Nodes/prompts inside the pack's own folder, organized into subfolders you create as you go - the sample folder list from a live install shows (root), Flux, Pony, and auto-save, which tells you the shape: your own hand-organized categories sitting alongside a dedicated bucket the node fills automatically. Pick a folder, then a file from within it - the file list also includes a 🎲 Random entry, and seed controls that random pick, so fixing the seed gets you the same "random" file back on a rerun instead of a different one each time.

    Once a file's loaded, its text sits in content, which you can edit directly in the node - edited is a bookkeeping flag telling you whether what's in the box still matches what's saved on disk, not something you need to set yourself. Every prompt that actually gets queued is auto-saved, which is where the auto-save folder comes from - you build a searchable history for free just by using ComfyUI normally, with zero extra clicks.

    The README also documents a nice pairing behavior: if a saved prompt has an image sitting next to it under the same filename, this node pulls that image in as its second output, so you get "which prompt made this" without cross-referencing filenames by hand. If there's an image with no matching prompt, the in-app node offers to generate one for it and save it under the image's name - that's an interactive app feature rather than something exposed as a plain input here, so don't expect to drive it from the API.

    The inputs and outputs that matter

    • folder / file - which saved prompt to load; file includes a random option.
    • seed - makes the 🎲 Random file pick reproducible.
    • content - the editable prompt text, wire this into your CLIP Text Encode.

    Two outputs: content (STRING, the prompt text) and image (IMAGE, the paired image if one exists for the loaded file - expect this empty when there isn't one, that's normal, not a bug).

    How to install it

    ComfyUI Manager, search GraftingRayman. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GraftingRayman/ComfyUI_GraftingRayman
    

    Restart afterward. This whole pack fails to import without OpenAI's CLIP installed separately - portable ComfyUI: .\python_embeded\python.exe -m pip install git+https://github.com/openai/CLIP.git; system Python: pip install git+https://github.com/openai/CLIP.git. This node doesn't touch CLIP directly, but you'll lose it along with everything else in the pack if you skip the step.

    Common issues & troubleshooting

    Pack fails to load entirely. Check your startup console for the CLIP import error and run the pip install above.

    Folder and file dropdowns are empty on a fresh install. Nothing's been saved yet - the library builds up as you use it. Queue at least one run with a prompt typed into content to seed the (root) folder, or create your own folder structure and drop .txt files in by hand.

    Random file pick isn't actually random, or won't reproduce a specific one. That's seed - leave it changing for genuine variety across runs, or fix it if you want the same "random" pick back.

    Image output is empty. Expected whenever the loaded prompt file has no same-named image sitting next to it - this isn't an error condition.

    CategoryCustom

    Inputs (5)

    NameTypeDefaultDescription
    folderCOMBO4 options: (root), Flux, Pony, auto-save
    fileCOMBO31 options: 🎲 Random, 01-11-25-19-19-18.autosave.txt, 01-11-25-19-19-28.autosave.txt, 01-11-25-19-19-31.autosave.txt, 01-11-25-23-59-09.autosave.txt, 02-11-25-08-37-09.autosave.txt, +25
    seedINT00–18446744073709550000
    contentSTRING
    editedBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    contentSTRING
    imageIMAGE