Nodes/DJZ-Nodes/Zenkai Image Prompt V2
ComfyUI Node

Zenkai Image Prompt V2

The author's own image+prompt loader

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
Zenkai Image Prompt V2
    • IMAGE
    • STRING
    prompt_folder
    seed0
    mode
    num_images1
    blacklist

    "Zenkai" is Drift Johnson's own naming system - the pack's prompt-enhancement family (ZenkaiPrompt V1–V5, ZenkaiWildcard, and this) all carry it, and he's building a whole Zenkai XL Diffusion project around the idea. ZenkaiImagePromptV2 is the one that loads paired image-and-caption data: it reads images plus their matching text prompts from folders, and hands you both the IMAGE batch and the combined STRING prompt, selected sequentially or randomly by seed.

    The mental model is a mini dataset loader. Inside the pack there's an imageprompts/ folder (auto-created if missing), and each subfolder is a category: imageprompts/landscapes/, imageprompts/portraits/, and so on. In each subfolder you drop image files plus a same-named .txt file per image - example.png alongside example.txt containing that image's prompt. The prompt_folder dropdown (populated from those subfolders) picks the category, and the node does the rest.

    Inputs that matter: mode (sequential picks images in filename order starting from the seed index, random uses the seed for reproducible-but-scattered picks), num_images (1–10, how many pairs to grab and batch), and the optional blacklist - a comma-separated list of words or quoted phrases like cat, dog, "low quality" that filters out any pair whose caption contains a banned term. Outputs are IMAGE (the batch, size-padded so mismatched dimensions all fit) and STRING (captions joined with | separators - which, conveniently, is roughly how you'd want to feed multi-caption conditioning into a sampler).

    Why is this useful? For controlled sampling and img2img pipelines where you want a reference image and its prompt to travel together: a style-following workflow that reaches into your curated folder, pulls a look reference plus its caption, and feeds both downstream. It's also a decent poor-man's prompt-variation engine - set mode to random, keep the seed locked, and you get reproducible different references each run. And honestly, it's a window into how the author builds his own workflows: curated image/caption pairs driving generations, which is a legitimately good practice for keeping a consistent visual identity across a series.

    Caveats, and there are a few. It only reads .jpg/.jpeg/.png, converts everything to RGB, and auto-pads images of different sizes to the largest - so mixed-dimension folders will come out with letterboxing baked in. num_images caps at 10. And the blacklist is case-insensitive substring matching on the caption text - if a term appears anywhere in the text, that pair is excluded, so be deliberate with your terms. If the dropdown ever looks empty, the folder is empty or your .txt files don't match your image base names - the two most common failure modes, and both easy to check.

    No models, no downloads, just PIL/numpy. Install: ComfyUI Manager → "DJZ-Nodes", or clone + pip install -r requirements.txt. Whole-pack install, as always with this suite.

    CategoryDJZ-Nodes

    Inputs (5)

    NameTypeDefaultDescription
    prompt_folderCOMBO1 options: default
    seedINT00–4294967295
    modeCOMBO2 options: sequential, random
    num_imagesINT11–10
    blacklistoptSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    STRINGSTRING