From fd0acd2b50d2fd2dc8cfdd43af8e3072f3d9706e Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Sun, 29 Mar 2026 18:14:22 -0700 Subject: [PATCH] fix: update cast_bias_weight to use offloadable=True in clean_groupnorm Use ComfyUI's updated 3-return-value cast_bias_weight API with offloadable=True and call uncast_bias_weight after use for proper async-offload support. Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-019d3bef-9580-7798-aec3-7a009a0f62a4 --- adv_control/utils.py | 6 ++++-- pyproject.toml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/adv_control/utils.py b/adv_control/utils.py index 9edca69..2d380ed 100644 --- a/adv_control/utils.py +++ b/adv_control/utils.py @@ -338,8 +338,10 @@ class AbstractPreprocWrapper: class disable_weight_init_clean_groupnorm(comfy.ops.disable_weight_init): class GroupNorm(comfy.ops.disable_weight_init.GroupNorm): def forward_comfy_cast_weights(self, input): - weight, bias = comfy.ops.cast_bias_weight(self, input) - return torch.nn.functional.group_norm(input, self.num_groups, weight, bias, self.eps) + weight, bias, offload_stream = comfy.ops.cast_bias_weight(self, input, offloadable=True) + x = torch.nn.functional.group_norm(input, self.num_groups, weight, bias, self.eps) + comfy.ops.uncast_bias_weight(self, weight, bias, offload_stream) + return x def forward(self, input): if self.comfy_cast_weights: diff --git a/pyproject.toml b/pyproject.toml index 0dd2feb..d5954db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-advanced-controlnet" description = "Nodes for scheduling ControlNet strength across timesteps and batched latents, as well as applying custom weights and attention masks." -version = "1.5.6" +version = "1.5.7" license = { file = "LICENSE" } dependencies = [] @@ -13,3 +13,4 @@ Repository = "https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet" PublisherId = "kosinkadink" DisplayName = "ComfyUI-Advanced-ControlNet" Icon = "" +requires-comfyui = ">=0.3.68"