ComfyUI Node

Complexity Mask to Denoise

One slider between a map and a per-pixel denoise

By Ltamann·Created about a year ago·Updated 19 days ago· 156
Complexity Mask to Denoise
  • mask
  • mask
denoise1.00

Some nodes are transformations; this one is a volume knob. Complexity Mask to Denoise takes a mask - usually a complexity map from Image Complexity Map - and multiplies every gray value by a single denoise number. That's the entire mechanism: the mask's pixels were already "how much should this region be reworked," and this node scales them all by one factor to turn the map into an actual per-pixel denoise value for the refiner.

The author's math, in their own words: denoise 1.0 = no change to the mask, denoise 0.0 = everything becomes a black mask. So the slider isn't "strength," exactly - it's the ceiling. At denoise = 0.3, no pixel can be denoised harder than 30%, which is the classic "stabilize everything, keep a little creative room" setting for a refinement pass.

The inputs

Two, both obvious:

  • mask - the per-pixel map. Bright regions (texture, edges) will get the most denoise; dark regions (flat areas) the least.
  • denoise (default 1.0, 0–1) - the multiplier applied to every pixel.

One MASK output. That's it. It's the little brother of MaskGrayValueScaler (Complexity Mask to Denoise Min-Max), which does the same job but lets you clamp into a min_graymax_gray band so flat areas never drop to a full zero. If you find yourself thinking "I wish this wouldn't fully zero out my skies," you want the Min-Max sibling instead of this one.

Where it fits

In ETUR's refinement model, per-pixel denoise is how you get "more detail where there's detail, less where there isn't." The README describes the per-pixel denoise mask as "allows input of a mask to control denoising per pixel, multiplied with the denoise value" - which is precisely this node's operation. The canonical chain is:

Image Complexity Map → MaskToDenoiseInterpolator (set your denoise ceiling) → the refiner's per-pixel denoise input.

A common starting point: denoise = 0.5 on a complexity map, then tune from there. If flat areas still come back noisy, drop the slider. If the whole image feels under-refined and lifeless, raise it - but remember that with the refiner's overall denoise also in play, this mask multiplies with that value. You're stacking two denoise controls; if you set both high, you've told the model to fully reimagine the image, and it will.

Installing it

It ships in the TBG ETUR pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Ltamann/ComfyUI-TBG-ETUR
cd ComfyUI-TBG-ETUR
pip install -r requirements.txt

Or ComfyUI Manager → search "TBG" → install TBG_Enhanced Tiled Upscaler & Refiner FLUX PRO, then restart ComfyUI.

Notes

This node is pure tensor arithmetic - no model, no resolution constraints, no gotchas beyond the math itself. The one thing worth repeating: denoise here is a ceiling multiplier, not a target. A complexity map where everything is already bright (overly detailed or noisy source) will still get high denoise everywhere even at a moderate slider, because 0.8 × 0.9 is still a lot. If your source is noisy to begin with, fix the source before you try to tune the mask - the map inherits the source's problems.

CategoryTBG/Helpers/Mask

Inputs (2)

NameTypeDefaultDescription
maskMASK
denoiseFLOAT1.000–1

Outputs (1)

NameTypeDescription
maskMASK