Nodes/DJZ-Nodes/Zenkai IMP v1
ComfyUI Node

Zenkai IMP v1

Image, mask, and prompt triples — the boring-but-essential loader

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 80
Zenkai IMP v1
    • image
    • prompt
    • mask
    prompt_folder
    seed0
    mode
    num_images1
    blacklist

    Every inpainting or image-to-video workflow eventually hits the same wall: you have a set of reference images, each with its own description, and quite often its own mask. Zenkai IMP v1 exists to load all three at once - image, prompt, and mask - as a matched set, so you can batch a whole folder of shots through a detailer or an img2vid model without re-wiring anything between items. "IMP" is Image + Mask + Prompt, which is the entire pitch in one acronym.

    The node comes from the Zenkai side of DJZ-Nodes, Drift Johnson's prompt-and-dataset tooling. If you're building a dataset or a storyboard-style reference pack, this is the loader you'll reach for; if you just need one image with a prompt, it's overkill and a normal Load Image will do.

    How it works

    You organize imagemaskprompts/<folder>/ inside the pack directory with a strict naming convention. For each source image, three files share a base name:

    custom_nodes/DJZ-Nodes/imagemaskprompts/default/
      scene1.jpg      # the reference image
      scene1_M.jpg    # its mask (suffix "_M")
      scene1.txt      # its prompt
    

    The node lists subfolders as a prompt_folder dropdown, finds every valid image/text/mask triple, and sorts them naturally - so scene1 comes before scene10, which matters more than you'd think. Then mode decides how you walk the list: sequential maps the seed onto the list index (looping), random samples reproducibly. If a mask file is missing it silently substitutes a solid white mask, and if an image has no matching .txt, that pair is skipped entirely. Items without a mask are also fine - you get a full mask instead of an error, which is a forgiving choice for testing.

    The inputs that matter

    • prompt_folder - dropdown of imagemaskprompts/ subfolders; default is auto-created
    • mode - sequential (seed walks the list) or random (seeded sample)
    • num_images - batch size, 1–10, loaded into a single IMAGE tensor (images are padded to the largest dimensions if they don't match)
    • blacklist - optional comma-separated terms, quoted for multi-word phrases (e.g. cat, "no humans"), matched case-insensitively against the prompt text. Anything that matches is dropped from the pool before selection.

    Outputs: image (IMAGE), prompt (STRING), and mask (IMAGE) - all batched the same length, so num_images = 4 gives you four images, four joined prompts (separated by |), and four masks in lockstep. Wire image and mask into an inpaint or detailer pipeline and prompt into a text encoder, and the whole folder runs as one pass.

    Install

    ComfyUI Manager → search DJZ-Nodes, or:

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

    Restart ComfyUI. This node only needs Pillow, NumPy, and torch, which you already have - it's one of the lightest in the pack, with no ffmpeg or Video Helper Suite dependency. The imagemaskprompts/ folder (and a default/ subfolder) is created for you on first run.

    Troubleshooting

    Two gotchas to know about. First, the mask suffix is _M before the extension - scene1_M.jpg, not scene1_mask.jpg. Get that wrong and you'll silently get white masks, which usually look "fine" right up until your inpaint does nothing. Second, the pack's __init__.py silently skips nodes whose imports fail; if the node is missing entirely, check the console for "Unable to import Zenkai_IMPv1". The dropdown showing only default is normal - it's the auto-created placeholder folder until you add real ones.

    CategoryDJZ-Nodes

    Inputs (5)

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

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    promptSTRING
    maskIMAGE