Zenkai IMP v1
Image, mask, and prompt triples — the boring-but-essential loader
- image
- prompt
- mask
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;defaultis auto-created - mode -
sequential(seed walks the list) orrandom(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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_folder | COMBO | 1 options: default | |
| seed | INT | 00–4294967295 | — |
| mode | COMBO | 2 options: sequential, random | |
| num_images | INT | 11–10 | — |
| blacklistopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| prompt | STRING | — |
| mask | IMAGE | — |