> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# SAM 3D Body: Extract 3D Human Mesh From Video in ComfyUI

> Extract a full-body 3D human mesh from a video using SAM 3D Body, with pose and shape estimation, face expressions, and a rendered mesh overlay video.

**SAM 3D Body** is an open-source model that recovers a full-body 3D human mesh from a single video. It combines video tracking, person detection, and mesh prediction to reconstruct the human body with pose, shape, and face expressions, then renders the recovered rig back onto the video.

The workflow is useful for motion capture prototyping, biomechanics analysis, and character animation previsualization.

<h3 id="utility_sam3d_body">
  SAM 3D Body: 3D Human Mesh Extraction From Video
</h3>

Load a video of a person. Extract a full-body 3D human mesh with pose, shape, and face expressions, rendered as an overlay video.

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/utility_sam3d_body-1.webp" alt="SAM 3D Body workflow preview" />

<Tip>
  <Tabs>
    <Tab title="Local users">
      Make sure your ComfyUI is updated.

      * [Download ComfyUI](https://www.comfy.org/download)
      * [Update Guide](/installation/update_comfyui)

      Workflows in this guide can be found in the [Workflow Templates](/interface/features/template).
      If you can't find them in the template, your ComfyUI may be outdated.

      If nodes are missing when loading a workflow, possible reasons:

      1. You are not using the latest ComfyUI version (Nightly version)
      2. Some nodes failed to import at startup
    </Tab>

    <Tab title="Cloud users">
      * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.

      So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.
    </Tab>
  </Tabs>
</Tip>

<CardGroup cols={2}>
  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=utility_sam3d_body&utm_source=docs&utm_medium=referral&utm_campaign=sam3d-body">
    Run this workflow instantly on Comfy Cloud
  </Card>

  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/utility_sam3d_body.json">
    Download JSON or search "SAM 3D Body: 3D Human Mesh Extraction From Video" in Template Library
  </Card>
</CardGroup>

**Input materials**

Upload this file to the `LoadVideo` node:

<CardGroup cols={1}>
  <Card title="woman_holding_water_glass.mp4" icon="video" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/woman_holding_water_glass.mp4">
    `LoadVideo` node 85 · `woman_holding_water_glass.mp4`
  </Card>
</CardGroup>

## How it works

1. **Video tracking**: SAM3 tracks the person across the video frames. Tracking is practically required when multiple people appear in the clip, and improves detection accuracy in general
2. **Person detection**: RT-DETR detects the person bounding boxes, guided by the text prompt (`person`)
3. **Mesh prediction**: SAM 3D Body predicts the full-body 3D mesh from the tracked frames, with optional MoGe camera FOV for more accurate alignment with the source video
4. **Face expressions**: a MediaPipe-based step adds face expressions, which the base model does not detect
5. **Smoothing**: the mesh sequence is smoothed over time
6. **Rendering**: a pose file (GLB) is built and the mesh is rendered back onto the video, then saved as an output video

## Steps to run

1. **Load a video**: use the `LoadVideo` node to load a video of a person
2. **Queue the workflow**: press Ctrl (Cmd on macOS) + Enter
3. **Wait for the pipeline**: tracking, detection, mesh prediction, and rendering run in sequence
4. **View the result**: inspect the mesh in the `Preview3D` node. The overlay video is saved to `ComfyUI/output/video/SAM3D_body/`

## Model downloads

Download the SAM 3D Body model and required files. Place them in the corresponding `models/` subdirectories.

<CardGroup cols={2}>
  <Card title="SAM3 multiplex checkpoint" icon="download" href="https://huggingface.co/Comfy-Org/sam3.1/blob/main/checkpoints/sam3.1_multiplex_fp16.safetensors">
    sam3.1\_multiplex\_fp16.safetensors: SAM3 multiplex checkpoint for video tracking
  </Card>

  <Card title="SAM 3D Body detection" icon="download" href="https://huggingface.co/Comfy-Org/sam-3d-body/blob/main/detection/sam_3d_body_dinov3_bf16.safetensors">
    sam\_3d\_body\_dinov3\_bf16.safetensors: SAM 3D Body detection model (DINOv3 backbone)
  </Card>

  <Card title="MoGe geometry" icon="download" href="https://huggingface.co/Comfy-Org/MoGe/blob/main/geometry_estimation/moge_2_vitl_normal_fp16.safetensors">
    moge\_2\_vitl\_normal\_fp16.safetensors: optional camera FOV estimation for alignment
  </Card>

  <Card title="RT-DETR person detector" icon="download" href="https://huggingface.co/Comfy-Org/SDPose/blob/main/diffusion_models/rt_detr_v4-x-hgnet_fp32.safetensors">
    rt\_detr\_v4-x-hgnet\_fp32.safetensors: RT-DETR person detection model
  </Card>
</CardGroup>

### Model storage location

```
📂 ComfyUI/
├── 📂 models/
│   ├── 📂 checkpoints/
│   │      └── sam3.1_multiplex_fp16.safetensors
│   ├── 📂 detection/
│   │      └── sam_3d_body_dinov3_bf16.safetensors
│   ├── 📂 geometry_estimation/
│   │      └── moge_2_vitl_normal_fp16.safetensors
│   └── 📂 diffusion_models/
│          └── rt_detr_v4-x-hgnet_fp32.safetensors
```
