From ad07796777356d548a5d65c000652e54c6dfc08c Mon Sep 17 00:00:00 2001 From: Kadir Nar Date: Sat, 12 Oct 2024 03:37:50 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Add=20device=20to=20variable?= =?UTF-8?q?=20c=20(#5210)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comfy/controlnet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/comfy/controlnet.py b/comfy/controlnet.py index 37914e5fe..1d24afa6f 100644 --- a/comfy/controlnet.py +++ b/comfy/controlnet.py @@ -237,6 +237,7 @@ class ControlNet(ControlBase): if len(self.extra_concat_orig) > 0: to_concat = [] for c in self.extra_concat_orig: + c = c.to(self.cond_hint.device) c = comfy.utils.common_upscale(c, self.cond_hint.shape[3], self.cond_hint.shape[2], self.upscale_algorithm, "center") to_concat.append(comfy.utils.repeat_to_batch_size(c, self.cond_hint.shape[0])) self.cond_hint = torch.cat([self.cond_hint] + to_concat, dim=1) From 6632365e16cb7bde5c0f72205144286801f1412e Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 11 Oct 2024 20:51:19 -0400 Subject: [PATCH 2/2] model_options consistency between functions. weight_dtype -> dtype --- comfy/sd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/sd.py b/comfy/sd.py index 97d6b2e95..67b4ff0cf 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -584,7 +584,7 @@ def load_state_dict_guess_config(sd, output_vae=True, output_clip=True, output_c unet_weight_dtype.append(weight_dtype) model_config.custom_operations = model_options.get("custom_operations", None) - unet_dtype = model_options.get("weight_dtype", None) + unet_dtype = model_options.get("dtype", model_options.get("weight_dtype", None)) if unet_dtype is None: unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=unet_weight_dtype)