Skip to content

Commit 7914c47

Browse files
Quick fix for the promax controlnet.
1 parent 79547ef commit 7914c47

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

comfy/cldm/cldm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
transformer_depth_middle=None,
9393
transformer_depth_output=None,
9494
attn_precision=None,
95-
union_controlnet=False,
95+
union_controlnet_num_control_type=None,
9696
device=None,
9797
operations=comfy.ops.disable_weight_init,
9898
**kwargs,
@@ -320,8 +320,8 @@ def __init__(
320320
self.middle_block_out = self.make_zero_conv(ch, operations=operations, dtype=self.dtype, device=device)
321321
self._feature_size += ch
322322

323-
if union_controlnet:
324-
self.num_control_type = 6
323+
if union_controlnet_num_control_type is not None:
324+
self.num_control_type = union_controlnet_num_control_type
325325
num_trans_channel = 320
326326
num_trans_head = 8
327327
num_trans_layer = 1

comfy/controlnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def load_controlnet(ckpt_path, model=None):
414414
new_sd[diffusers_keys[k]] = controlnet_data.pop(k)
415415

416416
if "control_add_embedding.linear_1.bias" in controlnet_data: #Union Controlnet
417-
controlnet_config["union_controlnet"] = True
417+
controlnet_config["union_controlnet_num_control_type"] = controlnet_data["task_embedding"].shape[0]
418418
for k in list(controlnet_data.keys()):
419419
new_k = k.replace('.attn.in_proj_', '.attn.in_proj.')
420420
new_sd[new_k] = controlnet_data.pop(k)

0 commit comments

Comments
 (0)