Nodes/ComfyUI-TextureAlchemy/Environment Map to Irradiance
ComfyUI Node

Environment Map to Irradiance

Physically honest diffuse lighting from an HDRI, inside ComfyUI

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Environment Map to Irradiance
  • environment_map
  • irradiance_map
qualityBalanced (128 samples)
compute_deviceGPU (CUDA)
output_resolution512x256

If you've ever seen a renderer's "irradiance map" and assumed it was just a blurry version of the skybox - you're half right. An irradiance map is the diffuse lighting contribution of an environment: for every surface direction, it stores how much light bounces back from the whole surrounding hemisphere. In game engines it's what makes an object feel lit by its environment instead of by a spotlight. This node computes that from an equirectangular environment map (your standard HDRI) with actual hemisphere sampling, so the result is physically meaningful, not just a smudge.

Here's the mechanism in one breath. Every output pixel represents a surface normal direction. To know how much light that surface receives, you have to integrate the incoming radiance over the entire hemisphere around that normal - for each pixel. Naively that's a big integral, which is why the node gives you three quality tiers in the quality dropdown:

  • Fast (Blur) - approximates the convolution with heavy blur. Instant, and honestly good enough for look-dev.
  • Balanced (128 samples) - the default. Monte Carlo sampling of the hemisphere per pixel, the sweet spot.
  • Accurate (512 samples) - four times the samples for the smoothest, most physically faithful result.

The node converts each output pixel to a 3D direction, samples the environment map with bilinear interpolation, and integrates over the hemisphere. compute_device picks GPU vs CPU, and it's not marketing fluff: the GPU path batches the whole hemisphere sampling into tensor ops and is genuinely 10–100x faster. Keep it on GPU. output_resolution controls the size of the irradiance map - 512x256 is plenty for most uses since the map is inherently low-frequency; 2048x1024 is for when you're going to reuse it as a source for reflections or lighting a large scene.

Output is irradiance_map, a standard IMAGE in equirectangular form, ready to save or feed into whatever render/lighting chain you're driving. Pair it conceptually with the pack's fast blur-based variant (HDRIToIrradianceFast) - that one is for iteration, this one is for when the numbers should mean something.

Honest positioning: this is a fairly specialized node, and you'll only reach for it if your workflow produces environment maps and you need diffuse IBL without leaving ComfyUI. If that's you, it's a legitimately nice-to-have - the GPU path makes a previously "go do it in a 3D tool" task into a one-node step.

Install: Manager → search "Texture Alchemy", or:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

Restart, then Texture Alchemist/Lighting → Environment Map to Irradiance. No dependencies beyond ComfyUI's torch/NumPy. Shared gotchas: the README's copy-a-folder step references the old pack name, and if Manager blocks a Git-URL install, that's the security level - clone by hand.

CategoryTexture Alchemist/Lighting

Inputs (4)

NameTypeDefaultDescription
environment_mapIMAGE
qualityCOMBOBalanced (128 samples)Quality vs speed tradeoff
compute_deviceCOMBOGPU (CUDA)GPU is 10-100x faster for hemisphere sampling
output_resolutionCOMBO512x256Output resolution - lower is faster

Outputs (1)

NameTypeDescription
irradiance_mapIMAGE