Nodes/MKRShift_Nodes/Thickness Map
ComfyUI Node

Thickness Map

Thickness maps from flat images — the subsurface secret ingredient

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

A thickness map is the thing that tells a renderer how much light scatters through a material - thick areas glow warmly, thin areas like ears and nose tips let light punch through. It's the map everyone forgets until their character looks like plastic and the ears look solid. Thickness Map derives one from a plain image, which is the classic trick: you don't have a 3D model's distance data, so you approximate thickness from the image's values and channels. It's the difference between subsurface scattering that looks like skin and SSS that looks like a glow filter.

How it works

This is one of the pack's "real widget" nodes - actual dropdowns and sliders, no JSON editing. The source_mode dropdown picks what the map is derived from: combined_thickness (the default, blends value and luma into a plausible thickness), inverse_luma, luma, value, alpha (if your image has alpha, thin = transparent), detail (edge/contrast-based thickness), and mask (build the map from a supplied source_mask). The key mental model: in a thickness map, bright = thick, so inverse_luma is often the most intuitive starting point - bright highlights become thin regions.

Then normalize_mode controls the tone curve: auto_percentile (stretch so the 2nd–98th percentile maps to full range - the safe default that resists outliers), auto_range (simple min-max), or manual_range with explicit value_min/value_max. gamma and contrast shape the response, detail_radius/detail_strength add a high-frequency pass for skin pores and texture, blur_radius smooths, and invert_values flips the map. Optional source_mask feeds the mask source mode; optional mask restricts the whole operation to a region.

The inputs that matter

  • source_mode - where the thickness comes from (start with inverse_luma or the default combined_thickness)
  • normalize_mode - leave on auto_percentile unless you have a reason not to
  • gamma / contrast - the tone shaping that actually sells the map
  • invert_values - flip when your renderer expects the opposite convention

Outputs: image (grayscale map as RGB), mask (single channel), and thickness_info logging source mode, the actual normalized range, and mask coverage.

Installing it

Ships in MKRShift Nodes from criskb. ComfyUI Manager → "MKRShift Nodes", or:

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

Restart ComfyUI; it's under MKRShift Nodes → Surface → Maps. No models or extra deps - numpy/Pillow/torch. The README's ffmpeg/slicer notes are for other lanes of the pack.

Common gotchas

The pack has no community footprint yet, so trust the source. Unlike the pack's JSON-configured nodes, this one gives you real widgets - which means no JSON-parsing traps, but also more ways to get a subtly wrong map. The classic mistake is convention confusion: some renderers want bright = thick, others bright = thin. If your SSS looks inverted, that's invert_values, not a broken node. And auto_percentile's 2–98 default is there to stop a single hot highlight from blowing out the whole map - keep it unless you have a reason to flatten the range.

CategoryMKRShift Nodes/Surface/Maps

Inputs (17)

NameTypeDefaultDescription
imageIMAGE
source_modeCOMBO7 options: combined_thickness, inverse_luma, luma, value, alpha, detail, +1
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.150–2
gammaFLOAT1.000.1–4
contrastFLOAT1.100.1–4
blur_radiusFLOAT0.00–128
invert_valuesBOOLEANfalse
mask_featherFLOAT8.00–256
invert_maskBOOLEANfalse
source_maskoptMASK
maskoptMASK

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
thickness_infoSTRING