AQ_MasksAndImagesAsList
Split a mask+image batch into per-item lists for multiface PuLID
- masks
- images
- images
- masks
- count
A plumbing node, and an important one in this pack. It takes batched masks and images and splits them into Python lists so AQ_multiface_ApplyPulidFlux can process each face reference separately. That's its only job - but it exists because the multiface PuLID flow needs it.
Why it exists
PuLID Flux applies identity from a reference face, and the multiface flow in this pack wants one image per face, each with its own attention mask. A single IMAGE/MASK batch can't cleanly express "these three faces each have their own region" - so this node converts batch → list, keeping the image/mask pairs in order. The author's own comments in the source say to feed it the output of SEGSToMaskList / SEGSToImageList style converters (from a detection/segmentation workflow), which is why the inputs are marked forceInput.
How it works
It's marked INPUT_IS_LIST, so it receives lists rather than single tensors. It zips masks and images together, truncates to the shorter length if they mismatch (with a warning printed to the console), makes 2D masks 3D, and returns the two lists plus a count.
Inputs
masks- MASK (forceInput).images- IMAGE (forceInput).
Outputs
images- IMAGE_LIST, one per item.masks- IMAGE_LIST, matching.count- STRING, the number of pairs (it's a string, not an int, if you want to loop with it).
Install
Part of AQnodes:
cd ComfyUI/custom_nodes
git clone https://github.com/2frames/ComfyUI-AQnodes
cd ComfyUI-AQnodes
pip install -r requirements.txt
or search "AQnodes" in ComfyUI Manager and restart.
Gotchas
If the number of masks and images differs, it silently truncates to the shorter one and prints a warning - mismatched pairs just drop, so check the console if a face mysteriously goes missing. And while it's generic, its real purpose is feeding AQ_multiface_ApplyPulidFlux; outside that flow you probably don't need it. The pack's requirements also drag in the full face-analysis stack (insightface, onnxruntime-gpu, facexlib, segment-anything) whether or not you touch PuLID, because the pack imports everything at load.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| images | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE_LIST | — |
| masks | IMAGE_LIST | — |
| count | STRING | — |