From e659df2be6235b1e7e4a908e27e521dfa0e48e26 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 26 Jul 2026 14:09:23 +0300 Subject: [PATCH] RenderMesh: Make opacity affect mesh when not using background too --- comfy_extras/nodes_sam3d_body.py | 5 ++++- comfy_extras/sam3d_body/rasterizer.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/comfy_extras/nodes_sam3d_body.py b/comfy_extras/nodes_sam3d_body.py index a48d1a85d..12cba4e3b 100644 --- a/comfy_extras/nodes_sam3d_body.py +++ b/comfy_extras/nodes_sam3d_body.py @@ -669,7 +669,10 @@ def _render_mesh_mode_inputs(): "'depth' = linear gray." ), ), - io.Float.Input("opacity", default=1.0, min=0.0, max=1.0, step=0.01), + io.Float.Input( + "opacity", default=1.0, min=0.0, max=1.0, step=0.01, + tooltip="Mesh alpha over the background image, or over black when none is connected.", + ), io.Float.Input( "person_palette_falloff", default=0.6, min=0.1, max=1.0, step=0.05, diff --git a/comfy_extras/sam3d_body/rasterizer.py b/comfy_extras/sam3d_body/rasterizer.py index 2b2b2259b..b6c590a52 100644 --- a/comfy_extras/sam3d_body/rasterizer.py +++ b/comfy_extras/sam3d_body/rasterizer.py @@ -463,5 +463,7 @@ def render_pose_data_torch( if opacity != 1.0: a = a * float(opacity) rendered = torch.lerp(bg, rendered, a) + elif opacity != 1.0: + rendered = rendered * float(opacity) return rendered