Skip to content
,

SAM 3D Body in ComfyUI: Free Motion Capture from Any Video

7–11 minutes
Woman in a brick-walled loft holding a tablet with a SAM 3D BODY card, hook free mocap from any video

Want free motion capture from a normal video? Meta’s SAM 3D Body turns a person in any clip into a full 3D body mesh, frame by frame, including hands and (with one extra node) facial expressions.

ComfyUI now runs it natively, and it can export the result as an animated GLB or a BVH mocap file for Blender, Unity or Unreal.

This guide covers the official ComfyUI template, the four model files and their folders, how each node works, every render style (mesh, silhouette, OpenPose, SCAIL), exporting to GLB and BVH, and fixes for common problems.

Everything is checked against ComfyUI’s source code (comfy_extras/nodes_sam3d_body.py), the official template and Comfy’s model catalog, as of December 2026.

TL;DR

  • Template: “SAM 3D Body: 3D Human Mesh Extraction From Video” (added 25 August 2026). Native nodes, no custom packs.
  • Main model: sam_3d_body_dinov3_bf16.safetensors in models/detection/.
  • Helpers: SAM 3.1 (multi-person tracking), RT-DETR (person boxes), MoGe (camera field of view). About 5.5 GB in total.
  • Outputs: a rendered video (mesh, silhouette, OpenPose 2D/3D or SCAIL capsules) and an animated GLB or BVH file.
  • Tip: bounding boxes “improve detection accuracy drastically”, and SAM 3 tracking is needed for several people.

New to ComfyUI? Start with my ComfyUI guide for the basics of nodes, models and workflows.

What SAM 3D Body Does

SAM 3D Body is part of Meta’s SAM 3D family, alongside SAM 3D Objects. Given an image of a person, it predicts their full 3D body: pose, body shape and hand pose, as a mesh on Meta’s MHR (Momentum Human Rig) body model.

Run on every frame of a video, that becomes markerless motion capture.

The ComfyUI template’s own description: “Extract a full-body 3D human mesh from a single video frame using SAM 3D Body”, for “motion capture prototyping, biomechanics analysis, and character animation previsualization.”

What ComfyUI adds around the model:

  • Person detection with RT-DETR, so the model knows where to look.
  • Multi-person tracking with SAM 3.1, so each person keeps their identity.
  • Camera field-of-view estimation with MoGe, for better alignment and scale.
  • Face expressions added through MediaPipe (SAM 3D Body itself doesn’t detect expressions).
  • Smoothing to remove jitter, then rendering and export.

Model Files and Folders

From Comfy’s model catalog, inside ComfyUI/models/:

File Folder Job
sam_3d_body_dinov3_bf16.safetensors detection SAM 3D Body itself (DINOv3 backbone)
sam3.1_multiplex_fp16.safetensors checkpoints SAM 3.1 tracking for multiple people
rt_detr_v4-x-hgnet_fp32.safetensors diffusion_models RT-DETR person detector (bounding boxes)
moge_2_vitl_normal_fp16.safetensors geometry_estimation MoGe camera field of view (optional)

Sources are the Comfy-Org repos on Hugging Face (sam-3d-body, sam3.1, SDPose and MoGe). The template’s total download is about 5.5 GB, so it runs on far more GPUs than video generators do. It should fit mid-range GPUs for short clips; lower the batch size if you run out of memory.

Yes, the RT-DETR detector goes in diffusion_models; that’s where the template’s loader looks.

Run the Official Template

  1. Update ComfyUI. Open Templates and search SAM 3D Body.
  2. Download the four models and press R.
  3. In Load Video, load a clip of a person. Video Slice takes the first 5 seconds by default.
  4. Leave the text prompt as person. It drives both SAM 3 tracking and the RT-DETR detector.
  5. Click Run. You get a rendered video in output/video/SAM3D_body and a 3D file in output/3d/.

Open the GLB in ComfyUI’s 3D viewer, in Blender, or in any GLB viewer to see the animated body.

For the masks-only side of SAM, see my SAM 3 video segmentation guide.

The Nodes Explained

Node Key settings (template values) What it does
Load SAM3D Body Model model_file from models/detection Loads the model
RT-DETR detect threshold 0.5, class “person”, max 100 Finds people and draws boxes
SAM3 Video Track threshold 0.5 Tracks each person across frames
Run SAM3D Body Prediction run_hand_refinement on, fov 0, batch_size 64 Predicts the 3D body per frame
Face Expression to SAM3D Body global 1, mouth 1, eyes 2, brows 2 Adds expressions via MediaPipe
Smooth SAM3D Body Pose Data strength 1, gaussian, window 7 Removes jitter
MoGe Geometry to FOV vertical, degrees Estimates camera field of view
Render 3D Body Pose style mesh Draws the result as video
Create 3D Animation File format glb, style scail Builds the export

Details from the source code worth knowing:

  • run_hand_refinement “improves hand pose at the cost of extra inference time and memory use”. Turn it off for speed.
  • fov is the vertical field of view; 0 falls back to about 53 degrees (a typical 16:9 camera). It “affects predicted depth and absolute scale”, which is why the template feeds it from MoGe.
  • batch_size (1 to 512) is how many person crops run at once; bigger is faster but uses more VRAM.
  • Face expression multipliers: the tooltips say MediaPipe’s eye values rarely exceed 0.5 and brow values sit around 0.1 to 0.3, so 2 to 3x is often needed. That’s why eyes and brows default to 2.
  • Smoothing offers gaussian or Savitzky-Golay filters with an odd frame window.

Render Styles: Mesh, Silhouette, OpenPose, SCAIL

Style What you get Use it for
mesh The 3D body mesh drawn through the camera Checking the capture, overlays
silhouette A black-and-white mask of the body Masks for compositing or inpainting
openpose_2d A flat OpenPose-style skeleton (DWPose or OpenPose look) Pose control for image and video models
openpose_3d The skeleton as a shaded 3D model Depth-aware pose guides
scail 3D capsule limbs with 2D hands on top SCAIL-style animation control inputs

You can render over the original video (connect it as background) or on black. Width and height of 0 keep the source size. There’s also a camera override input to re-project the pose from a new angle.

The openpose_2d output is especially handy: it’s a clean, temporally smooth pose video you can feed into a pose-controlled video model. See my LTX video ControlNet guide.

Export to GLB or BVH for Blender, Unity, Unreal

The Create 3D Animation File node has two formats, both saved with the Save 3D Model node:

  • glb: an animated GLB. Mesh styles: body_mesh (with optional bone markers and colour modes), bones_only, an OpenPose-18 skeleton, or a SCAIL capsule rig. A bone_smooth_window (0 to 51) adds extra smoothing; the tooltip suggests 7 to 15 “where upstream Smooth misses spikes”.
  • bvh: a standard BVH mocap clip with one skeleton, in centimetres (the mocap standard) or metres. It needs the SAM 3D Body model connected.

camera_translation controls root movement: off keeps the body in place, centered moves it relative to frame 0, and absolute uses raw camera depth.

The default frame rate is 24 fps; set it to match your source.

Into Blender: File, Import, glTF 2.0 (for GLB) or Motion Capture (.bvh). The BVH skeleton can then be retargeted onto your own character with Blender’s retargeting tools or an add-on.

What You Can Do With It

  • Free mocap for indie games and animation, from phone videos.
  • Pose guides for AI video: extract a dance as a clean OpenPose video, then restyle it.
  • Sports and fitness analysis: look at joint angles and posture in 3D.
  • Previs: block out character motion before a real shoot.

For turning a single image into a 3D object instead of a body, see my Hunyuan3D in ComfyUI guide.

How to Film Footage That Captures Well

SAM 3D Body works from ordinary video, but the quality of the clip still decides how clean the motion comes out. A few minutes of planning before you film saves a lot of cleanup in Blender later.

  • Show the whole body. Keep head to feet in frame. When feet leave the frame the model has to guess them, and guessed feet slide on export.
  • Lock the camera. A phone on a tripod or a shelf gives far steadier results than handheld footage, because the model does not have to separate camera shake from body motion.
  • Use even light. Daylight from a window or a bright room is enough. Strong backlight turns the person into a dark shape and limbs get lost.
  • Wear fitted clothes. Loose coats and long skirts hide the knees and elbows, so joint angles become guesses. Plain, fitted clothes that contrast with the background work best.
  • Avoid crossing behind objects. Furniture or other people passing in front of the body cause dropped frames and jumps.
  • Keep clips short. Film one move at a time, a few seconds each. Short clips are easier on VRAM and easier to clean up and loop.
  • Add a still pose. Start and end each take with the person standing still for a second. That gives you clean frames for the start of an animation and helps the smoothing settle.

If you already have footage with a busy background or several people, run it through SAM 3 first so you have track data for the right person, as covered in my SAM 3 video segmentation guide.

Common Problems and Fixes

Problem Cause Fix
Person missed or wrong person Weak detection Connect bounding boxes; the template note says they improve accuracy “drastically”
Two people swap or merge No tracking Connect SAM 3 track data (needed for multiple people)
Jittery limbs Raw per-frame predictions Raise smoothing window; add bone_smooth_window 7-15 on export
Body floats or wrong scale Field of view guessed Use MoGe for FOV, or enter the real camera FOV
Blank face Expressions not added Keep the Face Expression node; raise eye/brow multipliers
Out of memory Large batch or long clip Lower batch_size, shorter slice, hand refinement off
Model not in list Wrong folder SAM 3D Body goes in models/detection/

FAQ

Is SAM 3D Body free?

Yes. It’s an open-weights model from Meta, and ComfyUI runs it locally for free. Check Meta’s licence terms for commercial use.

Do I need custom nodes?

No. SAM 3D Body support is built into ComfyUI. Update ComfyUI and open the template.

Can it capture more than one person?

Yes, with SAM 3 tracking connected. The template note says SAM 3 is “practically required” for several people in the same clip.

Does it capture facial expressions?

Not by itself. ComfyUI’s Face Expression node adds them using MediaPipe face detection.

Can I use the output in Blender?

Yes. Export as GLB or BVH and import it into Blender, Unity, Unreal or other 3D tools.

Does it work on a single photo?

Yes. A one-frame “video” or a single image gives you one 3D pose.

How much VRAM does it need?

Much less than video generators: the files total about 5.5 GB. Lower batch_size and turn off hand refinement on smaller cards.

Sources

  • ComfyUI source: comfy_extras/nodes_sam3d_body.py (Loader, Predict, Face Expression, Smooth, Render, Create 3D Animation File)
  • Comfy-Org workflow template: utility_sam3d_body and its notes
  • ComfyUI docs: SAM 3D Body model catalog and built-in node pages
  • Comfy-Org/sam-3d-body on Hugging Face
Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a brick-walled loft holding a tablet with a SAM 3D BODY card, hook free mocap from any video