The PorterDuffImageComposite node needs both source_alpha and destination_alpha because it composites two images whose transparency may differ: one placed over the other. The node documentation identifies source_alpha and destination_alpha as the alpha channels of their respective images and types both inputs as MASK. The selected Porter-Duff mode determines how the source and destination are composited. The documentation does not specify a MASK value range or a numeric mapping from MASK values to transparency. The output is not just an IMAGE; the node also returns the resulting alpha as a MASK.
Match each image with its own alpha
Treat the inputs as two pairs: source with source_alpha, and destination with destination_alpha. The source is the image being composited over the destination; the destination is the backdrop. A single mask cannot describe both images’ transparency independently, which is why this node exposes two alpha inputs.
In this node’s documented interface, the alpha inputs are MASK and the images are IMAGE. Connect each mask according to what it represents, rather than choosing one because it is the only mask available in a nearby workflow. ComfyUI’s PorterDuffImageComposite documentation lists the two image inputs, their corresponding alpha inputs, a mode selector, and both output types.
Wire the node in order
- Choose the source IMAGE you want to composite and connect it to
source. - Connect a MASK describing that source image’s per-pixel transparency to
source_alpha. - Choose the backdrop IMAGE and connect it to
destination. - Connect a MASK describing the destination image’s transparency to
destination_alpha. - Select a
modeand inspect bothimageandmaskoutputs. The mode is part of the operation, so do not judge the result without noting which mode was selected.
This gives you a concrete wiring check before interpreting the visual result: each IMAGE should have its own corresponding alpha input, and the output MASK should be considered alongside the output IMAGE.
Inspect both outputs
The image output is the composited picture. The mask output represents the alpha channel of that composite, not a second version of the source mask and not a mask that necessarily marks only the source’s contribution. Keep it available when a downstream step needs the composite’s transparency; inspect the IMAGE as well when judging its visible appearance.
For a practical check, confirm that each alpha input is paired with its intended image, then inspect the composite IMAGE and output MASK. The documentation identifies the output MASK as the alpha channel of the composited image, but does not prescribe a particular viewer or downstream interpretation.
Diagnose a hypothetical test
This is a hypothetical wiring worksheet, not a measured result or a prediction of pixel values. Suppose the workflow intends to composite a cut-out subject over a colored backdrop. Record whether each connected alpha input is the one intended for that image, note the selected mode, and inspect the IMAGE and MASK outputs:
| Check | Hypothetical record | What to verify |
|---|---|---|
| Source pair | source and its intended source_alpha are connected | The source alpha input is paired with the source image |
| Destination pair | destination and its intended destination_alpha are connected | The destination alpha input is paired with the backdrop image |
| Mode | Record the selected option by name | Interpret the operation using the selected mode |
| Outputs | Inspect image and mask | Check the composite image and the documented composite-alpha output |
If the result looks unexpected, confirm the documented input pairings and selected mode, then inspect both outputs. This checks wiring and output interpretation without assuming a numeric MASK-to-transparency mapping or predicting a mode's pixel calculation.
Know when another node fits better
Do not substitute ImageCompositeMasked as though it had the same contract. Its documented inputs include a destination, a source, placement coordinates, a source-resize option, and one optional mask that limits which source parts are composited. That differs from Porter-Duff compositing, which takes separate alpha inputs for both images and returns a composite MASK. See the ImageCompositeMasked documentation when your task is positioned source placement with an optional source mask.
The documentation does not specify mask-generation steps, required mask dimensions, numeric ranges, or a mode-by-mode formula. Do not assume those details from the port names alone. If a connection is rejected or the result is unclear, inspect the upstream node types and your selected mode, then consult the relevant node documentation or workflow details before changing mask values.
Common questions
Can I use the same MASK for both alpha inputs?
Only if that same mask correctly describes the transparency of both images for your intended composite. The node exposes separate inputs so the two images can have independent alpha information; it does not require the masks to differ.
Is `source_alpha` the same as `ImageCompositeMasked`’s `mask`?
Not by interface contract. Porter-Duff uses an alpha input for each image. ImageCompositeMasked documents one optional mask for selecting which source parts are composited.
Why inspect the output MASK if I only need a picture?
You may focus on the IMAGE for a fully opaque final use, but the output MASK tells you the composite’s resulting alpha. Check it when transparency matters to a later node or deliverable.
Sources and next step
- PorterDuffImageComposite - ComfyUI Built-in Node Documentation
- ImageCompositeMasked - ComfyUI Built-in Node Documentation
This guide interprets public documentation and uses explicitly hypothetical acceptance examples, not application tests. Controls and availability can change; verify the cited manual against your installed version.
For work created in Imagild, carry the input requirements and acceptance checklist into the photo editor. The external software controls discussed above belong to their respective products.