Nodes/Avatar Graph/Object Simulation Nodes Cache Bake
ComfyUI Node

Object Simulation Nodes Cache Bake

Freeze a sim so it stops re-running

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Simulation Nodes Cache Bake
  • BPY_OBJ
  • BPY_OBJ
selectedfalse

Geometry Nodes simulations are expensive because they're simulations - hair that flows, cloth that settles, physics that only resolves by stepping frame by frame. Object Simulation Nodes Cache Bake wraps bpy.ops.object.simulation_nodes_cache_bake and bakes that simulation into a cache, so the results are frozen and replay cheaply instead of recomputing every time the scene changes.

In Avatar Graph terms: your character is mostly mesh + shape keys, but if any layer carries a geometry-nodes simulation zone (dynamic hair, a jiggling accessory), this node is how you pin down the result so the rest of the pipeline - and the runtime avatar preview - sees stable, fast output.

How it works

Auto-generated wrapper, standard for the pack. Your incoming BPY_OBJ becomes the active object and the operator bakes its simulation cache. Baked caches in Blender are stored on the modifier/object and persist, so after a bake the simulation doesn't need to run again unless the inputs change.

The inputs that matter

  • BPY_OBJ - the object with the geometry-nodes simulation.
  • selected - boolean, default false. false bakes only the active object; true bakes all selected objects in the scene. If you have several simulated layers, ticking it once can save you a chain of bake nodes - but remember it bakes everything selected, so mind what's selected in the shared scene.

Output is one BPY_OBJ, unchanged.

Install

Standard Avatar Graph install. ComfyUI Manager: search Avatar Graph, install, restart. 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

The pack pins bpy==3.6.0, so Python 3.10 is effectively required, and first launch downloads the ~2.5 GB SAM checkpoint plus MediaPipe landmarkers.

Common issues

The main trap is baking too early. A simulation bakes from its current start frame, and if you bake before the sim's inputs are final (driving parameters, cache state, frame range), you freeze in a wrong result. Bake as a late-stage step.

Also: baked caches are state that lives in the shared Blender scene - re-running your queue doesn't auto-rebake, and changing upstream geometry after a bake won't update the frozen sim. If your hair looks stuck, that's a stale cache, not a broken node. Delete/rebake when inputs change. And selected: true in a scene with stray objects selected will bake things you didn't mean to - keep your selection tight.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
selectedoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ