Nodes/ComfyUI-Image-Effects/๐ŸŒž God Rays
ComfyUI Node

๐ŸŒž God Rays

Shafts of Light, No Path Tracing Required

By orion4dยทCreated about a year agoยทUpdated about a year agoยท 28
๐ŸŒž God Rays
  • image
  • IMAGE
โ—„intensity0.5โ–บ
โ—„num_rays8โ–บ
โ—„ray_length0.8โ–บ
โ—„source_x0.50โ–บ
โ—„source_y0.20โ–บ
โ—„color_temp3000โ–บ
โ—„decay0.8โ–บ

God Rays adds volumetric shafts of light streaming from a point in your image - the "light through clouds / between trees / through a window" effect that instantly sells drama. Diffusion models are famously bad at drawing believable volumetric light (it usually comes out as a soft glow at best), so this is a case where a post-process node beats prompting almost every time.

It's one of the pack's Light Effects, alongside Lens Flare and Aurora, and it's a finishing pass: composite it over your render near the end, right before Save. The classic use is a landscape or interior where you want the sun to feel present without regenerating.

How it works

The node picks a light source position (via source_x / source_y) and casts num_rays light shafts outward from it. Each ray is drawn as a tapered, blurred streak along a slightly randomized angle - the randomness is per-ray, so the shafts aren't perfectly uniform, which is exactly what makes them look like light through gaps rather than a starburst sticker. Every ray is heavily Gaussian-blurred so it reads as scattered light, not a line. ray_length controls how far the shafts extend, and decay controls how quickly each fades toward its tip (higher = longer, more uniform streaks).

The color_temp input (2000โ€“8000K, default 3000) sets the color of the light via a Kelvin-to-RGB conversion - 3000K is warm golden-hour light, 5500K is neutral daylight, up near 8000K is cold blue. That single slider does most of the mood-setting work.

The inputs that matter

  • intensity (0โ€“2, default 0.5) - brightness of the shafts.
  • num_rays (3โ€“20, default 8) - how many shafts. Fewer + wider spacing reads more natural.
  • ray_length (0.1โ€“2, default 0.8) - how far the light reaches.
  • source_x / source_y - where the light comes from. Top-left corner is the classic "sun" position; match it to whatever highlight your image already has.
  • color_temp (2000โ€“8000K, default 3000) - light color, warm to cold.
  • decay (0.1โ€“1, default 0.8) - falloff along each shaft.

Output is the composite IMAGE.

Installing it

Ships in ComfyUI-Image-Effects (Orion4D). ComfyUI Manager โ†’ search "Image Effects", or:

cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI-Image-Effects
cd ComfyUI-Image-Effects
pip install -r requirements.txt

Restart, then it's under Add Node โ†’ Image Effects. No models - OpenCV draws and blurs the shafts.

Gotchas

Pack-wide: only the first image of a batch is processed, CPU-bound, and the ray angles are randomized with no seed - every run gets slightly different shaft placement. Two practical notes. First, god rays only look right where they make sense: match source_x/source_y to the sun or bright area already in your image, or the effect floats. Second, it's an additive light - on an already-bright image it can blow out toward white fast; keep intensity moderate and let the blur sell it. For a more integrated look, run it before a subtle Film Grain pass so the grain unifies the light with the image.

CategoryImage Effects

Inputs (8)

NameTypeDefaultDescription
imageIMAGEโ€”
intensityFLOAT0.50โ€“2โ€”
num_raysINT83โ€“20โ€”
ray_lengthFLOAT0.80.1โ€“2โ€”
source_xoptFLOAT0.500โ€“1โ€”
source_yoptFLOAT0.200โ€“1โ€”
color_tempoptFLOAT30002000โ€“8000โ€”
decayoptFLOAT0.80.1โ€“1โ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEโ€”