Move threshold tensor to denoise mask device

Ensure threshold tensor is on the same device as denoise mask.
This commit is contained in:
jzhang-POP 2026-01-06 16:41:58 +01:00
parent 3cd7b32f1b
commit cc5d177b54

View File

@ -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)