Object Lineart Bake Strokes
Baking line art into grease pencil
- BPY_OBJ
- BPY_OBJ
The thing that makes an anime avatar read as anime more than anything else is the line work - the dark outline hugging the silhouette, the crisp strokes at the eyes and jaw. In Blender that look usually comes from the Line Art modifier: a non-photoreal tool that generates stroke geometry from a mesh's edges, rendered into a Grease Pencil object. Object_LineartBakeStrokes is the "bake it into grease pencil" step, exposed as a node in the Avatar Graph pack.
Why bake at all? A Line Art modifier computes strokes on the fly, which is fine for a static render but fragile for a rigged, deforming character. Baking converts the generated strokes into actual Grease Pencil data - persistent, editable, and stable as the mesh moves. For a 2.5D avatar that needs a consistent cartoon outline while the head turns and the mouth opens, baked line art is the reliable way.
How it works
It calls bpy.ops.object.lineart_bake_strokes(). The operator takes the current Line Art modifier output and commits it to the target Grease Pencil object. BPY_OBJ sets the active object context in the embedded scene and passes through unchanged; there are no other inputs.
The practical setup, in order: your avatar mesh, a Line Art modifier configured on it (usually on a duplicate or via the scene's line-art settings), a Grease Pencil object to receive the strokes, and then this node to bake. It's genuinely a multi-node graph rather than a drop-in effect - which is why the pack's demo templates carry the whole assembly rather than just this node.
When you'd use it in an avatar graph
Whenever your character's style needs a clean, stable outline. The pack's own demo images are exactly this look - segmented layers with baked line art so the outline survives the real-time rig. Pair it with the mesh layers created from the SAM-segmented character image: the silhouette edges of those layers become your cartoon lines.
Inputs and outputs
BPY_OBJ- active context object; returned unchanged.BPY_OBJoutput - pass-through.
Installing it
Ships in Avatar Graph (avatechai/avatar-graph-comfyui). ComfyUI Manager: search "Avatar Graph". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui && python -m pip install -r requirements.txt
Pack constraints: bpy==3.6.0 needs Python 3.10.x, and first launch pulls the SAM ViT-H checkpoint (~2.5 GB) and MediaPipe models.
Common issues
The #1 mistake is expecting one node to produce outlines. Bake only writes what a Line Art modifier already generated - no modifier, no strokes, no result. Second is bake timing: bake before the rig deforms the mesh and the lines won't follow the deformation (that's the whole point of baking after, in the rest pose, so lines stay glued to the silhouette as it moves). And remember Line Art is an EEVEE-era feature; if you're exporting to a web viewer, check that the recipient can handle grease pencil. The README warns the pack is actively changing, so verify against current templates.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |