SAM 3D 바디: 비디오에서 3D 인체 메시 추출
SAM 3D Body를 사용하여 단일 비디오 프레임에서 전체 3D 인체 메시를 추출하고, 텍스트 프롬프트로 포즈와 형태 추정을 개선합니다. 이 워크플로는 하나의 비디오와 하나의 텍스트 프롬프트를 로드한 다음, 복원된 인체 리그를 보여주는 재구성된 비디오를 출력합니다. 모션 캡처...
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. Cloud에서 열어 노드를 살펴보고 변경할 수 있습니다.
Loading the graph
Open full-size workflow preview이 워크플로의 파일
- 출력
- 혼합 출력
- 작성자
- 작성자 정보를 사용할 수 없음
코드에서 이 모델 호출하기
아래 요청은 Playground와 동일하게 준비된 그래프와 설정을 사용합니다. 제출할 때마다 유료 실행이 시작될 수 있으므로 결과를 알 수 없는 제출을 자동으로 재시도하지 마세요.
What you need
- Runs on
- Comfy Cloud
- 키
- COMFY_API_KEY
- 내 파일
- 코드가 해당 URL에서 업로드
유료 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({
"14": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "sam3.1_multiplex_fp16.safetensors"
},
"_meta": {
"title": "Load Checkpoint"
}
},
"15": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"14",
1
],
"text": "person"
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"18": {
"class_type": "SAM3_VideoTrack",
"inputs": {
"conditioning": [
"15",
0
],
"detect_interval": 1,
"detection_threshold": 0.5,
"images": [
"86",
0
],
"max_objects": 4,
"model": [
"14",
0
]
},
"_meta": {
"title": "Run SAM3 Video Track"
}
},
"85": {
"class_type": "LoadVideo",
"inputs": {
"file": "UPLOADED_video_FILENAME"
},
"_meta": {
"title": "Load Video"
}
},
"86": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"125",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"109": {
"class_type": "RTDETR_detect",
"inputs": {
"class_name": "person",
"image": [
"86",
0
],
"max_detections": 100,
"model": [
"111",
0
],
"threshold": 0.5
},
"_meta": {
"title": "Run Real-Time Detection (RT-DETR)"
}
},
"111": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "rt_detr_v4-x-hgnet_fp32.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"114": {
"class_type": "MoGeInference",
"inputs": {
"apply_mask": True,
"batch_size": 4,
"force_projection": True,
"fov_x_degrees": 0,
"image": [
"86",
0
],
"moge_model": [
"115",
0
],
"refine_steps": 3,
"resolution_level": 9
},
"_meta": {
"title": "Run MoGe Inference"
}
},
"115": {
"class_type": "LoadMoGeModel",
"inputs": {
"model_name": "moge_2_vitl_normal_fp16.safetensors"
},
"_meta": {
"title": "Load MoGe Model"
}
},
"119": {
"class_type": "SAM3DBody_Loader",
"inputs": {
"model_file": "sam_3d_body_dinov3_bf16.safetensors"
},
"_meta": {
"title": "Load SAM3D Body Model"
}
},
"125": {
"class_type": "Video Slice",
"inputs": {
"duration": 5,
"start_time": 0,
"strict_duration": False,
"video": [
"85",
0
]
},
"_meta": {
"title": "Trim Video"
}
},
"126": {
"class_type": "MoGeGeometryToFOV",
"inputs": {
"axis": "vertical",
"moge_geometry": [
"114",
0
],
"unit": "degrees"
},
"_meta": {
"title": "Get FoV from MoGe Geometry"
}
},
"127": {
"class_type": "BuildPoseFile",
"inputs": {
"camera_translation": "off",
"format": "glb",
"format.bone_smooth_window": 0,
"format.mesh_style": "scail",
"format.mesh_style.face_style": "full",
"format.mesh_style.hand_marker_radius_m": 0.005,
"format.mesh_style.hand_stick_radius_m": 0.003,
"format.mesh_style.include_hands": False,
"format.mesh_style.marker_radius_m": 0,
"format.mesh_style.material_roughness": 0.3,
"format.mesh_style.stick_radius_m": 0.022,
"fps": 24,
"pose_data": [
"130",
0
],
"sam3d_body_model": [
"119",
0
],
"track_index": -1
},
"_meta": {
"title": "Create 3D Animation File"
}
},
"128": {
"class_type": "SAM3DBody_FaceExpression",
"inputs": {
"blendshape_smooth_window": 7,
"brow_strength": 2,
"eye_strength": 2,
"image": [
"86",
0
],
"input_threshold": 0.02,
"mhr_pose_data": [
"129",
0
],
"mouth_strength": 1,
"sam3d_body_model": [
"119",
0
],
"strength": 1
},
"_meta": {
"title": "Face Expression to SAM3D Body"
}
},
"129": {
"class_type": "SAM3DBody_Predict",
"inputs": {
"batch_size": 64,
"bboxes": [
"109",
0
],
"fov": [
"126",
0
],
"image": [
"86",
0
],
"run_hand_refinement": True,
"sam3d_body_model": [
"119",
0
],
"track_data": [
"18",
0
]
},
"_meta": {
"title": "Run SAM3D Body Prediction"
}
},
"130": {
"class_type": "SAM3DBody_Smooth",
"inputs": {
"method": "gaussian",
"mhr_pose_data": [
"128",
0
],
"rotation_threshold_degrees": 15,
"strength": 1,
"window": 7
},
"_meta": {
"title": "Smooth SAM3D Body Pose Data"
}
},
"131": {
"class_type": "SAM3DBody_Render",
"inputs": {
"background": [
"86",
0
],
"height": 0,
"pose_data": [
"130",
0
],
"render_style": "mesh",
"render_style.opacity": 1,
"render_style.person_palette_falloff": 0.6,
"render_style.region": "full_body",
"render_style.shader": "default",
"width": 0
},
"_meta": {
"title": "Render 3D Body Pose"
}
},
"134": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": 8,
"chroma_subsampling": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": [
"86",
2
],
"images": [
"131",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"135": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "video/SAM3D_body",
"format": "auto",
"format.codec": "auto",
"video": [
"134",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"143": {
"class_type": "Save3DAdvanced",
"inputs": {
"filename_prefix": "3d/ComfyUI",
"height": 1024,
"model_3d": [
"127",
0
],
"viewport_state": "",
"width": 1024
},
"_meta": {
"title": "Save 3D (Advanced)"
}
}
})
workflow.set_input("85", "file", client.assets.from_url("https://comfy.org/catalog-media/e1cb8b80-9432-4843-972e-ba32d4b6b78c/0d9e9cc0-4cb8-42ef-a403-62a149b6812e"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("135"):
output.to_file(output.name)예시 사용해 보기
이 워크플로 정보
This is motion capture without a suit: SAM 3D Body segments the person out of each frame, predicts a parametric body with expression and hand poses, smooths the track and writes a pose file you can bring into a 3D tool — an actor's performance stays as data instead of reference video. The pipeline is layered: SAM 3.1 handles video-object tracking, RT-DETR supplies person boxes, MoGe estimates the field of view so the pose sits in the right perspective, and the SAM 3D Body model predicts the mesh. Hand refinement and face expression are switches on the graph, and the render pass draws the mesh back over the source frame so you can see whether the fit is right.
Graph: LoadVideo -> Video Slice -> GetVideoComponents -> SAM3_VideoTrack + RTDETR_detect + MoGeGeometryToFOV -> SAM3DBody_Predict -> SAM3DBody_FaceExpression -> SAM3DBody_Smooth -> BuildPoseFile (glb) -> Save3DAdvanced; SAM3DBody_Render -> CreateVideo -> SaveVideo.
관련 워크플로
- Hunyuan3D
HunYuan3D: 텍스트에서 모델로
- IIdol, TripoSplat
Idol: 이미지를 가우시안 스플랫으로
- Meshy
Meshy T2.5: 이미지를 모델로 (스마트 토폴로지)
- Meshy
Meshy T2.5: 텍스트에서 모델로 (스마트 토폴로지)
- Meshy
Meshy: 이미지를 부조로
- MMoGe
MoGe: 원근 기하학 추정
- MMoGe
MoGe: 파노라마에서 메시로
- RRodin
Rodin Gen2.5: 이미지에서 모델로
- RRodin
Rodin Gen2.5: 텍스트를 모델로
- Tripo
Tripo H3.1: 멀티뷰에서 모델로
- Tripo
Tripo H3.1: 이미지에서 모델로
- Tripo
Tripo H3.1: 텍스트에서 모델로