Nodes/Avatar Graph/Object Lineart Bake Strokes All
ComfyUI Node

Object Lineart Bake Strokes All

Bake your Blender line art right inside the ComfyUI graph

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Lineart Bake Strokes All
  • BPY_OBJ
  • BPY_OBJ

This node runs Blender's lineart_bake_strokes_all operator inside your ComfyUI graph. If you're building one of those riggable avatar pipelines that Avatar Graph is for, it's how you turn a Line Art modifier into actual, editable grease pencil strokes - the "bake" step, applied to every object with a line art setup at once. You feed it a BPY_OBJ, it bakes strokes, and hands the same object back. Nothing is generated or inferred here; it's pure Blender automation, which is the whole point of this pack.

The context

Avatar Graph is a custom nodes pack from Avatech (avatechai/avatar-graph-comfyui) that drives a headless Blender 3.6 through the bpy pip package. Every Object_* node is an auto-generated wrapper around a bpy.ops.object.* operator. You wire in a BPY_OBJ (a live Blender object), the wrapper makes it the active object, runs the operator with your settings, and returns the same object so you can keep chaining. The meshes you build accumulate in one shared in-memory scene until Avatar Main Output resets it.

If cartoon outlines are part of your character, the flow is: add a Line Art modifier to your mesh layers, then bake the strokes so they become real grease pencil strokes you can export. LineartBakeStrokesAll is the batch version - Blender also has a single-object lineart_bake_strokes, and this pack exposes both under the Object_ prefix.

Inputs and output

There's exactly one input that matters and it's optional: BPY_OBJ. Leave it unwired and the operator just acts on whatever object is active in the headless scene; wire it and the node targets that specific object. The output is the same BPY_OBJ, so it slots cleanly between a mesh-layer node and whatever comes next. That's the whole interface - for a wrapper node like this, the interesting work happens inside Blender's operator, not in the node's parameters.

Installation

The pack installs like any custom node, but it has one hard requirement: Python 3.10.x exactly, because the bpy==3.6.0 wheel only ships for 3.10. The README bundles a whole Python 3.10 ComfyUI build for Windows; on macOS/Linux make a 3.10 conda env. Then:

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

Or just search "Avatar Graph" in ComfyUI Manager and let it do the cloning. First launch is slow - the pack auto-downloads the SAM ViT-H model (~2.4 GB) plus mediapipe face/pose landmarkers.

Where people get tripped up

This operator needs a properly configured Line Art modifier and a grease pencil target object; with none present, it bakes nothing and you get back your object untouched. It's also easy to confuse with LineartBakeStrokes (single object) and the LineartClearAll pair (see those pages). And remember: if you want the live avatar preview in the corner of ComfyUI, launch with --enable-cors-header; otherwise you can still export a .GLB from Avatar Main Output and check it in Blender.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ