ComfyUI Node
BD Luma Stats
Measure luminance statistics of an image within an optional mask. Image passes through unchanged. Place inline in the grey-source pipeline to verify BD_NormalizeLuma + BD_CenterMedianLuma are hitting their targets: min_luma → should ≈ NormalizeLuma low_point max_luma → should ≈ NormalizeLuma high_point median → should ≈ CenterMedianLuma target_center recommended_outer_band = (max−min)/2 × 0.90 Paste this directly into u_float2 in BD_GLSLBatch.
BD Luma Stats
- image
- mask
- image
- min_luma
- max_luma
- median_luma
- mean_luma
- recommended_outer_band
◄luma_standardbt709►
Category🧠BrainDead/Segmentation
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image. Passed through to the image output unchanged. | |
| luma_standard | COMBO | bt709 | RGB → luminance weighting: bt709 (default): 0.2126 R + 0.7152 G + 0.0722 B — modern sRGB/Rec.709 standard. Use for Unity/Unreal, AI pipelines, modern display work. bt601: 0.299 R + 0.587 G + 0.114 B — legacy NTSC weights, matches Photoshop 'Desaturate' and older tools. average: (R+G+B)/3 — simple, not perceptual. |
| maskopt | MASK | Optional region mask. When connected, stats are computed only from pixels where mask > 0.5. Strongly recommended: use your skin mask so background and clothing don't bias the measurements. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Pass-through — image is unchanged. |
| min_luma | FLOAT | Darkest pixel luma in the masked region. Should ≈ BD_NormalizeLuma low_point (e.g. 0.10). |
| max_luma | FLOAT | Brightest pixel luma in the masked region. Should ≈ BD_NormalizeLuma high_point (e.g. 0.90). |
| median_luma | FLOAT | Median luma. Should ≈ BD_CenterMedianLuma target_center (e.g. 0.50). |
| mean_luma | FLOAT | Mean luma. Compare with median — large gap means a skewed distribution. |
| recommended_outer_band | FLOAT | (max−min)/2 × 0.90. Paste into u_float2 in BD_GLSLBatch. The ×0.90 factor ensures the extreme ~10% of pixels exceed the outer band and reach V-curve alpha=1.0, giving the shader visible shadow/highlight depth. |