Nodes/ComfyUI_Lam/多IPAdapter遮罩控制
ComfyUI Node

多IPAdapter遮罩控制

Mask-limited IP-Adapter, several references at once

By yanlang0123·Created 2 years ago·Updated 11 days ago· 77
多IPAdapter遮罩控制
  • body_masks
  • image0
  • image1
  • IPADAPTER_PARAMS

MultiIPAdapterRegional ("多IPAdapter遮罩控制", multi-IPAdapter mask control) builds IP-Adapter parameters that let you apply several reference images at once, each confined to its own mask. You give it a batch of masks and a set of reference images, and it returns an IPADAPTER_PARAMS bundle with per-image weights, mask attachments, and start/end timings - ready to feed into an IP-Adapter apply node.

The mental model: IP-Adapter injects image embeddings through its own cross-attention path, so a reference picture steers style or identity without touching your text prompt. It's the "no-training identity/style" tool - a 100MB adapter where a fine-tune would cost you a LoRA. What this node adds is regionality: by attaching an attention mask (attn_mask) per image, each reference only influences its own part of the canvas. One character's face from reference A, another's from reference B, same image. That's the SD 1.5/SDXL-era power move, and it's genuinely what this node is for.

How it works

It collects your wired image0, image1, ... into a list, pairs them with the body_masks batch by index, and reads per-slot settings (weight, weight type, start, end) from the node's saved canvas values. The result is a structured IPADAPTER_PARAMS dict - image, mask, weight, weight_type, start_at, end_at per entry - which is the exact shape cubiq-style IP-Adapter apply nodes consume. It doesn't run the adapter itself; it's a parameter builder, and the apply node downstream does the injection.

That means the output only works if you have an IP-Adapter pack installed (the IPADAPTER_PARAMS type comes from that ecosystem), plus the IP-Adapter model files for your checkpoint. If those aren't already in your setup, this node's output has nowhere to go.

The inputs and outputs

  • body_masks (MASKS) - one mask per reference, limiting where each applies.
  • image0, image1, ... (IMAGE) - the reference images.
  • Output: IPADAPTER_PARAMS - wire into an IP-Adapter apply node.

Installing it

From ComfyUI_Lam: Manager → "ComfyUI_Lam", or:

cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam

Restart, lam category. But plan for the real install: you also need an IP-Adapter node pack and its models. The KB's honest position on IP-Adapter is that it still owns image prompting inside SD 1.5/SDXL workflows - which is exactly the era this node targets - while Flux-era jobs route the same work through Redux/PuLID. On a modern base, this node may have nothing to drive.

Common issues

Masks and images must line up by index - mismatch them and references get attached to the wrong regions. Tiny masks starve the adapter (not enough context to inject), and overlapping masks let two references fight over the same pixels. Also remember the license corner: IP-Adapter itself is Apache 2.0, but the FaceID line carries research-only terms. This node is generic enough to push either - know which weights you loaded.

Pack caveats: Chinese-language node, tiny community footprint, and the README's heavy install is for the pack's other nodes. On uninstall, delete ComfyUI/web/extensions/lam to clear the leftover frontend popup.

Categorylam

Inputs (3)

NameTypeDefaultDescription
body_masksMASKS
image0IMAGE
image1IMAGE

Outputs (1)

NameTypeDescription
IPADAPTER_PARAMSIPADAPTER_PARAMS