Nodes/ComfyUI-Panda3d/Panda3dDirectionalLight
ComfyUI Node

Panda3dDirectionalLight

The sun-light node that's broken out of the box

By chaojie·Created 3 years ago·Updated 2 years ago· 17
Panda3dDirectionalLight
  • base
  • base
  • light
r0.90
g0.80
b0.90
a1.00
dx0.00
dy8.00
dz-2.50

A directional light is the sun: parallel rays from a direction, casting the shadows that give a scene its shape. Panda3dDirectionalLight is the chaojie/ComfyUI-Panda3d pack's version of that. You give it a color and a direction vector, it hands you a Panda3D DirectionalLight object. On paper, that's the node you'd reach for to make the demo carousel actually look lit.

There's a catch, and it's a real one: as shipped, this node errors when you run it. The input schema declares dx, dy, dz (the light direction), but the node's run() method doesn't accept them - its signature stops at r, g, b, a. ComfyUI dutifully passes the direction values it thinks the node wants, and the node explodes with a TypeError: unexpected keyword argument. That's not a config mistake on your side; it's a bug in the current commit. If your workflow imports it, it'll be flagged red immediately.

How it works (when it works)

The intended mechanism is straightforward and mirrors its ambient sibling. The node builds a DirectionalLight, sets its direction with setDirection(LVector3(dx, dy, dz)), sets its color with setColor((r, g, b, a)), and returns it. The defaults are telling: color .9/.8/.9 (a pinkish-white) and direction (0, 8, -2.5), which points down and toward the camera - the exact values from the demo's original setupLights() code. Whoever wrote the node was transcribing the pack's own demo lighting, then forgot to finish the function signature.

And even past the crash, you'd hit the same wall as Panda3dAmbientLight: there's no node in the pack that attaches a light to the scene graph (render.setLight(...)), and the base's built-in lighting is commented out. So a fixed version of this node would still have nowhere to plug in until someone adds the missing "apply light" step.

The inputs

  • base - the engine, from Panda3dBase, passed through.
  • r / g / b / a - color, 0–1 floats. Defaults .9/.8/.9/1.
  • dx / dy / dz - direction vector. Defaults 0 / 8 / -2.5.

Outputs are base and light (Panda3dModel).

Installing it

One pack, one install:

cd ComfyUI/custom_nodes
git clone https://github.com/chaojie/ComfyUI-Panda3d
cd ComfyUI-Panda3d
pip install -r requirements.txt

Or ComfyUI Manager, search ComfyUI-Panda3d, restart. The install is fine - the bug is in the code, not your setup.

Should you use it?

Right now, no - it crashes, and even fixed it has no consumer. If you're the patch-it-yourself type, adding dx, dy, dz to the run() signature is a five-second fix, and the source is right there in nodes.py. For everyone else: this is the clearest example in the pack that the lighting system is unfinished scaffolding. Use the carousel without lights (it renders flat but works), and revisit this node after the author wires lighting up.

CategoryPanda3d

Inputs (8)

NameTypeDefaultDescription
basePanda3dBase
rFLOAT0.90
gFLOAT0.80
bFLOAT0.90
aFLOAT1.00
dxFLOAT0.00
dyFLOAT8.00
dzFLOAT-2.50

Outputs (2)

NameTypeDescription
basePanda3dBase
lightPanda3dModel