Nodes/Prompt Deck/Prompt Deck
ComfyUI Node

Prompt Deck

Prompt Deck shows your prompt list while it runs

By omervaner·Created 2 months ago·Updated 2 months ago· 1
Prompt Deck
    • text
    • filename_slug
    file_path
    line_index0
    pre_text
    after_text
    search
    replace
    cut_to
    cut_from
    rating_filterall
    disabled_lines
    resolved

    Every prompt feeder in ComfyUI has the same dirty secret: it's blind. You point it at a text file, set it to run line 531, and you have no idea what line 531 actually says until the image comes out wrong. Prompt Deck (PromptDeck from omervaner/ComfyUI-PromptDeck) fixes that: it renders the whole file inside the node, highlights the line that's running, marks what's next, and lets you jump around. If you batch-generate from a prompts file at all, this is the one you'll actually reach for.

    What it is and where it fits

    It's an output node that reads a .txt file with one prompt per line, skips blank lines and # comments, and feeds the current line's text downstream. You wire its text output into the text input of a CLIP Text Encode node (or Flux's conditioning encoder - it just spits out a string). It's built for the "run a deck of prompts" workflow: character variants, style tests, or a few hundred lines of A/B prompts. Set line_index's control to increment, queue 20 runs, and you get 20 different prompts - the same control_after_generate machinery (fixed / increment / decrement / randomize) you already know from the KSampler seed widget.

    How it works

    The Python side is dead simple: load the file, filter out disabled and bad-rated lines, then take line_index modulo the count of runnable lines - any value is safe and it wraps, so randomize gives you random lines for free. Then it applies text surgery in a fixed order: strips leading list numbering (12.), cuts the head up to your cut_to markers, cuts the tail from your cut_from markers, does a search/replace, and finally wraps the result in pre_text + line + after_text. The node's IS_CHANGED keys off the file's mtime and size (plus its ratings sidecar), so editing the txt mid-session is fine - the next run picks up the change.

    The list renders inside the node with numbered rows, a highlighted running line, and a header showing position / total · word count; it even resizes with its rows. Hover a truncated line to see the full prompt in a floating box. Click any line to jump to it, hold a button to pin and repeat a line until you release it. Ratings (★ good / ✕ bad) write to a sidecar yourfile.txt.deck.json next to your prompts, keyed by line text rather than line number, so they survive restarts and file reordering.

    The inputs that matter

    • file_path - the path to your .txt, one prompt per line. The only thing you strictly have to set.
    • line_index - position among runnable lines, with control_after_generate for increment / decrement / randomize / fixed. Also a saved widget, so your position survives a restart.
    • pre_text / after_text - text wrapped around each line. Handy for a shared quality prefix or a fixed style suffix without editing the file.
    • cut_to / cut_from - comma-separated markers that trim a line's head or tail. cut_from: cinematic, film grain drops style tails from every line in one go.
    • search / replace - plain text substitution.
    • rating_filter - all, good only, or hide bad, once you've starred your favorites.

    The two outputs are text (the composed prompt - wire it into your text encoder) and filename_slug (a filesystem-safe slug, handy for a Save node's filename_prefix so images are named after their prompt). A detail worth calling out: the actual composed prompt gets written back into the read-only resolved box after each run, so the real text lands in your workflow JSON and PNG metadata instead of the stale greyed-out string in a connected prompt box.

    Installing it

    Zero dependencies - no pip, no requirements.txt, just pure Python stdlib plus one JS file. Either use ComfyUI Manager (search "ComfyUI-PromptDeck") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/omervaner/ComfyUI-PromptDeck
    

    Restart ComfyUI, then add it via Add Node → PromptDeck → Prompt Deck (search "prompt deck"). The node runs standalone as an output node, so you can test the feeder without loading a single model.

    Gotchas

    • "File not found" means the path is wrong - backslashes are fine on Windows, just point at the real file.
    • line_index counts runnable lines (enabled + passing the rating filter), not raw file lines - so the widget number won't match your editor's once you've disabled or rated lines out.
    • resolved and disabled_lines are JS-managed - don't edit them by hand.

    It's a niche tool with a genuinely small footprint (don't expect a big community behind it), but the README is thorough and the code is tidy. If you only ever type one prompt at a time, skip it. If you run hundreds from a file, this is the feeder that stops making you guess.

    CategoryPromptDeck

    Inputs (11)

    NameTypeDefaultDescription
    file_pathSTRINGPath to a .txt file, one prompt per line.
    line_indexINT00–2147483647Position among runnable lines (wraps around). Control: increment = forward, decrement = reverse, randomize = random, fixed = hold.
    pre_textSTRING
    after_textSTRING
    searchSTRINGText to find in each line (leave empty for no replacement).
    replaceSTRINGWhat `search` gets replaced with.
    cut_toSTRINGComma-separated markers. Cuts everything up to and including the earliest match (trims the line's head).
    cut_fromSTRINGComma-separated markers. Cuts everything from the earliest match onward (trims the line's tail).
    rating_filterCOMBOall3 options: all, good only, hide bad
    disabled_linesoptSTRING
    resolvedoptSTRING

    Outputs (2)

    NameTypeDescription
    textSTRING
    filename_slugSTRING