Nodes/MKRShift_Nodes/Iridescence Map
ComfyUI Node

Iridescence Map

Fake the oil-slick sheen as a grayscale mask

By criskb·Created 7 months ago·Updated 5 months ago· 0
Iridescence Map
  • image
  • source_mask
  • mask
  • image
  • mask
  • iridescence_info
source_mode
normalize_mode
value_min0.000
value_max1.000
percentile_low2.0
percentile_high98.0
detail_radius2.0
detail_strength0.10
gamma1.00
contrast1.15
blur_radius0.0
invert_valuesfalse
mask_feather8.0
invert_maskfalse

Iridescence - the soap-bubble, oil-slick, beetle-shell color play that shifts with viewing angle - is one of those materials that's surprisingly hard to fake in a renderer because it needs a mask telling you where the effect lives. Iridescence Map is the MKRShift node that derives that mask (plus a scalar map) straight from an image: point it at your material render or texture, and it hands you a grayscale map of where the iridescent shimmer should sit, normalized and ready to wire into a roughness, tint, or mask slot.

It lives in MKRShift Nodes/Surface/Maps, the pack's tech-art lane alongside x1Heightmap. Same DNA: pull a scalar out of pixels, normalize it, output as a map. The difference is which scalar, and that's the interesting part.

How it works

Iridescence reads as color variation across small areas - the hue shifts locally, so the node looks for regions of rapid, fine color change. The default source_mode, combined_iridescence, combines that local chroma-detail signal with saturation and value, so you get the places where color is both vivid and unstable. The other modes let you cheat toward a specific driver: saturation, value, luma (plain scalar choices), detail (edge/contrast energy - catches the glints and micro-highlights where sheen usually lands), and mask (use an existing mask as the source).

The detail-derived signal has two knobs: detail_radius (2.0) sets the neighborhood the node looks across for color variation, and detail_strength (0.1) weights how much that fine detail contributes versus the flat color terms. Then the standard map pipeline takes over: normalize_mode (default auto_percentile, the stable choice), contrast (1.15 - punch the map so sheen regions actually read), gamma, blur_radius, invert_values. Optional source_mask restricts analysis, mask scissor-limits the output.

Outputs and how to use it

You get the grayscale image map, a mask of the same values, and an iridescence_info string with the resolved source and range. Where it goes next is up to your pipeline: multiply it into an RGB tint for an oil-slick overlay, feed it as a mask to a color-shift node, or drive a roughness channel - the map is normalized, so it behaves like any other scalar mask you'd hand a material node.

The honest caveat: this derives a plausible iridescence placement from what's already in the pixels. If your render is flat and colorless, there's no local chroma variation to find and the map will come out weak - add some color noise or glints to the source first. It's a detector-plus-map, not a generator.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

then restart, or search MKRShift_Nodes in ComfyUI Manager. No pip requirements, no model files.

If the map looks like noise, you've got detail_strength too high or detail_radius too small - raise the radius so the detail detector averages over a real surface area instead of per-pixel static. That one knob pair is responsible for 90% of "why does this look like TV static" moments.

CategoryMKRShift Nodes/Surface/Maps

Inputs (17)

NameTypeDefaultDescription
imageIMAGE
source_modeCOMBO6 options: combined_iridescence, saturation, value, luma, detail, mask
normalize_modeCOMBO3 options: auto_percentile, manual_range, auto_range
value_minFLOAT0.0000–1
value_maxFLOAT1.0000–1
percentile_lowFLOAT2.00–100
percentile_highFLOAT98.00–100
detail_radiusFLOAT2.00.1–64
detail_strengthFLOAT0.100–2
gammaFLOAT1.000.1–4
contrastFLOAT1.150.1–4
blur_radiusFLOAT0.00–128
invert_valuesBOOLEANfalse
mask_featherFLOAT8.00–256
invert_maskBOOLEANfalse
source_maskoptMASK
maskoptMASK

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
iridescence_infoSTRING