From 4eb48f92bbc8b4a83f0b09e15e740f8a63cf483f Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 30 Jun 2026 18:12:42 +0300 Subject: [PATCH] Support mixed precision ops --- comfy_extras/nodes_sam3d_body.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/comfy_extras/nodes_sam3d_body.py b/comfy_extras/nodes_sam3d_body.py index dbb64ae6d..865bbce94 100644 --- a/comfy_extras/nodes_sam3d_body.py +++ b/comfy_extras/nodes_sam3d_body.py @@ -69,7 +69,13 @@ class SAM3DBody_Loader(io.ComfyNode): device=load_device, model_params=-1, weight_dtype=weight_dtype, ) manual_cast_dtype = comfy.model_management.unet_manual_cast(torch_dtype, load_device) - operations = comfy.ops.pick_operations(torch_dtype, manual_cast_dtype, load_device=load_device, disable_fast_fp8=True) + + quant_config = comfy.utils.detect_layer_quantization(sd, "") + if quant_config is not None: + operations = comfy.ops.mixed_precision_ops(quant_config, torch_dtype) + logging.info("SAM3D-Body: detected mixed precision quantization, using MixedPrecisionOps") + else: + operations = comfy.ops.pick_operations(torch_dtype, manual_cast_dtype, load_device=load_device, disable_fast_fp8=True) model = SAM3DBody(dtype=torch_dtype, operations=operations) model.load_state_dict(sd, strict=False)