SDPose: 비디오 다중 인물 감지
동영상을 업로드하여 인체 포즈를 감지합니다. 동일 장면 내 단일 인물 및 다중 인물 감지를 모두 지원합니다.
정보
이 워크플로는 SDPose-OOD 전신 모델을 사용해 비디오에서 다중 인물 포즈 감지를 수행합니다. LoadVideo로 비디오를 입력하고, GetVideoComponents로 프레임 크기와 FPS를 추출한 다음, 각 프레임을 SDPose 서브그래프(노드 ID 01b6a731-fb78-4070-9a38-c87146da9604)에 전달합니다. 서브그래프 내부에서 객체 감지기가 프레임마다 인물 바운딩 박스를 제안하고, SDPose 전신 체크포인트(sdpose_wholebody_fp16.safetensors)가 몸, 손, 얼굴의 키포인트를 추정합니다. PrimitiveInt 노드가 max_detections를 제어해 군중 장면에서 프레임당 처리할 인원 수를 제한할 수 있습니다.
워크플로는 두 가지 시각화를 출력합니다: DrawBBoxes를 통한 바운딩 박스와, ImageBlend로 원본 프레임에 블렌딩된 포즈 맵 오버레이입니다. ResizeImageMaskNode가 포즈 맵이 소스 프레임 크기와 일치하도록 보장하며, PreviewImage로 내보내기 전 빠르게 확인할 수 있습니다. 마지막으로 CreateVideo가 주석이 달린 프레임을 원본 FPS로 다시 합치고, SaveVideo가 결과를 저장합니다. SDPose 로직은 서브그래프로 패키징되어 있어, 더 세밀한 제어가 필요하면 우클릭해 Unpack Subgraph를 선택하고 내부 임계값이나 라우팅을 조정할 수 있습니다.
제공할 항목
- 워크플로 읽는 중
ComfyUI에서 실행됩니다. 이 워크플로는 이 페이지에서 실행할 수 없습니다. 모든 항목이 로드된 Comfy Cloud에서 열거나, 자체 ComfyUI에서 사용하려면 다운로드하세요.
Cloud에서 사용해 보기워크플로 내부
노드 그래프의 읽기 전용 미리보기입니다. 노드를 편집하려면 Comfy Cloud에서 열거나 다운로드하세요.
Loading the graph
Open full-size workflow preview사용자 지정 노드 필요
- 워크플로 읽는 중
코드에서 이 워크플로 사용하기
가능한 경우 워크플로 그래프와 입력을 기반으로 생성되며, 그렇지 않은 경우 저장된 예시가 표시됩니다. 비용이 발생할 수 있으므로 코드를 실행하기 전에 자격 증명과 엔드포인트를 검토하세요.
What you need
- Runs on
- Comfy Cloud
- 키
- COMFY_API_KEY
유료 Cloud 요금제와 크레딧이 필요합니다.
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"682": {
"class_type": "DrawBBoxes",
"inputs": {
"bboxes": [
"675:678",
0
],
"image": [
"687",
0
]
},
"_meta": {
"title": "Draw BBoxes"
}
},
"687": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"698",
0
],
"resize_type": "scale longer dimension",
"resize_type.longer_size": [
"688",
0
],
"scale_method": "lanczos"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"688": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1024
},
"_meta": {
"title": "Int"
}
},
"690": {
"class_type": "ImageBlend",
"inputs": {
"blend_factor": 0.5,
"blend_mode": "normal",
"image1": [
"682",
0
],
"image2": [
"675:672",
0
]
},
"_meta": {
"title": "Blend Images"
}
},
"694": {
"class_type": "LoadVideo",
"inputs": {
"file": "man_palying_violin.mp4"
},
"_meta": {
"title": "Load Video"
}
},
"695": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"675:692",
1
],
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": [
"675:692",
2
],
"images": [
"690",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"697": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/ComfyUI",
"format": "auto",
"format.codec": "auto",
"video": [
"695",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"698": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"694",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"699": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"675:672",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"675:671": {
"class_type": "SDPoseKeypointExtractor",
"inputs": {
"batch_size": 16,
"bboxes": [
"675:678",
0
],
"image": [
"675:674",
0
],
"model": [
"675:673",
0
],
"vae": [
"675:673",
2
]
},
"_meta": {
"title": "SDPose Keypoint Extractor"
}
},
"675:672": {
"class_type": "SDPoseDrawKeypoints",
"inputs": {
"draw_body": True,
"draw_face": True,
"draw_feet": True,
"draw_hands": True,
"draw_head": True,
"face_point_size": 2,
"keypoints": [
"675:671",
0
],
"score_threshold": 0.5,
"stick_width": 4
},
"_meta": {
"title": "SDPose Draw Keypoints"
}
},
"675:673": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "sdpose_wholebody_fp16.safetensors"
},
"_meta": {
"title": "Load Checkpoint"
}
},
"675:674": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"675:692",
0
],
"resize_type": "scale longer dimension",
"resize_type.longer_size": [
"688",
0
],
"scale_method": "lanczos"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"675:677": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "rt_detr_v4-x-hgnet_fp16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"675:678": {
"class_type": "RTDETR_detect",
"inputs": {
"class_name": "person",
"image": [
"675:674",
0
],
"max_detections": 2,
"model": [
"675:677",
0
],
"threshold": 0.5
},
"_meta": {
"title": "Run Real-Time Detection (RT-DETR)"
}
},
"675:692": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"694",
0
]
},
"_meta": {
"title": "Get Video Components"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)질문과 답변
아니오. 프레임별로 다중 인물 감지 및 포즈 추정을 수행합니다. ID는 프레임 간 유지되지 않습니다. 추적이 필요하면 이 서브그래프 외부에 트래커를 추가하세요.
PrimitiveInt:max_detections를 늘리고, 입력 해상도가 충분한지 확인한 뒤, 필요하면 서브그래프를 풀어서 감지 신뢰도 또는 NMS를 조정하세요. 해상도와 감지 수가 늘면 연산 시간이 증가합니다.
예. 서브그래프를 풀거나 ImageBlend 이전의 포즈 맵 출력에서 분기해 CreateVideo/SaveVideo로 라우팅하세요. 비디오 조립 대신 SaveImage 노드를 추가해 프레임별 이미지를 저장할 수도 있습니다.
LoadVideo와 SaveVideo는 ComfyUI/FFmpeg 설정에 의존합니다. MP4/H.264가 일반적으로 지원됩니다. 포맷 문제가 있으면 입력을 표준 MP4로 트랜스코딩하고 기본 SaveVideo 설정을 유지하세요.