Complexity Mask to Denoise Min-Max
Stop your denoise map from ever going to black
- mask
- mask
The display name tells you exactly what this node does and why it exists: Complexity Mask to Denoise Min-Max. A complexity map - the grayscale heatmap of "how much texture is here" - is a great denoise driver until you look at its raw values. Pure black regions mean "denoise zero," and a denoise of zero means your flat sky isn't just stabilized, it's frozen: the refiner won't touch it at all, which can leave an odd seam between "rebuilt" and "untouched" areas. MaskGrayValueScaler rescales a mask so its gray values are clamped into a range you choose, keeping every region at least somewhat live.
How it works
The source logic is short. It takes the mask and maps it into the min_gray–max_gray band, with a multiplier controlling how much of that remap actually applies:
- mask - your input, typically the output of Image Complexity Map.
- multiplier (default 1) - the blend factor. At 1, the mask is fully rescaled to the min/max band. At 0, everything becomes
min_gray. Values between give you a partial pull. - min_gray (default 0) / max_gray (default 1) - the floor and ceiling for the output gray values.
One subtle behavior worth knowing: if you set min_gray greater than max_gray, the mask inverts. That's a documented trick for flipping a complexity map into a "flatness" map without an extra invert node. So a setup like min 0.8, max 0.2 turns "texture is bright" into "flat areas are bright."
Why you'd reach for it
It's the safety rail between the complexity map and the refiner's per-pixel denoise. The ETUR README's whole pitch for the Fusion Complexity Mask is "stabilize uniform areas to prevent color shifts and noise" - and "stabilize" is not "disable." Setting min_gray to something like 0.1–0.2 means your skies get a small but nonzero denoise budget: enough to keep the tile fusion smooth, not enough to let the model paint clouds into a clear sky. If you've ever seen banding or a hard line appear at the boundary between refined and unrefined areas, this is the node that softens that edge.
Installing 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" → TBG_Enhanced Tiled Upscaler & Refiner FLUX PRO, restart.
The family, so you don't get lost
TBG's mask menu has a few near-twins, and they're easy to mix up:
- Complexity Mask to Denoise (MaskToDenoiseInterpolator) - multiplies the mask by a single
denoisevalue. Simple, one knob. - Complexity Mask to Denoise Min-Max (this node) - remaps into a clamped band. Use this when you need a guaranteed floor so flat areas never fully freeze.
- Image Complexity Map - the source of both; it builds the raw complexity heatmap you're feeding in here.
Typical chain: Image Complexity Map → MaskGrayValueScaler (min_gray 0.1–0.2, max_gray 1.0) → refiner per-pixel denoise. And if you invert via the min>max trick, remember that inverts the scaling, not the multiplier - test with a preview node before committing a whole batch to it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| multiplier | FLOAT | 1.000–1 | — |
| min_gray | FLOAT | 0.000–1 | — |
| max_gray | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |