> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-sync-comfy-api-v2-spec-462120c.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI Depth Anything 3 官方示例

> 了解如何在 ComfyUI 中使用 Depth Anything 3 进行单目和多视角深度估计，支持图像和视频输入。

# ComfyUI Depth Anything 3 简介

[Depth Anything 3 (DA3)](https://github.com/ByteDance-Seed/Depth-Anything-3) 来自字节跳动豆包团队，是一个视觉 Transformer，能够从任意视觉输入中恢复空间一致的几何信息，无论是否具有已知的相机位姿。单个 DINO 编码器和统一的深度-射线表示使得同一模型家族能够覆盖单目深度、多视角深度、相机位姿估计和 3D 重建。

主要能力：

* **统一单目与多视角深度**：从单张图像或多张图像估计深度
* **相机位姿估计**：从无序图像集合中恢复相机位置
* **3D 重建**：支持多视角输入
* **视频深度估计**：为视频输入生成逐帧深度序列
* **多种模型变体**：Small、Base、Mono/Metric Large

<Tip>
  <Tabs>
    <Tab title="本地用户">
      请确保你的 ComfyUI 已经更新。

      * [ComfyUI 下载](https://www.comfy.org/download)
      * [ComfyUI 更新教程](/zh/installation/update_comfyui)

      本指南里的工作流可以在[工作流模板](/zh/interface/features/template)中找到。如果找不到，可能是 ComfyUI 没有更新。

      如果加载工作流时有节点缺失，可能原因有：

      1. 你用的不是最新版（每夜版）。
      2. 启动时有些节点导入失败。
    </Tab>

    <Tab title="云端用户">
      * [Cloud](https://cloud.comfy.org) 会在 ComfyUI 稳定版本发布后更新。

      所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。
    </Tab>
  </Tabs>
</Tip>

<Tip>
  ComfyUI 现已原生支持 Depth Anything 3 节点。开始前请确保已更新到最新版本的 [ComfyUI](https://github.com/Comfy-Org/ComfyUI)。
</Tip>

## 模型下载

下载 Depth Anything 3 的模型文件并将其保存到对应的 ComfyUI 文件夹：

* **Small** ([depth\_anything\_3\_small.safetensors](https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_small.safetensors)) — 轻量快速推理
* **Base** ([depth\_anything\_3\_base.safetensors](https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_base.safetensors)) — 平衡性能
* **Mono-Large** ([depth\_anything\_3\_mono\_large.safetensors](https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_mono_large.safetensors)) — 最佳单目深度，含天空检测
* **Metric-Large** ([depth\_anything\_3\_metric\_large.safetensors](https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_metric_large.safetensors)) — 物理度量深度（米级）

```
ComfyUI/
├── models/
│   ├── geometry_estimation/
│   │   ├── depth_anything_3_small.safetensors
│   │   ├── depth_anything_3_base.safetensors
│   │   ├── depth_anything_3_mono_large.safetensors
│   │   └── depth_anything_3_metric_large.safetensors
```

## 示例工作流

<h3 id="utility_depth_anything3_image_depth_estimation">
  Depth Anything 3：图像深度估计
</h3>

上传一张图像，使用 Depth Anything 3 生成深度图。并排查看原始图像与深度输出的对比。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/utility_depth_anything3_image_depth_estimation-1.webp" alt="Depth Anything 3 图像深度估计工作流预览" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=utility_depth_anything3_image_depth_estimation&utm_source=docs&utm_medium=referral&utm_campaign=depth-anything-3">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/utility_depth_anything3_image_depth_estimation.json">
    下载 JSON，或在模板库中搜索“Depth Anything 3：图像深度估计”
  </Card>
</CardGroup>

**输入素材**

将此文件上传到对应的 `LoadImage` 节点：

<CardGroup cols={2}>
  <Card title="retro_futuristic_home.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/retro_futuristic_home.png">
    `LoadImage` 节点 85 · `retro_futuristic_home.png`
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/retro_futuristic_home.png" alt="输入图像" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

### 运行步骤

1. **LoadImage**：加载输入图像
2. **LoadDA3Model**：选择 Depth Anything 3 变体
3. **Run**：点击 Queue 或使用 `Cmd+Enter`
4. 工作流将输出深度图和并排对比图

<Card title="了解 Subgraph" icon="book-open" href="/zh/interface/features/subgraph">
  此工作流使用 Subgraph 节点进行模块化处理。查看 Subgraph 文档，了解如何自定义和扩展工作流。
</Card>

<h3 id="utility_depth_anything3_video_depth_estimation">
  Depth Anything 3：视频深度估计
</h3>

上传视频，逐帧生成深度序列。在 Subgraph 内部，**GetVideoComponents** 将输入视频拆分为帧，**LoadDA3Model** 加载模型，**SetVideoComponents** 将深度帧重新组合为视频输出。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/utility_depth_anything3_video_depth_estimation-1.webp" alt="Depth Anything 3 视频深度估计工作流预览" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=utility_depth_anything3_video_depth_estimation&utm_source=docs&utm_medium=referral&utm_campaign=depth-anything-3">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/utility_depth_anything3_video_depth_estimation.json">
    下载 JSON，或在模板库中搜索“Depth Anything 3：视频深度估计”
  </Card>
</CardGroup>

**输入素材**

将此文件上传到对应的 `LoadVideo` 节点：

<CardGroup cols={2}>
  <Card title="empty_room_assembly.mp4" icon="download" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/empty_room_assembly.mp4">
    `LoadVideo` 节点 87 · `empty_room_assembly.mp4`
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <video controls style={{width: '100%', height: 'auto'}}>
    <source src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/empty_room_assembly.mp4" type="video/mp4" />
  </video>
</div>

### 运行步骤

1. **LoadVideo**：加载输入视频
2. **Select Model**：在 **Small**、**Base**、**Mono-Large** 或 **Metric-Large** 之间选择
3. **Run**：点击 Queue 或使用 `Cmd+Enter`
4. 工作流将输出包含逐帧深度图的视频

<Card title="了解 Subgraph" icon="book-open" href="/zh/interface/features/subgraph">
  此工作流使用 Subgraph 节点进行模块化处理。查看 Subgraph 文档，了解如何自定义和扩展工作流。
</Card>

## 模型变体

| 变体               | head\_type | 天空检测 | 置信度 | 相机解码 | 最佳用途         |
| ---------------- | ---------- | :--: | :-: | :--: | ------------ |
| **Small**        | dualdpt    |   ❌  |  ✅  |   ✅  | 快速推理、移动/边缘设备 |
| **Base**         | dualdpt    |   ❌  |  ✅  |   ✅  | 均衡性能         |
| **Mono-Large**   | dpt        |   ✅  |  ❌  |   ❌  | 带天空检测的单目深度   |
| **Metric-Large** | dpt        |   ✅  |  ❌  |   ❌  | 物理度量深度（米级输出） |

* **Small** 和 **Base** 使用 `dualdpt` 头类型，支持置信度估计和相机解码器，适用于多视角应用。
* **Mono-Large** 和 **Metric-Large** 使用 `dpt` 头类型，支持天空检测。Metric-Large 输出原始米级深度。

## 社区资源

* [Depth Anything 3 GitHub (ByteDance-Seed)](https://github.com/ByteDance-Seed/Depth-Anything-3): 研究论文和代码
* [Comfy-Org/Depth-Anything-3](https://huggingface.co/Comfy-Org/Depth-Anything-3): 官方 ComfyUI 模型权重
