Nodes/ComfyUI-nhknodes/πŸ“ Image Series With Prompts (nhk)
ComfyUI Node

πŸ“ Image Series With Prompts (nhk)

A folder of images where every frame drags its own prompt along

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
πŸ“ Image Series With Prompts (nhk)
    • image
    • prompt
    • filename
    • current_index
    • total_images
    β—„modeβ–Ύβ–Ί
    β—„pathβ–Ί
    β—„pattern*β–Ί
    β—„prompt_fileβ–Ί
    β—„default_promptβ–Ί
    β—„index0β–Ί
    β—„seed0β–Ί
    β—„labelSeriesWithPrompts001β–Ί
    β—„resetfalseβ–Ί

    Here's a workflow pain most people just live with: you're doing image-to-image over a shot list - ten frames, each with its own descriptive prompt - and you have to keep the right prompt in sync with the right image by hand. Miss one and frame 7 gets regenerated with frame 4's prompt and the whole batch is quietly ruined. LoadImageSeriesWithPrompts solves that by loading the image and its prompt together. It's LoadImageSeries with a prompt lookup bolted on, and for shot-by-shot or panel-by-panel work it's the version you actually want.

    It sits in nhk/image of the nhknodes pack, and it has one extra input over the plain loader: prompt_file.

    How it works

    Under the hood it's LoadImageSeries - same mode/path/pattern, same per-label in-memory counter, same auto-advance and wrap-around. The difference is that when a file is selected, the node also consults a markdown lookup file that maps filenames to prompts, and outputs the matching prompt alongside the image.

    The prompt file format is dead simple and documented in the source:

    # Shot Prompts
    
    shot_01.png
    Close-up, soft light on subject
    
    shot_02.png
    Wide shot, dramatic shadows
    

    Blank lines separate entries. First non-empty line of an entry is the filename, the rest are the prompt. You can also add a wildcard entry - a filename of * - that applies to any image not explicitly listed. Lookup is case-insensitive, and the resolution order is: exact filename match β†’ wildcard β†’ default_prompt. If no prompt_file is given at all, default_prompt is used for everything, which makes the node degrade gracefully into a plain sequence loader.

    The inputs that matter

    • prompt_file - path to the markdown lookup. The only new thing you need to learn.
    • default_prompt - the fallback for unlisted files. Set it so a missing entry doesn't silently produce an empty prompt.
    • Everything else (mode, path, pattern, index, seed, label, reset) works exactly like LoadImageSeries.

    Outputs are image, prompt (STRING - feed this into your positive conditioning), filename, current_index, and total_images. The prompt output is the payoff: your text encoder and your image now advance in lockstep.

    Installing

    Same pack, same routine:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Enashka/ComfyUI-nhknodes
    

    or ComfyUI Manager β†’ search "NHK Nodes" β†’ install β†’ restart. No models, no extra deps. It lives under nhk/image.

    Where people get burned

    • "It's loading the default prompt for everything." The prompt file path is wrong, the file has no entries, or the lookup is case-mismatched. The node prints "No prompts loaded from ... Check path and markdown formatting." to the console - that's your first clue. Also remember entries need at least two non-empty lines; a filename with an empty prompt is silently skipped.
    • Wrong prompt for the wrong frame. The lookup keys off the basename, and the loader sorts by absolute path - so frame_10.png sorts before frame_2.png. If your shot list isn't zero-padded, the sequence order and your mental order won't match.
    • The usual series traps. New folder without a new label β†’ counter carries over. Reset on repoint.

    This is genuinely the most useful variant in the series family: it turns a folder of images plus a notes file into a self-driving img2img shot list. For multi-shot character consistency work where each frame has its own description, this is the node that makes "workflow included" actually reproducible.

    Categorynhk/image

    Inputs (9)

    NameTypeDefaultDescription
    modeCOMBOsingle_image: load by index (use with control_after_generate=increment for sequences), random: load random image by seed
    pathSTRINGDirectory path containing images to load
    patternSTRING*Glob pattern to filter files (e.g., '*.png', 'img_*.jpg', '**/*.png' for recursive)
    prompt_fileSTRINGMarkdown file mapping filenames to prompts (optional)
    default_promptSTRINGFallback prompt when no file-specific prompt exists
    indexINT0Starting index for single_image mode (auto-increments with control_after_generate)
    seedINT0Seed for random mode (same seed = same random image)
    labelSTRINGSeriesWithPrompts001Unique identifier for tracking this sequence independently from others
    resetBOOLEANfalseReset counter back to index 0

    Outputs (5)

    NameTypeDescription
    imageIMAGEβ€”
    promptSTRINGβ€”
    filenameSTRINGβ€”
    current_indexINTβ€”
    total_imagesINTβ€”