Fixed device mismatch issue for ControlNet++, SparseCtrl, and SVDControlNet
This commit is contained in:
@@ -326,7 +326,7 @@ class SVDControlNetAdvanced(ControlNetAdvanced):
|
||||
# uses 'y' in new ComfyUI update
|
||||
y = cond.get('y', None)
|
||||
if y is not None:
|
||||
y = y.to(dtype)
|
||||
y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device)
|
||||
timestep = self.model_sampling_current.timestep(t)
|
||||
x_noisy = self.model_sampling_current.calculate_input(t, x_noisy)
|
||||
# concat c_concat if exists (should exist for SVD), doubling channels to 8
|
||||
@@ -459,7 +459,7 @@ class SparseCtrlAdvanced(ControlNetAdvanced):
|
||||
context = cond['c_crossattn']
|
||||
y = cond.get('y', None)
|
||||
if y is not None:
|
||||
y = y.to(dtype)
|
||||
y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device)
|
||||
timestep = self.model_sampling_current.timestep(t)
|
||||
x_noisy = self.model_sampling_current.calculate_input(t, x_noisy)
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ from comfy.controlnet import ControlNet
|
||||
#from comfy.t2i_adapter.adapter import ResidualAttentionBlock
|
||||
from comfy.ldm.modules.attention import optimized_attention
|
||||
import comfy.ops
|
||||
import comfy.model_base
|
||||
import comfy.model_management
|
||||
import comfy.model_detection
|
||||
import comfy.utils
|
||||
@@ -339,7 +340,7 @@ class ControlNetPlusPlusAdvanced(ControlNet, AdvancedControlBase):
|
||||
context = cond.get('crossattn_controlnet', cond['c_crossattn'])
|
||||
y = cond.get('y', None)
|
||||
if y is not None:
|
||||
y = y.to(dtype)
|
||||
y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device)
|
||||
timestep = self.model_sampling_current.timestep(t)
|
||||
x_noisy = self.model_sampling_current.calculate_input(t, x_noisy)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user