Nodes/Avatar Graph/Object Light Add
ComfyUI Node

Object Light Add

Putting a light in your avatar's scene without opening Blender

By avatechai·Created 3 years ago·Updated 2 years ago· 265
Object Light Add
  • BPY_OBJ
  • location
  • rotation
  • scale
  • BPY_OBJ
type
radius1.00
align

A rigged avatar is only as good as its lighting. Blink and mouth shape keys work, the mesh is right, but if the character renders flat and dull, the whole thing reads as dead. Object_LightAdd is the node that adds an actual light object to the embedded Blender scene - Blender's "Add > Light" operator (bpy.ops.object.light_add()), exposed in the Avatar Graph pack. It's how you light your avatar without ever opening the Blender UI.

This is one of the more fleshed-out nodes in the auto-generated family, because adding a light has real parameters.

The inputs that matter

  • type - what kind of light: POINT, SUN, SPOT, AREA. For an avatar you'll mostly want SUN (directional, like a key light - cheap and flattering for toon characters) or POINT (fills from a position). AREA gives soft, realistic falloff but costs more to compute in the real-time preview.
  • location, rotation, scale - B_VECTOR3 values, set via the pack's Vector 3D (Blender) node (three floats each). Location is the big one; for a SUN light, rotation is what aims it.
  • radius - light size; matters most for SPOT (cone radius) and softness.
  • align - WORLD, VIEW, or CURSOR: what the light's initial orientation is aligned to when created. WORLD is the sane default for a scene you're building procedurally.

BPY_OBJ sets the active object context (passes through on output), and the new light object is added to the scene - it's not returned by this node, so grab it by name later or leave it where it lands.

How it works

The node passes your parameters straight to the Blender operator, which creates a new light object in the embedded scene. Because the pack's scene resets between runs, you're building the full lighting setup from scratch each execution - which is fine, it just means "add a light" is genuinely a step in your graph, not a one-time scene tweak. For the avatar pipeline this pairs with light probes for indirect light; a single SUN won't give you soft ambient bounce.

When you'd use it in an avatar graph

Right before the AvatarMainOutput export or the real-time preview. One SUN from the front-top plus a softer AREA or POINT from the back is a solid starter for an anime-style character. If the avatar preview looks too flat, add a light; if it looks blown out, you added one too many - this is very much trial-and-error lighting, same as in Blender.

Installing it

Ships in Avatar Graph (avatechai/avatar-graph-comfyui). ComfyUI Manager: search "Avatar Graph". Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui && python -m pip install -r requirements.txt

Pack constraints: bpy==3.6.0 needs Python 3.10.x, and first startup downloads the SAM ViT-H checkpoint (~2.5 GB) plus MediaPipe models.

Common issues

The B_VECTOR3 inputs trip people up - you can't type raw numbers in the node; you feed them from the Vector 3D node, and leaving them disconnected uses Blender defaults (usually location 0,0,0, which means your light is at the avatar's origin). Also, adding many lights to a real-time avatar preview is how you tank the frame rate - a couple of well-placed ones beat a dozen. The pack is work-in-progress per its README, so keep expectations calibrated.

Categoryblender

Inputs (7)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
typeoptCOMBO4 options: POINT, SUN, SPOT, AREA
radiusoptFLOAT1.000–999999995904
alignoptCOMBO3 options: WORLD, VIEW, CURSOR
locationoptB_VECTOR3
rotationoptB_VECTOR3
scaleoptB_VECTOR3

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ