From cc5d177b5478346e31278aae3900561b6a7325f2 Mon Sep 17 00:00:00 2001 From: jzhang-POP Date: Tue, 6 Jan 2026 16:41:58 +0100 Subject: [PATCH] Move threshold tensor to denoise mask device Ensure threshold tensor is on the same device as denoise mask. --- comfy_extras/nodes_differential_diffusion.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy_extras/nodes_differential_diffusion.py b/comfy_extras/nodes_differential_diffusion.py index 6dfdf466c..d8596077a 100644 --- a/comfy_extras/nodes_differential_diffusion.py +++ b/comfy_extras/nodes_differential_diffusion.py @@ -49,6 +49,9 @@ class DifferentialDiffusion(io.ComfyNode): threshold = (current_ts - ts_to) / (ts_from - ts_to) + # Move the threshold tensor to the same device as denoise mask tensor + threshold = threshold.to(denoise_mask.device) + # Generate the binary mask based on the threshold binary_mask = (denoise_mask >= threshold).to(denoise_mask.dtype)