ComfyUI-SAM3D-BodyMod
Fit, stylize, transfer, and camera-drive SAM3D Body MHR pose data in ComfyUI.
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:
shape_profile: reusableSAM3D_BODY_SHAPE_PROFILEfitted_reference_pose: regeneratedMHR_POSE_DATAfor previewing with the native Render 3D Body Pose node
Detection presets:
real_human: keeps fitting close to SAM3D's learned realistic-human estimate.cartoon: permits larger silhouette-driven coefficient changes.
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:
detected: leaves the profile unchanged.ectomorph: projects a slimmer, longer visual target into the MHR identity basis.mesomorph: emphasizes upper torso, shoulders, and thighs with a narrower waist.endomorph: emphasizes abdomen and hip volume.maximize_detected: amplifies all detected shape and proportion coefficients.
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:
camera: preserve the original camera translation.pelvis: keep the pelvis fixed in camera space; recommended for most animation drivers.feet: keep the average ankle position fixed; useful when floor contact matters most.
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:
- left-drag the camera marker to set azimuth/elevation;
- drag empty space to rotate the editor view;
- use the mouse wheel to dolly;
- right-click the sphere to add a keyframe or right-click a marker to remove it;
- left-drag a keyframe marker to change its angle and hover-scroll it to change its distance;
- double-click to reset the editor view.
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 (melMass). 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
- MHR has fixed realistic-human topology and a learned identity basis. Cartoon fitting can approximate proportions but cannot reproduce arbitrary cartoon anatomy, clothing, four-fingered hands, or a custom character mesh.
- A single view cannot determine unseen body depth. Front, three-quarter, and side references improve stability.
- Automatic background masking works best with a plain border. Use an explicit foreground mask for busy backgrounds or light clothing on a light background.
- High preset and exaggeration strengths can leave the reliable part of MHR's learned shape space and distort the mesh.
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.