Field Combine
The Mask-Math Node You'll Reach For More Than You Expect
- a
- b
- mask
Two masks walk into a node
If you've only ever used masks as black-and-white cutouts, Field Combine sounds useless - what's multiply between two binary images? The catch is that the whole ComfyUI-Field pack treats a MASK as a continuous 0–1 grayscale field, not a cutout. Noise, distance falloff, local contrast, edge magnitude, gradient ramps - they all come out of the pack as soft, real-valued masks. Once masks have values, "combine two of them" becomes arithmetic, and arithmetic is how you build masks that respond to more than one thing at a time.
Field Combine is the node that does that arithmetic. It takes two MASK inputs, applies one of eight operations, then dials the result back toward the first input with blend.
Why you'd reach for it
The pack's own framing is the "retrofit" idea: you have an effect that runs everywhere, and you want it to run only where the picture is interesting and only in a randomized pattern. That's a Perlin field multiplied by an edge field. Neither input alone says what you mean; the product does. Same trick works for combining a depth-ish falloff with noise so the blend edge isn't a clean line, or intersecting two detection masks so only the overlap gets re-rendered.
This is plumbing in the purest sense - it touches no pixels, it just decides where pixels get touched later. The classic use in a detailing or inpainting chain is upstream of a denoise: build the region with Field Combine, hand it to the sampler as a mask.
The eight operations, briefly
multiply is the default and the one you'll use most - it's an AND, and it's soft. screen is the soft OR. min and max are the hard versions of the same two ideas. add sums and clamps, difference is |a − b|, average is the midpoint, and subtract is literally a − b, so direction matters: swapping the wires gives you a different mask.
Worth knowing what's not here. There's no overlay, no soft light. That's deliberate - those are contrast operations, and the author routes contrast through Field Remap instead. So if you're looking for the blend-mode menu from Photoshop, half of it lives in another node.
Inputs and outputs that matter
aandb- both MASK.ais the reference: the output always matches its width, height and, where possible, batch.operation- the eight listed above, defaultmultiply.blend- 0 returnsa, 1 returns the raw operation result. It's a true lerp, so 0.5 splits the difference. Default is 1.
One output: mask. Wire it into a sampler's mask input, an ImageCompositeMasked, Field Threshold, Field Morphology, or another Field Combine.
Two behaviours worth remembering. If b is a different size, it's resized bilinearly and ComfyUI prints a note in the console - check that note, because a silent resize is exactly how a mask ends up subtly misaligned with the image it's meant to gate. And if the batches differ at all, a batch-1 input is expanded to match the other, but a genuine batch-3 vs batch-5 mismatch raises rather than guessing.
Install
Nothing special. Via ComfyUI Manager, search for the pack title ComfyUI Field, or from the command line:
cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Field
Restart ComfyUI. The pack's requirements.txt contains no packages - it needs only torch, which ComfyUI already ships - so there's no pip step and no chance of this node dragging your environment into a dependency fight. Nodes land under AKURATE/Fields/Combine.
Where it goes wrong
The most common confusion is type, not logic. Field Combine wants MASK. If you've got an IMAGE - a depth map from a ControlNet preprocessor, a hand-painted alpha - you need to convert it first (Image To Mask, or run it through Field From Image / Field From Edges). Wiring an image into a mask socket is a red box, not a wrong-looking result, so at least it's honest.
Second: subtract and difference are not the same thing, and people reach for subtract when they want symmetric exclusion. For "in one mask but not the other", difference is almost always what you meant.
Third, a quiet one: multiply of two soft masks shrinks coverage faster than you'd expect. A field at coverage 0.5 times another at 0.5 gives you roughly a quarter of the frame, not half. If the result is too thin, that's not a bug - use screen or average, or raise coverage on the inputs.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| a | MASK | — | |
| b | MASK | — | |
| operation | COMBO | multiply | 8 options: add, subtract, multiply, screen, min, max, +2 |
| blend | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |