Field From Image
Nine Ways to Turn a Picture Into a Mask
- image
- mask
The boring node that unlocks everything else
This is the simplest node in the pack and probably the one you'll wire up first, because it's the bridge between "an image I have" and "a field I can do maths with". Give it a picture, pick a channel, get a MASK. That's it. It's what lets you multiply a Perlin field by the sky, or apply an effect only to the red dress, or build a mask out of saturation because the subject is the one vivid thing in the frame.
Nine channels: luma709 (the default, the Rec. 709 perceptual luminance), luma601 (the older Rec. 601 weighting), red, green, blue, hue, saturation, value, and min_rgb. The last few are HSV components, which is where it gets interesting - luma is what you reach for when you mean "brightness", saturation when you mean "colourfulness", and min_rgb when you mean "how far from a saturated primary", which is a decent cheap chroma detector.
The one setting that isn't obvious
distribution, defaulting to native. That default is the opposite of most of the pack, and it's deliberate: luma from a photograph is already a well-scaled quantity. Running the rank transform on it would be histogram equalisation, which is a different operation with a different name, and you'd have to un-learn it.
So: native gives you the pixel values as they are. uniform gives you the rank-transformed version, where coverage means exactly "the brightest N% of the frame" regardless of the image's histogram. Both are useful. coverage defaults to 0.5 and is a no-op at that value.
The reason native is the right default shows up the moment you try to use it as a mask. "Mask the highlights" means the pixels that look bright, and luma already orders them. Switching to uniform is what you want when the image is badly exposed and you need a fixed fraction of the frame rather than an absolute level.
How to use it
Output is a single mask. Straight into Field Composite and it's a luminance blend. Into Field Threshold with band mode and it's a tone-selective mask. Into Field Combine multiplied by noise and the effect now happens on bright regions and only where the noise says so - which is the exact retrofit pattern this pack was built around.
Colour is read display-referred, with no linearisation, for the same reason Field Composite blends in display space: masks in this pack are supposed to mean what looks bright, not what the physics says is bright.
The input
Just image and the three widgets above. There's no reference here - this node is the reference for everything downstream. Feed it at whatever resolution you're working at; because it's a filter rather than a generator, the field inherits the image's exact dimensions, so anything you wire after it lines up without a resize.
Install
ComfyUI Manager → search ComfyUI Field, or:
cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Field
Restart. No dependencies beyond the torch ComfyUI already provides, no model downloads. It lives under AKURATE/Fields/Derive.
Gotchas worth knowing
hue is a circular quantity flattened into a linear mask, so it has a hard seam where the colour wheel wraps through red. This isn't hidden or half-fixed - it renders as its correct one-pixel blend - but it means a threshold anywhere near that seam will produce a stripe in your mask. The right partner is Field Threshold's band mode aimed away from the wrap.
min_rgb and saturation look similar and aren't. On a pastel subject min_rgb stays high (there's a lot of all three channels) while saturation can be middling; on a dark saturated colour both are low. If you're isolating a vivid object, saturation is usually the one that survives a change of lighting.
And the ordinary one: this node wants IMAGE. If your mask came from a ControlNet preprocessor, a background remover or a save-as-PNG alpha channel, convert it (Image To Mask) before it gets here - this node is for going the other direction.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| channel | COMBO | luma709 | 9 options: luma709, luma601, red, green, blue, hue, +3 |
| distribution | COMBO | native | 2 options: native, uniform |
| coverage | FLOAT | 0.500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |