Object Call To Mesh Clear
Object Call To Mesh Clear — ComfyUI Node from Avatar Graph
- BPY_OBJ
- BPY_OBJ
This is the cleanup half of a pair, so it only really makes sense alongside its partner: Object Call To Mesh, also documented on this site. Both belong to Avatar Graph, Avatech AI's pack for turning a single character portrait into a real-time interactive 2D avatar via Blender's Python engine (bpy), and both are part of the large ObjectCall_* family of auto-generated Blender-Object-API wrappers that don't get individual mentions in the README's own node table.
object.to_mesh() bakes a live, deformed object (shape keys, modifiers, whatever's currently posing it) into a standalone, temporary Mesh datablock. Blender's own documentation is explicit that this temporary data needs to be freed when you're done with it - that's exactly what object.to_mesh_clear() does. It's a required cleanup call, not an optional nicety: skip it and the temporary mesh data from every To Mesh call sticks around, which in a graph that runs repeatedly (a loop, a re-execution, a batch) means memory that never gets reclaimed. Nothing crashes immediately - it's the kind of leak that shows up as things getting slower and heavier the longer a session runs, not as an error message.
The rule of thumb: every To Mesh node in your graph should have a matching To Mesh Clear downstream, once you're done with whatever the baked mesh was needed for (typically feeding it into the export/output stage).
Schema-wise this is the simplest possible node - BPY_OBJ in (optional per the schema, but there's nothing to clean up without one wired in from the object you called To Mesh on) and BPY_OBJ out, same handle passed through with the temporary mesh data freed. No configuration surface at all, matching the fact that Blender's underlying call takes no arguments.
Installing it means installing the whole Avatar Graph pack. Via ComfyUI Manager: search "Avatar Graph" and install. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && pip install -r requirements.txt, restart. bpy needs Python 3.10.x exactly - the README's push toward a dedicated conda create --name comfyui python=3.10 environment instead of reusing an existing Flux/SDXL setup is worth heeding rather than skipping. Restart with --enable-cors-header (--force-fp16 too on macOS) so the live avatar preview via Avatech's editor works.
Troubleshooting: the failure you're most likely to actually hit is bpy refusing to import at ComfyUI startup because the Python version isn't exactly 3.10.x, a genuinely common, recurring problem across Blender-Python-based ComfyUI nodes generally. This node itself is close to failure-proof on its own - the real risk is upstream, forgetting to call it at all, which won't throw an error but will leave temporary mesh data accumulating across runs; if a long ComfyUI session using this pack feels like it's getting sluggish, check whether every To Mesh in your graphs is actually paired with one of these. --enable-cors-header only affects the live preview panel, not this node's behavior.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |