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@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d3bef-9580-7798-aec3-7a009a0f62a4
This commit is contained in:
Jedrzej Kosinski
2026-03-29 18:37:59 -07:00
co-authored by Amp
parent 2bde95a468
commit fd0acd2b50
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -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:
+2 -1
View File
@@ -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"