Nodes/ComfyUI Field/Field From Detail
ComfyUI Node

Field From Detail

Mask the Busy Parts of an Image, Not the Bright Ones

By jeremieLouvaert·Created 3 months ago·Updated 24 days ago· 1
Field From Detail
  • image
  • mask
◄radius0.005►
◄distributionuniform►
◄coverage0.50►

"Where is the picture busy?"

Field From Detail answers a question that every other mask-making approach in ComfyUI largely ignores: not what is in the image, and not where the edges are, but where the texture is. Hair, foliage, fabric weave, brickwork, gravel, a crowd at distance - the regions that eat a sampler's attention. It returns a mask that's bright where the image is locally complicated and dark where it's flat.

That's a genuinely different signal from a luma mask or a Canny edge map, and it's the one you want when you're deciding where to spend upscaling, where to apply grain or sharpening, or where a detail-oriented re-pass is actually worth running.

It's a standard deviation, not a high-pass

Here's the bit people get wrong, because the obvious implementation is wrong. The usual "detail" detector is a high-pass: |luma − blur(luma)|. It's one line of code and it looks fine in a demo. Its problem is that it's zero along the centre-line of every edge and through any uniform gradient, so a textured region doesn't come out as a solid bright area - it comes out as a mesh of thin dark lines floating over a slightly-less-dark background. As a mask, that's useless; you've masked the gaps between the details, not the details.

Field From Detail computes a true local standard deviation instead: the standard deviation of luma inside a local window, which is large over texture and small over flat areas, uniformly across the whole region. It's a tiny bit more expensive and it's the difference between a mask you can use and a mask you can only admire.

The declared range is (0, 0.5), not (0, 1). That's not an arbitrary choice - 0.5 is the maximum possible standard deviation of values in [0,1], so normalising against 1.0 would waste half the range.

The inputs

  • image - IMAGE, the source.
  • radius - default 0.005, range 0.001 to 0.2. This is a fraction of the longer frame edge, not a pixel count: 0.005 is roughly an 8-pixel neighbourhood at 1600 wide. It's the single control that decides what counts as "detail".
  • distribution - uniform (default) or native. uniform runs a rank transform so coverage means exactly what it says; native maps the raw standard deviation through its own declared range.
  • coverage - default 0.5, the fraction of the frame above the midpoint.

Output is mask. From here it goes into Field Combine (multiply it by a Perlin field so the selection is textured and irregular), Field Threshold (take the top 15% of detail), Field Composite (spend it on an image), or a sampler.

uniform is the default here, and there's a good reason: measured on a real photograph, the average local standard deviation moves with the radius. At radius 0.005 the median is around 0.048; at 0.02 it's 0.135; at 0.04 it's 0.190. If you used native, dragging the radius slider would double as a brightness control and coverage would be meaningless. With uniform, radius changes what you're measuring and coverage changes how much of it you select - two separate jobs.

Install

ComfyUI Manager, search ComfyUI Field, or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Field

Restart. No models, no extra packages - requirements.txt is empty because everything it needs (torch) is already in ComfyUI. Find it under AKURATE/Fields/Derive.

Where people get burned

Radius creep. The natural instinct is to crank the radius up until the mask looks smooth. Past about 0.02 you're looking at a 32-pixel sigma, and the field has stopped tracking the texture it was supposed to find - it's now blurry blobs that happen to sit near the textures. The author's own note is that the content is "already barely legible in the mask" at that point. If you want smoother output, threshold and feather it downstream rather than widening the radius.

Second, this node is a filter, not a generator, and the distinction has a practical edge: unlike Field Noise it can't probe a continuous field, so any statistic it needs comes from the pixels you handed it. That means results on a 512 crop and a 2048 render are not bitwise identical. It's the one place in the pack where the resolution-independence promise is approximate, and for a local-statistics operation that's unavoidable.

Third: hue, edge maps and local contrast all have this in common - they're derived from the picture, so if the picture changes, the mask changes. That's the feature. It's also why a workflow built around them needs the source image to be stable, not re-generated between runs.

CategoryAKURATE/Fields/Derive

Inputs (4)

NameTypeDefaultDescription
imageIMAGE—
radiusFLOAT0.0050.001–0.2—
distributionCOMBOuniform2 options: uniform, native
coverageFLOAT0.500–1—

Outputs (1)

NameTypeDescription
maskMASK—