Nodes/Avatar Graph/Object Call Generate Gpencil Strokes
ComfyUI Node

Object Call Generate Gpencil Strokes

Turning a mesh into vector line art

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Call Generate Gpencil Strokes
  • BPY_OBJ
  • grease_pencil_object
  • BPY_OBJ
use_collectionstrue
scale_thickness1
sample0

ObjectCall_GenerateGpencilStrokes is a mesh-to-line-art primitive from Avatar Graph's (avatechai/avatar-graph-comfyui) auto-generated layer over Blender's bpy.types.Object API. The pack's headline feature is rigging a still character portrait into a live, blinking, lip-syncing 2D avatar; this node isn't part of that documented pipeline, but it's a genuinely distinct capability from the rest of this batch - most of the ObjectCall_* nodes read or tweak object state, this one actually generates new geometry.

How it works

It maps to Object.generate_gpencil_strokes(grease_pencil_object, use_collections, scale_thickness, sample), documented as: "generate Grease Pencil strokes from the object." Grease Pencil is Blender's native 2D vector-stroke system - think a proper drawing/annotation layer that lives in 3D space rather than a flat image. This call converts a mesh object's edges into a set of Grease Pencil strokes written onto a target GP object, effectively producing a clean vector outline of the mesh.

Why you'd reach for it

If you want a stylized line-drawing pass of the character mesh - a clean vector outline distinct from the photo-derived, shaded surface - this is the primitive for it. It's the kind of building block you'd use for a sketch-style render variant layered on top of the normal avatar output.

Inputs and outputs

  • BPY_OBJ (optional) - the source mesh object.
  • grease_pencil_object (optional, default null) - the target Grease Pencil object the strokes get written to. This node doesn't create one for you; it has to already exist in the scene.
  • use_collections (optional BOOLEAN, default true) - groups the generated strokes by the source mesh's collection.
  • scale_thickness (optional INT, default 1) - scales the stroke thickness.
  • sample (optional INT, default 0) - resamples stroke points at a fixed interval when non-zero; 0 means no resampling.

Output is a single BPY_OBJ, the source object passed straight through - the newly generated strokes live on the grease_pencil_object you supplied, not on any output wire this node exposes.

Installing it

Avatar Graph depends on Blender's bpy module, which is strict about Python version - expect a real install, not a drop-in. On Windows, use the author's bundled Python 3.10 environment (linked in their README), unzipped into your ComfyUI folder and launched via the included .bat, then install "Avatar Graph" from ComfyUI Manager. On macOS/Linux, pin your ComfyUI environment to Python 3.10.x exactly - conda is the cleanest way (conda create --name comfyui python=3.10). Then cd ComfyUI/custom_nodes, git clone https://github.com/avatechai/avatar-graph-comfyui.git (their README's own manual-install command references a stale org, avatechgg - the repo lives under avatechai). cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart with python main.py --enable-cors-header (Mac: also --force-fp16). That flag opens CORS so the hosted viewer at editor.avatech.ai can talk to your local ComfyUI; skip it if you're exporting .glb/.gltf from Avatar Main Output instead.

Common issues

Python-version mismatch is the recurring first blocker across this whole pack - bpy needs 3.10.x. Specific to this node: it will do nothing (or error) if grease_pencil_object is left at its null default - you need an actual GP object already present in the scene before calling this. And since Grease Pencil object creation isn't exposed anywhere in this batch of nodes, provisioning that target object is something you'd have to handle through a different part of the pack's Blender plumbing, or accept as a limitation. No author documentation exists for this node, so this description is grounded in Blender's own Object.generate_gpencil_strokes() API docs.

Categoryblender

Inputs (5)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
grease_pencil_objectoptgrease_pencil_object
use_collectionsoptBOOLEANtrue
scale_thicknessoptINT1
sampleoptINT0

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ