UV Lightmap Pack
A bake-ready layout without wrecking your texture UVs
- BPY_OBJ
- BPY_OBJ
UV Lightmap Pack is the packer you use when you want a rigid, box-grid layout instead of Blender's smarter island packing. Its job is to arrange UV islands into a grid of evenly-sized square cells - the classic layout for baking lightmaps and ambient occlusion, where you don't care about a clever fit, you care that every face gets roughly equal space and nothing overlaps. It's niche, but when you need it, it's the only node that does it.
How it works
It wraps bpy.ops.uv.lightmap_pack on your BPY_OBJ - same auto-generated pattern as every UV_* node in the Avatar Graph pack: enter edit mode, run the operator, return the object. The inputs are the operator's, named exactly as Blender names them:
- PREF_CONTEXT -
SEL_FACESpacks only the selected faces;ALL_FACESpacks everything. The one you'll flip most. - PREF_PACK_IN_ONE (default on) - pack everything into a single 0–1 map instead of spreading across multiple tiles.
- PREF_NEW_UVLAYER - this one's the gem. When on, the packed layout goes onto a new UV layer and your existing texture UVs are left untouched. In the avatar context that's exactly what you want if you only need a bake pass and don't want to nuke the layout your texture depends on.
- PREF_BOX_DIV - grid divisions per box (default 12, range 1–48). Higher = more, smaller cells; it trades cell count against usable space per face.
- PREF_MARGIN_DIV - margin between boxes as a fraction (default 0.1). Raise it if baked results bleed between cells.
Output is the same BPY_OBJ.
Where it fits
Honestly? Most Avatar Graph users will never touch this. The default UV Pack Islands gives a tighter, texture-friendly result and is what you want for the character's main map. Lightmap Pack earns its keep only when you're doing the separate baking pass - ambient occlusion, lightmaps, cavity - where a uniform grid is the point. The PREF_NEW_UVLAYER option is the one reason to remember it exists: it lets you generate that bake layout without destroying the UVs your mouth and eye textures rely on. If you never bake, skip it.
Installing Avatar Graph
This node ships in the Avatar Graph pack from Avatech. From ComfyUI/custom_nodes:
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt
then restart ComfyUI with --enable-cors-header. Or install via ComfyUI Manager, searching Avatar Graph.
Same pack-wide gotchas: it pins bpy==3.6.0, which only builds on Python 3.10.x - a newer Python fails the install and loads nothing. First launch pulls the ~2.5 GB SAM model, so don't panic at the long start. And the README flags the pack as still in development; pin the version once you have a working workflow.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| PREF_CONTEXTopt | COMBO | 2 options: SEL_FACES, ALL_FACES | |
| PREF_PACK_IN_ONEopt | BOOLEAN | true | — |
| PREF_NEW_UVLAYERopt | BOOLEAN | false | — |
| PREF_BOX_DIVopt | INT | 121–48 | — |
| PREF_MARGIN_DIVopt | FLOAT | 0.100.001000000047497451–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |