mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 22:57:03 +08:00
use control_weights in HunyuanDit Controlnet
This commit is contained in:
parent
e724bd542c
commit
4d55f2e28c
@ -337,6 +337,12 @@ class HunYuanControlNet(nn.Module):
|
|||||||
x = block(x, c, text_states, freqs_cis_img)
|
x = block(x, c, text_states, freqs_cis_img)
|
||||||
controls.append(self.after_proj_list[layer](x)) # zero linear for output
|
controls.append(self.after_proj_list[layer](x)) # zero linear for output
|
||||||
|
|
||||||
controls = [control * control_weight for control in controls]
|
control_weights = [1.0 * (control_weight ** float(19 - i)) for i in range(19)]
|
||||||
|
assert len(control_weight) == len(
|
||||||
|
controls
|
||||||
|
), "control_weights and controls should have the same length"
|
||||||
|
controls = [
|
||||||
|
control * weight for control, weight in zip(controls, control_weights)
|
||||||
|
]
|
||||||
|
|
||||||
return {"output": controls}
|
return {"output": controls}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user