Nodes/Avatar Graph/To Group Ops
ComfyUI Node

To Group Ops

One object isn't a group until this node says so

By avatechai·Created 3 years ago·Updated 2 years ago· 264
To Group Ops
  • BPY_OBJ
  • BPY_OBJS

ToGroupOps is the quietest node in the whole Avatar Graph pack, and also one of the most confusing when you first meet it, because its only visible job is to take one object and return a list containing that one object. That sounds pointless until you realize the pack runs on two different data types. Most of the blender nodes thread a single BPY_OBJ handle through their chain. But the nodes at the end of the pipeline - Join Meshes, Avatar Main Output - consume a BPY_OBJS list, because an avatar is usually several meshes (eyes, mouth, head) stitched together. ToGroupOps is the adapter that turns the single-object world into the list world.

How it works

Unlike nearly every other node in this pack, ToGroupOps isn't an auto-generated wrapper around a Blender operator. It's hand-written in blender/ops_to_group.py, and its entire logic is one line: it returns [BPY_OBJ] - your object, wrapped in a list.

The rest is the pack's standard plumbing. Like all ObjectOps subclasses, it takes the object you hand it, makes it the active object in the headless Blender scene, and passes it back through. The output type is BPY_OBJS instead of BPY_OBJ, which is exactly the point: downstream nodes that loop over object lists will now accept the wire.

Inputs and outputs

  • BPY_OBJ (optional) - the object to wrap. Leave it disconnected and it'll grab whatever the current active object is.
  • Output: BPY_OBJS - a one-element list of that object.

That's it. No knobs, no enums, no hidden settings.

When you'd actually use it

In the stock eye-blink + lipsync template you mostly don't need it, because the mesh nodes hand off single objects and Create Shape Flow takes them directly. You reach for ToGroupOps when you've built a pipeline that produces one object per branch - say, separate eye-left and eye-right meshes - and you need to feed them into a node that expects the grouped form, like Join Meshes or the avatar output. It's also handy for debugging: wire it in and you can see the list-shaped outputs light up in the UI, which helps when a downstream node keeps rejecting your connection.

Installing and the shared gotchas

This ships with the whole pack. Install via ComfyUI Manager (search "Avatar Graph") or:

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

The one dependency that bites is bpy==3.6.0, which needs Python 3.10 exactly - ComfyUI Manager's usual "just install it" path can fail if your ComfyUI runs on a different Python version. The pack also downloads the ~2.5GB SAM ViT-H checkpoint and a couple of mediapipe models the first time it loads.

Two quirks worth knowing before you wire anything up. First, the headless Blender scene resets to factory settings every time your graph runs, so BPY_OBJ handles only live for the duration of one execution - no persisting objects between runs. Second, the real-time avatar preview in the top-right corner only works if you launch ComfyUI with --enable-cors-header; without it you can still export the result as GLB/GLTF by right-clicking Avatar Main Output.

ToGroupOps won't change the world on its own. It's the tiny connector that makes the grouped side of this pack reachable, and when a graph is screaming at you about a type mismatch, it's usually the fix.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJSBPY_OBJS