H3 Batch Pictures
Keep <Picture 1> from quietly becoming <Picture 3>
- pictures
- IMAGE
- reference_roles
MiniMax H3 doesn't take a pile of reference images and figure out what to do with them. It takes tags - <Picture 1>, <Picture 2> - and your prompt has to cite those tags correctly. H3 Batch Pictures exists so the number on the socket is the number in the prompt, instead of you joining images into a batch and hoping index 0 is still the woman and not the jacket.
That's the whole job. It's a small node, and the smallness is the point: H3's reference conditioning is basically the video-model version of what IP-Adapter did for stills - one image per role, each one doing a specific job - and the failure mode is never "the model ignored my reference", it's "the model used my reference for the wrong thing."
How it actually works
The node exposes one input to start and grows more as you connect them - up to nine sockets, named <Picture 1> through <Picture 9>. Whatever you plug in lands in the output batch in socket order, so batch index 0 is <Picture 1>, index 1 is <Picture 2>, and so on down the line.
It will not let you skip a rung. Connect <Picture 1> and <Picture 3> while leaving 2 empty and it raises: "H3 Batch Pictures: <Picture 2> empty. Fill the gap so batch order matches the picture tags." That's deliberate. A hole in the middle would shift every label after it, and you'd spend an hour wondering why H3 dressed your character in picture 3's jacket.
Under the hood it just calls ComfyUI core's batch_images, which means the images get concatenated into a single IMAGE tensor. That has one consequence you need to know about, covered below.
The inputs you actually set
pictures is the autogrowing socket group, and roles is the one field a beginner should not skip. It's one line per picture, in socket order, saying what that picture supplies - the author's own example is "identity of the woman, her red jacket." Blank lines are fine; leave the line empty and the numbering still holds.
first_frame and last_frame are annotations, not conditioning. Tick first_frame and <Picture 1> gets tagged as the first frame of the target video; tick last_frame and the last connected picture gets tagged as the last frame. The tooltip is explicit that you also have to anchor those frames for real with Add Guide for MiniMax H3 at frame_idx 0 and frame_idx -1. Reading that as "the node does the anchoring" is the easy misread here.
Outputs
IMAGE is the batch - wire it to H3's reference-image input on the sampler side. reference_roles is the formatted text version of what you typed, one line per picture, shaped like <Picture 1> (batch index 0): identity of the woman, with the first/last frame notes folded in. That goes into H3 Codex Promptor's reference_roles input, with the same batch on reference_images.
Here's the fine print the tooltip buries: the promptor numbers its pictures as first frame, then last frame, then reference images in batch order. So if you also wire a first or last frame on the promptor, this node's labels are off by one or two. Keep first_frame/last_frame disconnected there and the numbering lines up; otherwise adjust your expectations, not the labels.
Install
It ships in TrentNodes, so you get the whole pack whether you want the lip sync suite or not. In ComfyUI Manager, search for "Trent Nodes" and install. Command line:
cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt
Restart ComfyUI after. The node lives under Trent/MiniMax, alongside the H3 chain and promptor nodes. It needs no models and no API key.
Two install notes. That requirements.txt installs for all the pack's nodes - vosk, psd-tools, transnetv2-pytorch, anthropic, openai, google-genai and friends. This node uses nothing but ComfyUI internals, so if it's the only one you want, skip the pip step and just restart. If you do run it, expect a slow install and the usual dependency-pin friction - the standard custom-node tax, not anything Trent-specific.
The other note: the node is written against ComfyUI's v3 schema (io.Autogrow), newer than most of the ecosystem. On an older ComfyUI it may not register at all. Update ComfyUI before you start troubleshooting.
Where people get burned
Mixed sizes. batch_images resizes every picture to the first picture's dimensions, cover-cropping to center rather than stretching. A 1024×1024 character sheet at <Picture 1> will crop the edges off a 16:9 environment shot at <Picture 2>. Feed pictures of the same shape, or resize upstream yourself and keep control of the crop.
Batch order is the contract. There's no per-socket prompt text - the tag lives in your H3 prompt and nowhere else. If the prompt says <Picture 2> supplies the jacket, picture 2 had better be the jacket on every rerun. A folder whose sort order shifts between queues will quietly break this.
Nine sockets, not unlimited. Past nine references you're back to hand-building a batch - and H3 gets muddier with each extra picture long before that.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pictures | COMFY_AUTOGROW_V3 | — | |
| roles | STRING | One line per picture, in socket order: what each picture supplies, e.g. identity of the woman, her red jacket. | |
| first_frame | BOOLEAN | false | <Picture 1> is the first frame of the target video. Also anchor it with Add Guide for MiniMax H3 at frame_idx 0. |
| last_frame | BOOLEAN | false | The last connected picture is the last frame of the target video. Also anchor it with Add Guide for MiniMax H3 at frame_idx -1. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| reference_roles | STRING | Connect to H3 Codex Promptor reference_roles, with this batch on reference_images. Labels assume no first_frame/last_frame is connected there. |