diff --git a/comfy/ldm/sam3d_body/mhr/mhr_utils.py b/comfy/ldm/sam3d_body/mhr/mhr_utils.py index 543137f79..3d0959680 100644 --- a/comfy/ldm/sam3d_body/mhr/mhr_utils.py +++ b/comfy/ldm/sam3d_body/mhr/mhr_utils.py @@ -94,7 +94,7 @@ def batch6DFromXYZ(r, return_9D=False): sy = rs[..., 1] sz = rs[..., 2] - result = torch.empty(list(r.shape[:-1]) + [3, 3], dtype=r.dtype).to(r.device) + result = torch.empty(list(r.shape[:-1]) + [3, 3], dtype=r.dtype, device=r.device) result[..., 0, 0] = cy * cz result[..., 0, 1] = -cx * sz + sx * sy * cz diff --git a/comfy_extras/nodes_sam3d_body.py b/comfy_extras/nodes_sam3d_body.py index 00dbafa61..dbb64ae6d 100644 --- a/comfy_extras/nodes_sam3d_body.py +++ b/comfy_extras/nodes_sam3d_body.py @@ -959,8 +959,8 @@ class SAM3DBody_Render(io.ComfyNode): person_palette_falloff = float(render_style.get("person_palette_falloff", 0.6)) region = str(render_style.get("region", "full_body")) - if region == "hands_only": - hand_mask = pose_data["hand_vert_mask"] + hand_mask = pose_data.get("hand_vert_mask") + if region == "hands_only" and hand_mask is not None: faces_full = np.asarray(pose_data["faces"]) keep = hand_mask[faces_full].all(axis=1) pose_data = dict(pose_data)