Object Align
Lining up scene objects without doing the math yourself
- BPY_OBJ
- BPY_OBJ
Positioning objects by hand with location fields is fine for one object; it gets tedious fast once you're arranging several parts of a character - eyes, mouth, body plane - that all need to line up on a shared axis. Object_Align does that arithmetic for you.
What it is and why you'd reach for it
This wraps Blender's bpy.ops.object.align() directly - the same operator behind Blender's own Object → Transform → Align Objects menu item. Avatar Graph runs actual Blender via the bpy package inside ComfyUI, and this node is a thin passthrough to it.
In an Avatar Graph pipeline, this is useful once you've got multiple mesh layers built from segmented parts of a character image (say, separate eye and mouth planes from Create Mesh Layer) and you need them aligned on a common axis before wiring up shape keys that assume a consistent position - a blink shape that assumes the eye plane sits at a known depth, for instance.
Worth knowing going in: align_mode and relative_to show up in this node as generic OPT_1/OPT_2/OPT_3(/OPT_4) choices rather than readable labels. That's not a flaw in how this pack wrapped the operator - Blender's own align_mode and relative_to enums are genuinely defined with those bare identifiers at the API level; the readable names (Negative Side / Center / Positive Side for align_mode; roughly Scene Origin / 3D Cursor / Selection / Active Element for relative_to) only exist in Blender's UI layer, not the operator schema this node reads from. You'll want to test each option once to see which is which for your case rather than guessing from the label alone.
Inputs and outputs that matter
BPY_OBJ(optional) - the object(s) to align.bb_quality(bool, default True) - whether alignment is computed from the object's actual geometry (higher quality, slower) or its simpler bounding box.align_mode(enum, 3 choices: OPT_1/OPT_2/OPT_3) - which part of the object's bounds gets aligned to the target - roughly negative-side, center, or positive-side, in that order.relative_to(enum, 4 choices: OPT_1–OPT_4) - what the object is being aligned relative to.align_axis(enum: X, Y, Z) - which axis the alignment happens along.
Output: a single BPY_OBJ, repositioned per the alignment settings.
Installing Avatar Graph
The pack runs on bpy, which only has wheels for Python 3.10.x - pin your environment to that first.
ComfyUI Manager: search avatar-graph-comfyui, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui.git
cd avatar-graph-comfyui
python -m pip install -r requirements.txt
Restart with python main.py --enable-cors-header (--force-fp16 too on Mac). Windows gets a prebuilt Python 3.10 environment from the README; macOS/Linux is pointed at conda create --name comfyui python=3.10.
Common issues
Object jumps somewhere unexpected. Almost always align_mode or relative_to picked the wrong opaque option - since neither shows readable labels, it's easy to grab OPT_2 when you meant OPT_1. Cycle through the options once on a test object to map out which does what for your case.
Alignment looks slightly off from what geometry suggests. Check bb_quality - with it off, alignment is based on the bounding box, which can differ noticeably from the visual center of an irregular mesh.
Nodes not appearing in ComfyUI. Check python --version is exactly 3.10.x - bpy fails to import otherwise, and the whole pack won't register.
No live avatar preview. Needs --enable-cors-header at launch. Without it, export the finished result via right-click → Save File on Avatar Main Output instead of watching the embedded editor.avatech.ai panel.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| bb_qualityopt | BOOLEAN | true | — |
| align_modeopt | COMBO | 3 options: OPT_1, OPT_2, OPT_3 | |
| relative_toopt | COMBO | 4 options: OPT_1, OPT_2, OPT_3, OPT_4 | |
| align_axisopt | COMBO | 3 options: X, Y, Z |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |