Opacity Map
Cutouts, decals, and soft transparency from your alpha
- image
- source_mask
- mask
- image
- mask
- opacity_info
Every material pipeline eventually needs a map that says "what's solid and what's see-through," and that's exactly what x1OpacityMap produces. Feed it an image with an alpha channel (or a mask) and it emits a clean grayscale opacity map - white is opaque, black is transparent - ready for a decal, a card, a cutout, or a soft-transparency material.
It's part of MKRShift Nodes' Surface/Maps family, and the author's docs point at the natural use case: it's a direct companion for the opacity slot on the pack's x1PreviewMaterial shader ball. Derive the map here, preview it there, then pack it into an ORMA texture with x1PBRPack.
The "combined_opacity" behavior (read this)
The default source_mode is combined_opacity, and the author made a deliberate, honest choice here: it prefers the input's alpha channel, falls back to a supplied source_mask, and if there's neither, it treats the surface as fully opaque. It will not guess transparency from color alone.
That last part is the design decision worth respecting. A node that auto-transparentizes anything dark is a trap - you'd get holes in every shadow. combined_opacity stays conservative because opacity maps should be driven by real alpha data, not inference. If you want transparency from brightness, set source_mode to luma or a channel and you're in charge of what reads as transparent.
The other inputs
Beyond source_mode, the family-standard controls apply:
normalize_mode-auto_percentile,manual_range, orauto_rangevalue_min/value_max,percentile_low/percentile_high- the normalization windowgamma,contrast,blur_radius- shape the result. Blur is the one to reach for on soft edgesinvert_values- flip opaque ↔ transparentdetail_radius/detail_strength- only relevant whensource_modeisdetail
Optional inputs are source_mask and mask: the former is the opacity source in mask mode (or the fallback for combined_opacity), the latter limits where the opacity map is emitted.
Outputs: image (the grayscale map), mask (the scalar as a MASK), and opacity_info (a string reporting the resolved source and normalization range - handy when combined_opacity quietly resolved to "opaque" because your image had no alpha).
Where this slots in
The cleanest workflow is: render a sprite or decal with alpha → x1OpacityMap → x1PreviewMaterial's opacity slot → check the cutout on the shader ball. If you're packing for an engine, x1OpacityMap output feeds the alpha slot of x1PBRPack's ORMA layout. The whole Surface/Maps family shares one normalization vocabulary, so the map you get here behaves like the ones from x1RoughnessMap and x1MetalnessMap.
Installing it
ComfyUI Manager, search "MKRShift Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
Restart and it's there. No requirements, no model files, no ffmpeg - pure numpy math. The usual caveat stands: the pack is a huge grab-bag, so you're installing a lot to reach one small family. If opacity/cutout work is a recurring need, the Surface branch plus x1PreviewMaterial is a genuinely useful combo that justifies it.
Where people trip
The most common "why is nothing transparent" moment is exactly the conservative fallback: your source has no alpha and no mask, so combined_opacity outputs solid white. Check opacity_info - if it says combined_opacity(opaque), that's the behavior doing its job, and you need to either supply a mask or switch source_mode to a channel you actually want to key on.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| source_mode | COMBO | 10 options: combined_opacity, alpha, red, green, blue, luma, +4 | |
| normalize_mode | COMBO | 3 options: auto_percentile, manual_range, auto_range | |
| value_min | FLOAT | 0.0000–1 | — |
| value_max | FLOAT | 1.0000–1 | — |
| percentile_low | FLOAT | 2.00–100 | — |
| percentile_high | FLOAT | 98.00–100 | — |
| detail_radius | FLOAT | 1.50.1–64 | — |
| detail_strength | FLOAT | 0.000–2 | — |
| gamma | FLOAT | 1.000.1–4 | — |
| contrast | FLOAT | 1.000.1–4 | — |
| blur_radius | FLOAT | 0.00–128 | — |
| invert_values | BOOLEAN | false | — |
| mask_feather | FLOAT | 8.00–256 | — |
| invert_mask | BOOLEAN | false | — |
| source_maskopt | MASK | — | |
| maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| opacity_info | STRING | — |