ComfyUI-SAM3D-BodyMod-README.md

ComfyUI-SAM3D-BodyMod

Custom nodes for estimating, stylizing, and transferring MHR body shapes, plus camera-orbit control for native ComfyUI SAM3D Body pose data.

The pack uses ComfyUI's native SAM3D_BODY_MODEL and MHR_POSE_DATA types. It does not modify the SAM3D checkpoint or add another model dependency.

Nodes

Detect SAM3D Body Shape

Runs the native SAM3D Body predictor on one or more reference images, aggregates the selected person's 45 shape and 28 scale coefficients, and optionally refines them against the reference silhouette.

Outputs:

Detection presets:

fit_strength controls only the silhouette correction. recognition_exaggeration scales all detected deviations from MHR's mean shape and mean proportions: 1 preserves the estimate, values above 1 exaggerate it, and 0 returns to the mean coefficients.

Connect a clean foreground mask when possible. mask_polarity=auto accepts both ordinary white-subject masks and the inverted alpha mask produced by ComfyUI's Load Image node. Without a mask, the node estimates the background color from the image border.

SAM3D Body Type Preset

Stylizes an existing shape profile before it is applied to animation:

The named body types are artistic controls, not physiological or medical classifications. They do not rely on guessed PCA component meanings: the node constructs a geometric target on MHR's canonical body and projects it into the model's actual 45-component identity basis. strength=0 is unchanged; higher values increase the effect.

Apply SAM3D Body Shape

Applies the profile to animated MHR_POSE_DATA. Surface identity and skeletal proportions have independent strengths. The node re-runs MHR and updates vertices, 2D/3D keypoints, joint positions and rotations, face landmarks, camera translation, and packed model parameters.

Anchoring options:

Drive SAM3D Body Camera

Orbits the camera around every frame of MHR_POSE_DATA, then reprojects the native mesh, body/face keypoints, and joints. Connect its output to Render 3D Body Pose.

Static controls are azimuth, elevation, distance, and optional vertical fov. The built-in camera handle supports:

Set frame_count to the pose sequence length before placing keyframes. The first right-click captures the current static camera and adds the new camera position. Two keyframes enable use_keyframes. Frame numbers are 1-based and stored in the editable keyframes JSON field. linear paths use straight segments; smooth uses Catmull-Rom interpolation through three or more markers. Azimuth interpolation follows the shortest route across the ±180-degree seam.

The camera node materializes the selected view into camera-space pose geometry. Put it after shape application, smoothing, and face edits, and use it as the final step before pose rendering. Use the pre-camera pose branch for GLB/BVH export when you want the original body motion rather than a baked view transform.

Basic workflow

Reference image ─ Detect SAM3D Body Shape ─ Body Type Preset ─┐
                                                              │
Motion frames ─ Native SAM3D Body Prediction ─────────────────┤
                                                              ▼
                                                 Apply SAM3D Body Shape
                                                              │
                                                              ▼
                                                   Drive SAM3D Body Camera
                                                              │
                                                              ▼
                                                  Render 3D Body Pose

Several reference views of the same character can be supplied as an image batch. Native estimates are combined with a per-coefficient median, while silhouette fitting shares one profile across up to four representative views.

Example workflow

LTX 2.3 SAM3D BodyMod camera workflow is an advanced image-and-video example based on an original workflow by Mel Massadian (0). Burgstall Labs added the SAM3D BodyMod reference-image shape detection, animated-pose shape application, and keyframed camera-drive path.

It uses Kijai’s LTX 2.3 SAM3D Body IC-LoRA, available from the Kijai/LTX2-IC-LoRAs model repository.

It detects motion from driver_motion.mp4, estimates the character shape from character_reference.png, applies that profile to every detected body frame, and drives the native SAM3D renderer through a five-keyframe camera path before using the result as LTX 2.3 video guidance.

The workflow uses current native ComfyUI SAM3/SAM3D Body and LTX 2.3 nodes plus KJNodes. Select locally available files in its model, LoRA, VAE, text-encoder, image, and video loaders after opening it; filenames saved in the workflow are examples and model files are not included. See the example workflow notes for attribution and setup details.

Limitations

Attribution and license

The camera editor and keyframe interaction model are adapted from ComfyUI-CrossViewWarp by cseti007, using upstream commit 7c758557c827dfc9a65bab0823b494344d653985 from 2026-07-27. CrossView-specific model coverage graphics were removed because they do not describe SAM3D Body. See NOTICE for the modification notice.

This repository is licensed under Apache License 2.0. See LICENSE.

Installation

Place the repository at:

ComfyUI/custom_nodes/ComfyUI-SAM3D-BodyMod

Restart ComfyUI and refresh the browser. No additional Python packages are required beyond current ComfyUI dependencies.

下载此文件