diff --git a/docs.json b/docs.json index 745c2e746..f37042487 100644 --- a/docs.json +++ b/docs.json @@ -293,7 +293,8 @@ "tutorials/utility/video-upscale", "tutorials/utility/void-video-inpainting", "tutorials/utility/video-segment-sam3", - "tutorials/utility/remove-background-birefnet" + "tutorials/utility/remove-background-birefnet", + "tutorials/utility/pose-detection-sdpose" ] }, { @@ -2415,7 +2416,8 @@ "zh/tutorials/utility/video-upscale", "zh/tutorials/utility/void-video-inpainting", "zh/tutorials/utility/video-segment-sam3", - "zh/tutorials/utility/remove-background-birefnet" + "zh/tutorials/utility/remove-background-birefnet", + "zh/tutorials/utility/pose-detection-sdpose" ] }, { @@ -4542,7 +4544,8 @@ "ja/tutorials/utility/video-upscale", "ja/tutorials/utility/void-video-inpainting", "ja/tutorials/utility/video-segment-sam3", - "ja/tutorials/utility/remove-background-birefnet" + "ja/tutorials/utility/remove-background-birefnet", + "ja/tutorials/utility/pose-detection-sdpose" ] }, { diff --git a/ja/tutorials/utility/pose-detection-sdpose.mdx b/ja/tutorials/utility/pose-detection-sdpose.mdx new file mode 100644 index 000000000..0cfd62ad4 --- /dev/null +++ b/ja/tutorials/utility/pose-detection-sdpose.mdx @@ -0,0 +1,141 @@ +--- +title: "SDPose:ComfyUI ポーズ検出ワークフロー" +sidebarTitle: "SDPose ポーズ検出" +description: "SDPose モデルを使って、ComfyUI で画像や動画からポーズキーポイントとポーズマップを抽出する方法を学びます" +--- + +import UpdateReminder from '/snippets/tutorials/update-reminder.mdx' + + + +SDPose は、画像や動画から人体のキーポイントを抽出する全身ポーズ検出モデルです。RT-DETRv4 物体検出器と組み合わせることで、複数人の検出やドメイン外(OOD)ポーズ推定をサポートし、アニメーションパイプライン、ポーズ駆動生成、モーショントラッキングワークフローに活用できます。 + +SDPose + RT-DETRv4 は ComfyUI でネイティブサポートされており(PR [#12748](https://github.com/Comfy-Org/ComfyUI/pull/12748))、モデルウェイトは Hugging Face 上で提供されています。 + +[Hugging Face の SDPose モデル](https://huggingface.co/Comfy-Org/SDPose) | [RT-DETRv4 論文 (arXiv)](https://arxiv.org/abs/2504.05731) | [SDPose 論文 (arXiv)](https://arxiv.org/abs/2503.07740) + +### 主な強み + +- **全身キーポイント** — 身体、手、顔、足のキーポイントを統合モデルで検出 +- **複数人対応** — 1 枚の画像や動画で複数人を検出・ラベル付け +- **設定可能な出力** — 描写する身体部位(身体・手・顔・足)の選択、線の太さやサイズの調整 +- **バウンディングボックス検出** — しきい値とクラス選択が可能な物体検出機能内蔵 +- **画像と動画対応** — 画像、動画、OOD ポーズ推定にそれぞれ専用ワークフロー + +> **制限事項:** 検出精度は画像解像度と被写体の視認性に依存します。極端に遮蔽された被写体や非常に小さい被写体ではキーポイントが少なくなる可能性があります。 + +## SDPose ワークフロー + +ユースケースに応じて 4 つのワークフローが利用可能です: + +| ワークフロー | 入力 | 出力 | 用途 | +|------------|------|------|------| +| 複数人(画像) | 1 枚の画像 | ポーズマップ + BBox | 集合写真 | +| 複数人(動画) | 動画 | フレームごとのポーズマップ + BBox | 動画ポーズ追跡 | +| OOD 画像→ポーズ | 1 枚の画像 | ポーズマップ | スタイル変換 / 画像→ポーズ | +| OOD 動画→ポーズマップ | 動画 | フレームごとのポーズマップ | 動画→ポーズアニメーション | + +### 1. ワークフローをダウンロード + +ComfyUI を最新バージョンにアップデートし、メニューから `ワークフロー` -> `テンプレートを閲覧` に進み、Utility カテゴリから SDPose ワークフローを見つけてください。 + + + + Comfy Cloud で実行 + + + JSON をダウンロード + + + + + + Comfy Cloud で実行 + + + JSON をダウンロード + + + + + + Comfy Cloud で実行 + + + JSON をダウンロード + + + + + + Comfy Cloud で実行 + + + JSON をダウンロード + + + +### 2. モデルをダウンロード + +SDPose と RT-DETRv4 のモデルウェイトは [Comfy-Org SDPose モデルリポジトリ](https://huggingface.co/Comfy-Org/SDPose) でホストされています。 + +**checkpoints**(SDPose モデル): +- [sdpose_wholebody_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/checkpoints/sdpose_wholebody_fp16.safetensors) + +**diffusion_models**(RT-DETRv4 検出器): +- [rt_detr_v4-x-hgnet_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp16.safetensors)(推奨) +- [rt_detr_v4-x-hgnet_fp32.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp32.safetensors)(フル精度、大容量) + +以下のディレクトリ構造に配置してください: + +``` +📂 ComfyUI/ +└── 📂 models/ + ├── 📂 checkpoints/ + │ └── sdpose_wholebody_fp16.safetensors + └── 📂 diffusion_models/ + ├── rt_detr_v4-x-hgnet_fp16.safetensors + └── rt_detr_v4-x-hgnet_fp32.safetensors +``` + +### 3. ワークフローの使い方 + +#### 複数人(画像) + +- **入力** — `Load Image` ノードで画像を読み込む(例:`group_photo.png`) +- **検出** — `Image to Pose Map (SDPose Multi-Person)` サブグラフが画像を処理し、以下を出力: + - **IMAGE** — 画像に重ねて表示されるポーズスケルトン + - **keypoints** — 生の全身キーポイントデータ + - **bboxes** — バウンディングボックス座標 +- **描画オプション** — 描画する身体部位を設定: + - `draw_body`、`draw_hands`、`draw_face`、`draw_feet` — 表示切替 + - `stick_width`、`face_point_size` — 描画スタイル調整 + - `score_threshold` — キーポイント表示の最低信頼度 +- **検出オプション**: + - `resize_type.longer_size` — 検出前の長辺スケーリング + - `max_detections` — 最大検出人数 + - `detect_threshold` — 検出信頼度しきい値 + - `detect_class` — 検出する物体クラス(デフォルト:person) + +#### 複数人(動画) + +画像ワークフローと同じノード構成で、動画フレームを逐次処理します。`Load Video` で動画を入力し、`Save Video` で結果を出力します。 + +#### OOD 画像→ポーズ + +SDPose モデルを使用し、画像からバウンディングボックスなしのクリーンなポーズマップを生成します。スタイル変換など、1 つの画像からスケルトンポーズを抽出して別の画像に適用する用途に適しています。 + +#### OOD 動画→ポーズマップ + +動画からフレームごとのポーズマップを生成します。出力は各フレームにポーズスケルトンが含まれた動画ファイルで、下流のアニメーションや ControlNet ワークフローで使用できます。 + + + これらのワークフローは Subgraph ノードを使用してモジュール化された処理を実現しています。Subgraph ドキュメントでワークフローのカスタマイズと拡張方法を学んでください。 + + +## 補足説明 + +- **モデルディレクトリ** — SDPose チェックポイントは `models/checkpoints/`、RT-DETRv4 検出器は `models/diffusion_models/` に配置 +- **テスト画像** — `group_photo.png` は workflow template の `input/` ディレクトリで提供されています +- **キーポイント出力** — POSE_KEYPOINT タイプは姿勢データを受け入れる下流ノードに接続可能 +- **更新が必要** — SDPose + RT-DETRv4 を利用するには最新バージョンの ComfyUI が必要です diff --git a/tutorials/utility/pose-detection-sdpose.mdx b/tutorials/utility/pose-detection-sdpose.mdx new file mode 100644 index 000000000..9f8bd07b1 --- /dev/null +++ b/tutorials/utility/pose-detection-sdpose.mdx @@ -0,0 +1,141 @@ +--- +title: "SDPose: Pose Detection in ComfyUI" +sidebarTitle: "SDPose pose detection" +description: "Learn how to extract pose keypoints and maps from images and videos using SDPose, natively supported in ComfyUI" +--- + +import UpdateReminder from '/snippets/tutorials/update-reminder.mdx' + + + +SDPose is a whole-body pose detection model that extracts human keypoints from images and videos. Combined with the RT-DETRv4 object detector, it supports multi-person detection and out-of-domain (OOD) pose estimation, making it a versatile tool for animation pipelines, pose-driven generation, and motion tracking workflows. + +SDPose + RT-DETRv4 are natively supported in ComfyUI (PR [#12748](https://github.com/Comfy-Org/ComfyUI/pull/12748)). The model weights are available on Hugging Face. + +[SDPose Model on Hugging Face](https://huggingface.co/Comfy-Org/SDPose) | [RT-DETRv4 Paper (arXiv)](https://arxiv.org/abs/2504.05731) | [SDPose Paper (arXiv)](https://arxiv.org/abs/2503.07740) + +### Key strengths + +- **Whole-body keypoints** — detects body, hands, face, and feet keypoints in a unified model +- **Multi-person support** — detects and labels multiple people in a single image or video +- **Configurable outputs** — choose which body parts to visualize (body, hands, face, feet) and control stick/font size +- **Bounding box detection** — includes object detection with tunable thresholds and class selection +- **Image and video support** — dedicated workflows for single images, videos, and OOD pose estimation + +> **Limitations:** Detection accuracy depends on image resolution and subject visibility. Extremely occluded or very small subjects may produce fewer keypoints. + +## SDPose Workflows + +Four workflows are available depending on your use case: + +| Workflow | Input | Output | Use Case | +|----------|-------|--------|----------| +| Multi-Person (Image) | Single image | Pose map + BBoxes | Photos with multiple people | +| Multi-Person (Video) | Video | Per-frame pose map + BBoxes | Video pose tracking | +| OOD Image to Pose | Single image | Pose map | Style transfer / image-to-pose | +| OOD Video to Pose Map | Video | Per-frame pose map | Video-to-pose animation | + +### 1. Download Workflows + +Update your ComfyUI to the latest version, then go to `Workflow` -> `Browse Templates` and find SDPose workflows under the Utility category. + + + + Run in Comfy Cloud + + + Download JSON + + + + + + Run in Comfy Cloud + + + Download JSON + + + + + + Run in Comfy Cloud + + + Download JSON + + + + + + Run in Comfy Cloud + + + Download JSON + + + +### 2. Download Models + +The SDPose and RT-DETRv4 model checkpoints are hosted on the [Comfy-Org SDPose model repository](https://huggingface.co/Comfy-Org/SDPose). + +**checkpoints** (SDPose model): +- [sdpose_wholebody_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/checkpoints/sdpose_wholebody_fp16.safetensors) + +**diffusion_models** (RT-DETRv4 detector): +- [rt_detr_v4-x-hgnet_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp16.safetensors) (recommended) +- [rt_detr_v4-x-hgnet_fp32.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp32.safetensors) (full precision, larger) + +Place them in the following directory structure: + +``` +📂 ComfyUI/ +└── 📂 models/ + ├── 📂 checkpoints/ + │ └── sdpose_wholebody_fp16.safetensors + └── 📂 diffusion_models/ + ├── rt_detr_v4-x-hgnet_fp16.safetensors + └── rt_detr_v4-x-hgnet_fp32.safetensors +``` + +### 3. Using the Workflows + +#### Multi-Person (Image) + +- **Input** — Load an image via the `Load Image` node. Use an image with one or more people (example: `group_photo.png`). +- **Detection** — The `Image to Pose Map (SDPose Multi-Person)` subgraph processes the image and outputs: + - **IMAGE** — pose skeleton visualization overlaid on the image + - **keypoints** — raw whole-body keypoint data + - **bboxes** — bounding box coordinates +- **Drawing Options** — Configure which body parts to draw: + - `draw_body`, `draw_hands`, `draw_face`, `draw_feet` — toggle visibility + - `stick_width`, `face_point_size` — adjust visual style + - `score_threshold` — minimum confidence for displaying keypoints +- **Detection Options**: + - `resize_type.longer_size` — scale the longer dimension before detection + - `max_detections` — maximum number of people to detect + - `detect_threshold` — detection confidence threshold + - `detect_class` — object class to detect (default: person) + +#### Multi-Person (Video) + +Same as the image workflow but processes video frames sequentially. Use `Load Video` to input a video file and `Save Video` to export the result. + +#### OOD Image to Pose + +Uses the SDPose model to generate a clean pose map from an image, without bounding box visualization. This is useful for style transfer where you want to extract the skeleton pose from one image and apply it to another. + +#### OOD Video to Pose Map + +Generates per-frame pose maps from a video. The output is a video file where each frame contains the extracted pose skeleton, suitable for downstream animation or ControlNet workflows. + + + These workflows use Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflows. + + +## Additional Notes + +- **Model directory** — the SDPose checkpoint goes in `models/checkpoints/`, and the RT-DETRv4 detector goes in `models/diffusion_models/` +- **Input image example** — the `group_photo.png` file is available in the workflow template's `input/` directory for testing +- **Keypoint output** — the POSE_KEYPOINT type can be connected to downstream nodes that accept pose data for conditional generation +- **Update required** — SDPose + RT-DETRv4 support is available in recent ComfyUI versions. Make sure your ComfyUI is up to date. diff --git a/zh/tutorials/utility/pose-detection-sdpose.mdx b/zh/tutorials/utility/pose-detection-sdpose.mdx new file mode 100644 index 000000000..5186067d5 --- /dev/null +++ b/zh/tutorials/utility/pose-detection-sdpose.mdx @@ -0,0 +1,141 @@ +--- +title: "SDPose:ComfyUI 姿态检测工作流" +sidebarTitle: "SDPose 姿态检测" +description: "学习使用 SDPose 模型在 ComfyUI 中从图像和视频提取姿态关键点和姿态图" +--- + +import UpdateReminder from '/snippets/tutorials/update-reminder.mdx' + + + +SDPose 是一款全身姿态检测模型,可从图像和视频中提取人体关键点。结合 RT-DETRv4 目标检测器,它支持多人检测和域外(OOD)姿态估计,是动画管线、姿态驱动生成和运动追踪工作流的强大工具。 + +SDPose + RT-DETRv4 在 ComfyUI 中获得原生支持(PR [#12748](https://github.com/Comfy-Org/ComfyUI/pull/12748)),模型权重在 Hugging Face 上发布。 + +[Hugging Face 上的 SDPose 模型](https://huggingface.co/Comfy-Org/SDPose) | [RT-DETRv4 论文 (arXiv)](https://arxiv.org/abs/2504.05731) | [SDPose 论文 (arXiv)](https://arxiv.org/abs/2503.07740) + +### 核心优势 + +- **全身关键点** — 统一模型检测身体、手部、面部和脚部关键点 +- **多人支持** — 在单张图像或视频中检测并标注多人 +- **可配置输出** — 选择可视化哪些身体部位(身体、手、脸、脚),调整线条粗细和大小 +- **边界框检测** — 含目标检测功能,可调节阈值和类别选择 +- **图像和视频支持** — 专为图像、视频及 OOD 姿态估计提供独立工作流 + +> **限制:** 检测精度取决于图像分辨率和主体可见度。严重遮挡或极小的主体可能产生较少的关键点。 + +## SDPose 工作流 + +根据使用场景有四个工作流可选: + +| 工作流 | 输入 | 输出 | 用途 | +|--------|------|------|------| +| 多人(图像) | 单张图片 | 姿态图 + 边界框 | 多人照片 | +| 多人(视频) | 视频 | 逐帧姿态图 + 边界框 | 视频姿态追踪 | +| OOD 图像转姿态 | 单张图片 | 姿态图 | 风格迁移 / 图转姿态 | +| OOD 视频转姿态图 | 视频 | 逐帧姿态图 | 视频转姿态动画 | + +### 1. 下载工作流 + +请更新你的 ComfyUI 到最新版本,并通过菜单 `工作流` -> `浏览模板` 找到 Utility 类别下的 SDPose 工作流。 + + + + Open in Comfy Cloud + + + 下载 JSON + + + + + + Open in Comfy Cloud + + + 下载 JSON + + + + + + Open in Comfy Cloud + + + 下载 JSON + + + + + + Open in Comfy Cloud + + + 下载 JSON + + + +### 2. 下载模型 + +SDPose 和 RT-DETRv4 模型权重托管在 [Comfy-Org SDPose 模型仓库](https://huggingface.co/Comfy-Org/SDPose)。 + +**checkpoints**(SDPose 模型): +- [sdpose_wholebody_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/checkpoints/sdpose_wholebody_fp16.safetensors) + +**diffusion_models**(RT-DETRv4 检测器): +- [rt_detr_v4-x-hgnet_fp16.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp16.safetensors)(推荐) +- [rt_detr_v4-x-hgnet_fp32.safetensors](https://huggingface.co/Comfy-Org/SDPose/resolve/main/diffusion_models/rt_detr_v4-x-hgnet_fp32.safetensors)(全精度,体积更大) + +放置到以下目录结构: + +``` +📂 ComfyUI/ +└── 📂 models/ + ├── 📂 checkpoints/ + │ └── sdpose_wholebody_fp16.safetensors + └── 📂 diffusion_models/ + ├── rt_detr_v4-x-hgnet_fp16.safetensors + └── rt_detr_v4-x-hgnet_fp32.safetensors +``` + +### 3. 使用工作流 + +#### 多人姿态(图像) + +- **输入** — 通过 `Load Image` 节点加载图像(例如 `group_photo.png`) +- **检测** — `Image to Pose Map (SDPose Multi-Person)` 子图处理图像并输出: + - **IMAGE** — 叠加在图像上的姿态骨骼可视化 + - **keypoints** — 原始全身关键点数据 + - **bboxes** — 边界框坐标 +- **绘制选项** — 配置要绘制的身体部位: + - `draw_body`、`draw_hands`、`draw_face`、`draw_feet` — 切换可见性 + - `stick_width`、`face_point_size` — 调整视觉样式 + - `score_threshold` — 显示关键点的最低置信度 +- **检测选项**: + - `resize_type.longer_size` — 检测前缩放较长边的尺寸 + - `max_detections` — 最大检测人数 + - `detect_threshold` — 检测置信度阈值 + - `detect_class` — 检测的目标类别(默认为人) + +#### 多人姿态(视频) + +与图像工作流相同,但逐帧处理视频。使用 `Load Video` 输入视频文件,`Save Video` 导出结果。 + +#### OOD 图像转姿态 + +使用 SDPose 模型从图像生成干净的姿态图,不包含边界框可视化。适用于风格迁移场景——从一张图像提取骨骼姿态并应用于另一张图像。 + +#### OOD 视频转姿态图 + +从视频生成逐帧姿态图。输出是一个包含每帧姿态骨骼的视频文件,适用于下游动画或 ControlNet 工作流。 + + + 这些工作流使用了 Subgraph 节点实现模块化处理。查阅 Subgraph 文档了解如何自定义和扩展工作流。 + + +## 补充说明 + +- **模型目录** — SDPose 检查点放在 `models/checkpoints/`,RT-DETRv4 检测器放在 `models/diffusion_models/` +- **测试图片** — `group_photo.png` 已在 workflow template 的 `input/` 目录中提供 +- **关键点输出** — POSE_KEYPOINT 类型可连接至接受姿态数据的下游节点用于条件生成 +- **更新需求** — SDPose + RT-DETRv4 支持需要较新版本的 ComfyUI,请确保已更新到最新版本