Nodes/lf-nodes/Normal map check and repack
ComfyUI Node

Normal map check and repack

Check that an image is a tangent normal map in the stated layout, renormalise it, flip green between OpenGL and DirectX, rebuild Z, and report what was found. Raises past the invalid limit.

By lucafoscili·Created 2 years ago·Updated 5 days ago· 36
Normal map check and repack
  • image
  • mask
  • ui_widget
  • image
  • report
  • image_list
◄layoutxyz_rgb►
◄green_inopengl►
◄green_outopengl►
◄z_moderebuild_z►
◄max_invalid_share0.010►
Category✨ LF Nodes/Texture

Inputs (8)

NameTypeDefaultDescription
imageIMAGETangent-space normal map(s), stored values (not colour-managed).
layoutCOMBOxyz_rgbxyz_rgb: X red, Y green, Z blue. xy_ag: X alpha, Y green, no Z (swizzled two-channel maps).
green_inCOMBOopenglThe map's green convention: opengl (Y up the image) or directx (Y down).
green_outCOMBOopenglThe convention to write; green is flipped when it differs from green_in.
z_modeCOMBOrebuild_zrebuild_z: keep X,Y and rebuild Z on the forward hemisphere. normalize_xyz: scale the stored vector to unit length, keeping Z's sign.
max_invalid_shareFLOAT0.0100–1Largest share of checked pixels that may be invalid; above it the node raises.
maskoptMASKPixels to validate (above 0.5), such as UV coverage. Defaults to all; every pixel is repacked.
ui_widgetoptLF_COMPARE[object Object]—

Outputs (3)

NameTypeDescription
imageIMAGERepacked normal map batch: unit vectors as RGB in green_out's convention (alpha kept for xyz_rgb).
reportJSONlf.normal-map-repack.v1: shares of invalid, out-of-disc, facing-away, vanishing and renormalised pixels.
image_listIMAGEThe same normal maps as an authoritative list.