Nodes/MKRShift_Nodes/Preview Material
ComfyUI Node

Preview Material

An orbitable shader ball inside your graph

By criskb·Created 7 months ago·Updated 5 months ago· 0
Preview Material
  • base_color
  • normal
  • roughness
  • metalness
  • specular
  • height
  • ao
  • opacity
  • emissive
  • clearcoat
  • clearcoat_roughness
  • anisotropy
  • sheen_color
  • sheen_roughness
  • transmission
  • thickness
  • iridescence
  • iridescence_thickness
  • model_file
  • preview_info
preview_mesh
uv_scale1.00
roughness_default0.55
metalness_default0.00
normal_strength1.00
normal_convention
height_to_normal_strength6.0
emissive_strength1.00
alpha_mode
asset_labelmaterial_preview
advanced_settings_json
model_file

This is the flagship node of MKRShift Nodes' material family, and it's the one worth installing the pack for. x1PreviewMaterial takes your loose PBR maps - base color, normal, roughness, metalness, whatever you've derived - and assembles them into a real 3D material that you can orbit and inspect inside the node, via ComfyUI's built-in 3D viewer. No Blender round-trip, no exporting a test render and hoping. You see the material as a shader ball, lit, with the roughness and metalness actually responding.

The workflow that makes this valuable is the one the whole Surface branch is built around: derive maps with x1RoughnessMap / x1MetalnessMap / x1NormalMap, preview them here, and when it looks right, pack them with x1PBRPack. The preview step is where you'd otherwise be flying blind.

How it works

Under the hood it writes a self-contained .glb asset into ComfyUI/output/mkrshift/material_preview, then mounts ComfyUI's Load3D viewer in the node so you can orbit without leaving the graph. That file being self-contained matters: you can hand the output model_file path straight to a Preview3D node or any downstream consumer. The node is a builder, not a renderer - its real output is that .glb.

The input list is a full modern PBR surface: base_color, normal, roughness, metalness, specular, height, ao, opacity, emissive, clearcoat, clearcoat_roughness, anisotropy, sheen_color, sheen_roughness, transmission, thickness, iridescence, iridescence_thickness. Wire up any combination; unconnected slots fall back to the *_default values.

The controls that matter

  • preview_mesh - shader_ball, plane, or cube
  • uv_scale - repeats the texture coordinates on the mesh (useful when your maps are high-res and you want to see the tiling)
  • normal_convention - directx (default) flips the incoming green channel into glTF/OpenGL space; opengl passes it through. This is the single most important setting: glTF expects OpenGL-space normals, and an engine-style DirectX map fed in as opengl will look inverted. Leave it on directx for most external maps, switch to opengl for glTF-native ones or x1NormalMap output in OpenGL mode
  • height_to_normal_strength - converts your height map into supplemental preview normals (default 6.0)
  • alpha_mode - auto picks blend for soft transparency or mask for binary cutouts
  • advanced_settings_json - the power user's escape hatch: IOR, attenuation, anisotropy rotation, iridescence ranges, even displacement mode (off / height / normal / height_normal). Leave empty to keep the core PBR behavior

Outputs

Just two: model_file (the generated .glb path) and preview_info (a summary string). There's no image output because the preview is the node - the 3D viewer is mounted inline.

Installing it

ComfyUI Manager (search "MKRShift Nodes") or:

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

Restart. No model downloads, no ffmpeg. The 3D viewer is ComfyUI's built-in Load3D/Preview3D - if you've never used those, this is a gentle introduction since the node handles the mounting for you.

Where people get burned

The normal convention mismatch is the classic: a DirectX normal map fed as opengl renders with all the detail recessed, and it's easy to blame the node. If the shader ball looks "wrong in a lighting way," check normal_convention before anything else. And remember the exported .glb is what matters if you're handing off - the inline preview is fast feedback, but the file is the deliverable.

CategoryMKRShift Nodes/Surface/Preview

Inputs (30)

NameTypeDefaultDescription
preview_meshCOMBO3 options: shader_ball, plane, cube
uv_scaleFLOAT1.000.01–32
roughness_defaultFLOAT0.550–1
metalness_defaultFLOAT0.000–1
normal_strengthFLOAT1.000–8
normal_conventionCOMBO2 options: directx, opengl
height_to_normal_strengthFLOAT6.00–64
emissive_strengthFLOAT1.000–8
alpha_modeCOMBO3 options: auto, blend, mask
asset_labelSTRINGmaterial_preview
advanced_settings_jsonSTRING
model_fileSTRING
base_coloroptIMAGE
normaloptIMAGE
roughnessoptIMAGE
metalnessoptIMAGE
specularoptIMAGE
heightoptIMAGE
aooptIMAGE
opacityoptIMAGE
emissiveoptIMAGE
clearcoatoptIMAGE
clearcoat_roughnessoptIMAGE
anisotropyoptIMAGE
sheen_coloroptIMAGE
sheen_roughnessoptIMAGE
transmissionoptIMAGE
thicknessoptIMAGE
iridescenceoptIMAGE
iridescence_thicknessoptIMAGE

Outputs (2)

NameTypeDescription
model_fileSTRING
preview_infoSTRING