Nodes/ComfyUI-Apt_Preset/texture_render
ComfyUI Node

texture_render

Preview your PBR maps lit up, without leaving ComfyUI

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
texture_render
  • basecolor
  • normal
  • roughness
  • metallic
  • IMAGE
light_angle0.25
light_strength1.4
ambient_light0.20
specular_hardness40

Flat texture maps are hard to judge. A normal map looks like a blurry purple smudge until it's lit, and "is this roughness value right?" is unanswerable from the raw grayscale. texture_render is the pack's answer: a tiny PBR shader that takes your basecolor, normal, roughness, and metallic maps and renders them under a controllable light - right inside ComfyUI. Think of it as a preview lamp before you take the textures somewhere real.

It's part of the texture group in ComfyUI-Apt_Preset, designed to sit at the end of the texture_create → … → texture_render chain. It's a preview tool, not a replacement for Blender or a game engine - set your expectations accordingly and it's genuinely useful.

How it works

It runs a small Blinn-Phong-style shading model on the GPU (falls back to CPU). Inputs:

  • basecolor, normal, roughness, metallic - the four IMAGE maps. Roughness and metallic are averaged to a single channel internally, so any of the pack's maps (or maps from elsewhere) work.
  • light_angle (0–1) - the light's position on a full 360° circle around the surface. 0.25 is roughly a quarter turn from the default direction. Sweep it to see how highlights travel across the surface - that's the real test of a normal map.
  • light_strength (0.1–10) - how bright the direct light is.
  • ambient_light (0–1) - the fill, so shadows don't go pure black. 0.2 is a sane default.
  • specular_hardness (2–512) - the shininess. High values = tight, small specular dots; low values = broad, matte-ish sheen.

The math: diffuse from the normal dot light, specular from a half-vector raised to a power scaled by roughness and metallic, ambient on top, all clamped. It's not physically perfect - real PBR has energy preservation, fresnel, and proper GGX - but for eyeballing whether a bake holds up, it's plenty.

Inputs and outputs

  • Four IMAGE inputs (basecolor, normal, roughness, metallic) + the four light knobs.
  • Output: IMAGE - the lit render.

Wire texture_create's Normals/Curvature/Height into the roughness/metallic slots for a quick sanity check, or use real maps from anywhere.

Installing it

Part of ComfyUI-Apt_Preset. ComfyUI Manager → search ComfyUI-Apt_Preset, or:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset

Restart; install.bat on Windows for the pack's requirements. This node itself needs nothing beyond torch - the heavy deps in requirements.txt are for the pack's other corners.

Common issues

The usual complaint is "why does my preview look flat" - almost always because the normal input isn't a real normal map (a color image fed in as normal yields garbage), or light_strength/ambient_light are out of whack. Keep ambient low and strength moderate, and sweep light_angle before judging. If you're on CPU, big images render slowly - a plain grid of torch ops, no optimization. And remember: it's a preview, not a final render. When something looks off, the maps are wrong, not the renderer.

CategoryApt_Preset/imgEffect/texture

Inputs (8)

NameTypeDefaultDescription
basecolorIMAGE
normalIMAGE
roughnessIMAGE
metallicIMAGE
light_angleFLOAT0.250–1
light_strengthFLOAT1.40.1–10
ambient_lightFLOAT0.200–1
specular_hardnessFLOAT402–512

Outputs (1)

NameTypeDescription
IMAGEIMAGE