Nodes/Avatar Graph/Object Bake Image
ComfyUI Node

Object Bake Image

Baking a texture from inside a Blender node graph

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Bake Image
  • BPY_OBJ
  • BPY_OBJ

If you've landed here, you're probably deep in Avatar Graph (avatechai/avatar-graph-comfyui), the pack that turns a single character portrait into a real-time animatable 2D avatar - blinking eyes, a lip-synced mouth, the whole thing driven live from a browser viewer. That's the headline feature. What you've actually found is one of the pack's least-documented corners: a raw wrapper around Blender's own Python API, running headless inside ComfyUI. Object_BakeImage takes a BPY_OBJ (Avatar Graph's handle for a live Blender object) and hands the same object straight back out. No other inputs, no config.

How it works

The node ships with zero parameters and zero description from the author, so what follows is inferred from the class name and Blender's own API - not something Avatech wrote down anywhere. Given the naming pattern and the empty parameter list, this most plausibly maps to Blender's legacy bpy.ops.object.bake_image() operator: an old-school texture bake that flattens whatever's currently shading the object (lighting, procedural textures, whatever's plugged into its material) down into a single image, using the render engine and bake settings that are already active in the underlying Blender scene at the moment this node fires.

That "already active" part matters, because this node gives you no way to set bake type, margin, or resolution from the graph itself. You either accept whatever the scene's bake settings currently are, or you're expected to configure them some other way (Avatar Graph exposes raw Python execution elsewhere in the pack, just not in this batch of nodes).

Why you'd reach for it

Honestly? Rarely, and not directly through Avatar Graph's documented workflow. The pack's own README lists a handful of high-level nodes meant for end users - Create Mesh Layer, Join Meshes, Match Texture Aspect Ratio, Plane Texture Unwrap, Create Shape Flow, Avatar Main Output - and this isn't one of them. If you're following the standard "photo → rigged avatar" templates, you'll never touch it. Where it becomes relevant is if you're extending the pipeline yourself: say you've generated or painted something onto a 3D surface (one of the SAM-segmented mesh layers, for instance) and want it flattened into a single static texture rather than shaded live at runtime. Baking is the standard Blender move for that, and this node is the closest thing to a one-click version of it in the graph.

Inputs and outputs

There's exactly one socket: an optional BPY_OBJ in, the same BPY_OBJ type out. That's the entire schema - no bake-type dropdown, no resolution field, nothing to tune.

Installing it

Avatar Graph isn't a lightweight node pack - it drags in Blender's full bpy Python module as a dependency, and bpy is picky about your Python version. On Windows, the easiest path is the author's bundled Python 3.10 environment (linked from their README), unzipped into your ComfyUI folder; run the .bat, then install "Avatar Graph" from ComfyUI Manager. On macOS/Linux, you're doing it by hand, and your ComfyUI environment has to be Python 3.10.x specifically - conda is the simplest way to pin that (conda create --name comfyui python=3.10). Then: cd ComfyUI/custom_nodes, git clone https://github.com/avatechai/avatar-graph-comfyui.git (the README's own clone command in its "Method 2" section actually points at a different org, avatechgg - that's stale; use avatechai, the org the repo actually lives under). cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart ComfyUI with python main.py --enable-cors-header (add --force-fp16 on Mac). That CORS flag exists so the pack's hosted viewer at editor.avatech.ai can talk to your local ComfyUI over postMessage - skip it if you're happy exporting a .glb/.gltf from the Avatar Main Output node instead of using the live preview.

Common issues

The Python-version mismatch is the number one failure mode - bpy simply won't install, or ComfyUI won't start, on anything other than 3.10.x. Beyond that, since this node has no exposed configuration, a bake that silently does nothing (or bakes the wrong thing) is almost never a bug in this node - check the Blender scene's active render engine and bake settings first, since that's genuinely all this call is reading from. And because this whole corner of the pack is undocumented - it isn't in the README's own node table - treat this write-up and Blender's own operator docs as your reference, not anything from Avatech.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ