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

Zenkai Image Prompt V1

Load image + prompt pairs from a folder, by seed

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

    Zenkai Image Prompt V1 is the entry point to DJZ-Nodes' Zenkai system, which is basically Drift Johnson's way of turning organized folders into workflow inputs. This node reads a directory of images where each image has a matching .txt file containing its prompt, and serves them up - deterministically, by seed - as an IMAGE plus its STRING prompt. Batch processing a dataset, doing img2img variations, or feeding a training pipeline? One node, and the whole folder becomes your queue.

    The idea is simple and it's genuinely handy: instead of hand-wiring an image loader and a text node per image, you keep pairs on disk and let the seed pick for you.

    How it works

    Everything lives in the pack's imageprompts/ folder (inside custom_nodes/DJZ-Nodes/). The prompt_folder dropdown is built by listing the subdirectories there, and on a fresh install the node auto-creates an empty default subfolder so the dropdown is never empty. Inside a chosen subfolder you drop image files (jpg, jpeg, png) and, for each one, a .txt file with the same base name - scene01.png pairs with scene01.txt. The node finds those pairs, applies any filtering, then selects from them:

    • mode: sequential - seed walks through the sorted folder index, looping when it hits the end. Same seed, same image, reliably.
    • mode: random - seed-seeded random pick, so it's reproducible and varied.
    • num_images (1–10) - how many pairs to load; they're batched into the output.

    The optional blacklist (a comma-separated list, phrases in quotes like "no humans") drops any prompt containing a blacklisted term before selection - handy for keeping certain content out of a batch run.

    Outputs are IMAGE (the selected image(s)) and STRING (the matching prompt(s), joined with | when there are several).

    What you'd actually do with it

    Img2img variation is the obvious one: pair reference images with prompts, plug the IMAGE into a VAE encode, the STRING into your CLIP/text-encode node, and step the seed to march through your whole set. It also slots into the pack's batch philosophy - pair it with a batch range or offset node and you can chew through a folder deterministically.

    Installing it

    Standard DJZ-Nodes install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/DJZ-Nodes
    cd DJZ-Nodes
    pip install -r requirements.txt
    

    Restart ComfyUI, or search "DJZ-Nodes" in ComfyUI Manager. First run creates imageprompts/default/ for you.

    Troubleshooting

    • Dropdown only shows "default" (empty). Correct - the pack ships no imageprompts content. You populate it: custom_nodes/DJZ-Nodes/imageprompts/<your-category>/. Restart to refresh the dropdown.
    • Nothing loads. Your pairs are mismatched - every image needs a .txt with the exact same base name, or it's not a valid pair. Unpaired images are ignored, not loaded.
    • Blacklist nukes everything. If every prompt contains a blacklisted term, the node returns an error string ("No valid pairs remaining after blacklist filtering") and an empty tensor instead of crashing. Loosen the list.
    • Prompts come back with " | " separators. That's by design when num_images > 1 - the prompts are joined. If your downstream text node needs one prompt, keep num_images at 1.

    It's a low-key utility, and honestly the Zenkai system shines brightest when you use several of its nodes together. On its own it replaces a loader + text node with one seeded node, which is a small but real workflow win.

    CategoryDJZ-Nodes

    Inputs (3)

    NameTypeDefaultDescription
    prompt_folderCOMBO1 options: default
    seedINT00–4294967295
    blacklistoptSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    STRINGSTRING