diffsynth 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffsynth/__init__.py +6 -0
- diffsynth/configs/__init__.py +0 -0
- diffsynth/configs/model_config.py +243 -0
- diffsynth/controlnets/__init__.py +2 -0
- diffsynth/controlnets/controlnet_unit.py +53 -0
- diffsynth/controlnets/processors.py +51 -0
- diffsynth/data/__init__.py +1 -0
- diffsynth/data/simple_text_image.py +35 -0
- diffsynth/data/video.py +148 -0
- diffsynth/extensions/ESRGAN/__init__.py +118 -0
- diffsynth/extensions/FastBlend/__init__.py +63 -0
- diffsynth/extensions/FastBlend/api.py +397 -0
- diffsynth/extensions/FastBlend/cupy_kernels.py +119 -0
- diffsynth/extensions/FastBlend/data.py +146 -0
- diffsynth/extensions/FastBlend/patch_match.py +298 -0
- diffsynth/extensions/FastBlend/runners/__init__.py +4 -0
- diffsynth/extensions/FastBlend/runners/accurate.py +35 -0
- diffsynth/extensions/FastBlend/runners/balanced.py +46 -0
- diffsynth/extensions/FastBlend/runners/fast.py +141 -0
- diffsynth/extensions/FastBlend/runners/interpolation.py +121 -0
- diffsynth/extensions/RIFE/__init__.py +242 -0
- diffsynth/extensions/__init__.py +0 -0
- diffsynth/models/__init__.py +1 -0
- diffsynth/models/attention.py +89 -0
- diffsynth/models/downloader.py +66 -0
- diffsynth/models/hunyuan_dit.py +451 -0
- diffsynth/models/hunyuan_dit_text_encoder.py +163 -0
- diffsynth/models/kolors_text_encoder.py +1363 -0
- diffsynth/models/lora.py +195 -0
- diffsynth/models/model_manager.py +536 -0
- diffsynth/models/sd3_dit.py +798 -0
- diffsynth/models/sd3_text_encoder.py +1107 -0
- diffsynth/models/sd3_vae_decoder.py +81 -0
- diffsynth/models/sd3_vae_encoder.py +95 -0
- diffsynth/models/sd_controlnet.py +588 -0
- diffsynth/models/sd_ipadapter.py +57 -0
- diffsynth/models/sd_motion.py +199 -0
- diffsynth/models/sd_text_encoder.py +321 -0
- diffsynth/models/sd_unet.py +1108 -0
- diffsynth/models/sd_vae_decoder.py +336 -0
- diffsynth/models/sd_vae_encoder.py +282 -0
- diffsynth/models/sdxl_ipadapter.py +122 -0
- diffsynth/models/sdxl_motion.py +104 -0
- diffsynth/models/sdxl_text_encoder.py +759 -0
- diffsynth/models/sdxl_unet.py +1899 -0
- diffsynth/models/sdxl_vae_decoder.py +24 -0
- diffsynth/models/sdxl_vae_encoder.py +24 -0
- diffsynth/models/svd_image_encoder.py +505 -0
- diffsynth/models/svd_unet.py +2004 -0
- diffsynth/models/svd_vae_decoder.py +578 -0
- diffsynth/models/svd_vae_encoder.py +139 -0
- diffsynth/models/tiler.py +106 -0
- diffsynth/pipelines/__init__.py +9 -0
- diffsynth/pipelines/base.py +34 -0
- diffsynth/pipelines/dancer.py +178 -0
- diffsynth/pipelines/hunyuan_image.py +274 -0
- diffsynth/pipelines/pipeline_runner.py +105 -0
- diffsynth/pipelines/sd3_image.py +132 -0
- diffsynth/pipelines/sd_image.py +173 -0
- diffsynth/pipelines/sd_video.py +266 -0
- diffsynth/pipelines/sdxl_image.py +191 -0
- diffsynth/pipelines/sdxl_video.py +223 -0
- diffsynth/pipelines/svd_video.py +297 -0
- diffsynth/processors/FastBlend.py +142 -0
- diffsynth/processors/PILEditor.py +28 -0
- diffsynth/processors/RIFE.py +77 -0
- diffsynth/processors/__init__.py +0 -0
- diffsynth/processors/base.py +6 -0
- diffsynth/processors/sequencial_processor.py +41 -0
- diffsynth/prompters/__init__.py +6 -0
- diffsynth/prompters/base_prompter.py +57 -0
- diffsynth/prompters/hunyuan_dit_prompter.py +69 -0
- diffsynth/prompters/kolors_prompter.py +353 -0
- diffsynth/prompters/prompt_refiners.py +77 -0
- diffsynth/prompters/sd3_prompter.py +92 -0
- diffsynth/prompters/sd_prompter.py +73 -0
- diffsynth/prompters/sdxl_prompter.py +61 -0
- diffsynth/schedulers/__init__.py +3 -0
- diffsynth/schedulers/continuous_ode.py +59 -0
- diffsynth/schedulers/ddim.py +79 -0
- diffsynth/schedulers/flow_match.py +51 -0
- diffsynth/tokenizer_configs/__init__.py +0 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer/special_tokens_map.json +7 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer/tokenizer_config.json +16 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer/vocab.txt +47020 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer/vocab_org.txt +21128 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer_t5/config.json +28 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer_t5/special_tokens_map.json +1 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer_t5/spiece.model +0 -0
- diffsynth/tokenizer_configs/hunyuan_dit/tokenizer_t5/tokenizer_config.json +1 -0
- diffsynth/tokenizer_configs/kolors/tokenizer/tokenizer.model +0 -0
- diffsynth/tokenizer_configs/kolors/tokenizer/tokenizer_config.json +12 -0
- diffsynth/tokenizer_configs/kolors/tokenizer/vocab.txt +0 -0
- diffsynth/tokenizer_configs/stable_diffusion/tokenizer/merges.txt +48895 -0
- diffsynth/tokenizer_configs/stable_diffusion/tokenizer/special_tokens_map.json +24 -0
- diffsynth/tokenizer_configs/stable_diffusion/tokenizer/tokenizer_config.json +34 -0
- diffsynth/tokenizer_configs/stable_diffusion/tokenizer/vocab.json +49410 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_1/merges.txt +48895 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_1/special_tokens_map.json +30 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_1/tokenizer_config.json +30 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_1/vocab.json +49410 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_2/merges.txt +48895 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_2/special_tokens_map.json +30 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_2/tokenizer_config.json +38 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_2/vocab.json +49410 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_3/special_tokens_map.json +125 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_3/spiece.model +0 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_3/tokenizer.json +129428 -0
- diffsynth/tokenizer_configs/stable_diffusion_3/tokenizer_3/tokenizer_config.json +940 -0
- diffsynth/tokenizer_configs/stable_diffusion_xl/tokenizer_2/merges.txt +40213 -0
- diffsynth/tokenizer_configs/stable_diffusion_xl/tokenizer_2/special_tokens_map.json +24 -0
- diffsynth/tokenizer_configs/stable_diffusion_xl/tokenizer_2/tokenizer_config.json +38 -0
- diffsynth/tokenizer_configs/stable_diffusion_xl/tokenizer_2/vocab.json +49411 -0
- diffsynth/trainers/__init__.py +0 -0
- diffsynth/trainers/text_to_image.py +253 -0
- diffsynth-1.0.0.dist-info/LICENSE +201 -0
- diffsynth-1.0.0.dist-info/METADATA +23 -0
- diffsynth-1.0.0.dist-info/RECORD +120 -0
- diffsynth-1.0.0.dist-info/WHEEL +5 -0
- diffsynth-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import torch
|
|
2
|
+
from .sd_unet import Timesteps, ResnetBlock, AttentionBlock, PushBlock, DownSampler
|
|
3
|
+
from .tiler import TileWorker
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ControlNetConditioningLayer(torch.nn.Module):
|
|
7
|
+
def __init__(self, channels = (3, 16, 32, 96, 256, 320)):
|
|
8
|
+
super().__init__()
|
|
9
|
+
self.blocks = torch.nn.ModuleList([])
|
|
10
|
+
self.blocks.append(torch.nn.Conv2d(channels[0], channels[1], kernel_size=3, padding=1))
|
|
11
|
+
self.blocks.append(torch.nn.SiLU())
|
|
12
|
+
for i in range(1, len(channels) - 2):
|
|
13
|
+
self.blocks.append(torch.nn.Conv2d(channels[i], channels[i], kernel_size=3, padding=1))
|
|
14
|
+
self.blocks.append(torch.nn.SiLU())
|
|
15
|
+
self.blocks.append(torch.nn.Conv2d(channels[i], channels[i+1], kernel_size=3, padding=1, stride=2))
|
|
16
|
+
self.blocks.append(torch.nn.SiLU())
|
|
17
|
+
self.blocks.append(torch.nn.Conv2d(channels[-2], channels[-1], kernel_size=3, padding=1))
|
|
18
|
+
|
|
19
|
+
def forward(self, conditioning):
|
|
20
|
+
for block in self.blocks:
|
|
21
|
+
conditioning = block(conditioning)
|
|
22
|
+
return conditioning
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SDControlNet(torch.nn.Module):
|
|
26
|
+
def __init__(self, global_pool=False):
|
|
27
|
+
super().__init__()
|
|
28
|
+
self.time_proj = Timesteps(320)
|
|
29
|
+
self.time_embedding = torch.nn.Sequential(
|
|
30
|
+
torch.nn.Linear(320, 1280),
|
|
31
|
+
torch.nn.SiLU(),
|
|
32
|
+
torch.nn.Linear(1280, 1280)
|
|
33
|
+
)
|
|
34
|
+
self.conv_in = torch.nn.Conv2d(4, 320, kernel_size=3, padding=1)
|
|
35
|
+
|
|
36
|
+
self.controlnet_conv_in = ControlNetConditioningLayer(channels=(3, 16, 32, 96, 256, 320))
|
|
37
|
+
|
|
38
|
+
self.blocks = torch.nn.ModuleList([
|
|
39
|
+
# CrossAttnDownBlock2D
|
|
40
|
+
ResnetBlock(320, 320, 1280),
|
|
41
|
+
AttentionBlock(8, 40, 320, 1, 768),
|
|
42
|
+
PushBlock(),
|
|
43
|
+
ResnetBlock(320, 320, 1280),
|
|
44
|
+
AttentionBlock(8, 40, 320, 1, 768),
|
|
45
|
+
PushBlock(),
|
|
46
|
+
DownSampler(320),
|
|
47
|
+
PushBlock(),
|
|
48
|
+
# CrossAttnDownBlock2D
|
|
49
|
+
ResnetBlock(320, 640, 1280),
|
|
50
|
+
AttentionBlock(8, 80, 640, 1, 768),
|
|
51
|
+
PushBlock(),
|
|
52
|
+
ResnetBlock(640, 640, 1280),
|
|
53
|
+
AttentionBlock(8, 80, 640, 1, 768),
|
|
54
|
+
PushBlock(),
|
|
55
|
+
DownSampler(640),
|
|
56
|
+
PushBlock(),
|
|
57
|
+
# CrossAttnDownBlock2D
|
|
58
|
+
ResnetBlock(640, 1280, 1280),
|
|
59
|
+
AttentionBlock(8, 160, 1280, 1, 768),
|
|
60
|
+
PushBlock(),
|
|
61
|
+
ResnetBlock(1280, 1280, 1280),
|
|
62
|
+
AttentionBlock(8, 160, 1280, 1, 768),
|
|
63
|
+
PushBlock(),
|
|
64
|
+
DownSampler(1280),
|
|
65
|
+
PushBlock(),
|
|
66
|
+
# DownBlock2D
|
|
67
|
+
ResnetBlock(1280, 1280, 1280),
|
|
68
|
+
PushBlock(),
|
|
69
|
+
ResnetBlock(1280, 1280, 1280),
|
|
70
|
+
PushBlock(),
|
|
71
|
+
# UNetMidBlock2DCrossAttn
|
|
72
|
+
ResnetBlock(1280, 1280, 1280),
|
|
73
|
+
AttentionBlock(8, 160, 1280, 1, 768),
|
|
74
|
+
ResnetBlock(1280, 1280, 1280),
|
|
75
|
+
PushBlock()
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
self.controlnet_blocks = torch.nn.ModuleList([
|
|
79
|
+
torch.nn.Conv2d(320, 320, kernel_size=(1, 1)),
|
|
80
|
+
torch.nn.Conv2d(320, 320, kernel_size=(1, 1), bias=False),
|
|
81
|
+
torch.nn.Conv2d(320, 320, kernel_size=(1, 1), bias=False),
|
|
82
|
+
torch.nn.Conv2d(320, 320, kernel_size=(1, 1), bias=False),
|
|
83
|
+
torch.nn.Conv2d(640, 640, kernel_size=(1, 1)),
|
|
84
|
+
torch.nn.Conv2d(640, 640, kernel_size=(1, 1), bias=False),
|
|
85
|
+
torch.nn.Conv2d(640, 640, kernel_size=(1, 1), bias=False),
|
|
86
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1)),
|
|
87
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1), bias=False),
|
|
88
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1), bias=False),
|
|
89
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1), bias=False),
|
|
90
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1), bias=False),
|
|
91
|
+
torch.nn.Conv2d(1280, 1280, kernel_size=(1, 1), bias=False),
|
|
92
|
+
])
|
|
93
|
+
|
|
94
|
+
self.global_pool = global_pool
|
|
95
|
+
|
|
96
|
+
def forward(
|
|
97
|
+
self,
|
|
98
|
+
sample, timestep, encoder_hidden_states, conditioning,
|
|
99
|
+
tiled=False, tile_size=64, tile_stride=32,
|
|
100
|
+
):
|
|
101
|
+
# 1. time
|
|
102
|
+
time_emb = self.time_proj(timestep).to(sample.dtype)
|
|
103
|
+
time_emb = self.time_embedding(time_emb)
|
|
104
|
+
time_emb = time_emb.repeat(sample.shape[0], 1)
|
|
105
|
+
|
|
106
|
+
# 2. pre-process
|
|
107
|
+
height, width = sample.shape[2], sample.shape[3]
|
|
108
|
+
hidden_states = self.conv_in(sample) + self.controlnet_conv_in(conditioning)
|
|
109
|
+
text_emb = encoder_hidden_states
|
|
110
|
+
res_stack = [hidden_states]
|
|
111
|
+
|
|
112
|
+
# 3. blocks
|
|
113
|
+
for i, block in enumerate(self.blocks):
|
|
114
|
+
if tiled and not isinstance(block, PushBlock):
|
|
115
|
+
_, _, inter_height, _ = hidden_states.shape
|
|
116
|
+
resize_scale = inter_height / height
|
|
117
|
+
hidden_states = TileWorker().tiled_forward(
|
|
118
|
+
lambda x: block(x, time_emb, text_emb, res_stack)[0],
|
|
119
|
+
hidden_states,
|
|
120
|
+
int(tile_size * resize_scale),
|
|
121
|
+
int(tile_stride * resize_scale),
|
|
122
|
+
tile_device=hidden_states.device,
|
|
123
|
+
tile_dtype=hidden_states.dtype
|
|
124
|
+
)
|
|
125
|
+
else:
|
|
126
|
+
hidden_states, _, _, _ = block(hidden_states, time_emb, text_emb, res_stack)
|
|
127
|
+
|
|
128
|
+
# 4. ControlNet blocks
|
|
129
|
+
controlnet_res_stack = [block(res) for block, res in zip(self.controlnet_blocks, res_stack)]
|
|
130
|
+
|
|
131
|
+
# pool
|
|
132
|
+
if self.global_pool:
|
|
133
|
+
controlnet_res_stack = [res.mean(dim=(2, 3), keepdim=True) for res in controlnet_res_stack]
|
|
134
|
+
|
|
135
|
+
return controlnet_res_stack
|
|
136
|
+
|
|
137
|
+
@staticmethod
|
|
138
|
+
def state_dict_converter():
|
|
139
|
+
return SDControlNetStateDictConverter()
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class SDControlNetStateDictConverter:
|
|
143
|
+
def __init__(self):
|
|
144
|
+
pass
|
|
145
|
+
|
|
146
|
+
def from_diffusers(self, state_dict):
|
|
147
|
+
# architecture
|
|
148
|
+
block_types = [
|
|
149
|
+
'ResnetBlock', 'AttentionBlock', 'PushBlock', 'ResnetBlock', 'AttentionBlock', 'PushBlock', 'DownSampler', 'PushBlock',
|
|
150
|
+
'ResnetBlock', 'AttentionBlock', 'PushBlock', 'ResnetBlock', 'AttentionBlock', 'PushBlock', 'DownSampler', 'PushBlock',
|
|
151
|
+
'ResnetBlock', 'AttentionBlock', 'PushBlock', 'ResnetBlock', 'AttentionBlock', 'PushBlock', 'DownSampler', 'PushBlock',
|
|
152
|
+
'ResnetBlock', 'PushBlock', 'ResnetBlock', 'PushBlock',
|
|
153
|
+
'ResnetBlock', 'AttentionBlock', 'ResnetBlock',
|
|
154
|
+
'PopBlock', 'ResnetBlock', 'PopBlock', 'ResnetBlock', 'PopBlock', 'ResnetBlock', 'UpSampler',
|
|
155
|
+
'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock', 'UpSampler',
|
|
156
|
+
'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock', 'UpSampler',
|
|
157
|
+
'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock', 'PopBlock', 'ResnetBlock', 'AttentionBlock'
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
# controlnet_rename_dict
|
|
161
|
+
controlnet_rename_dict = {
|
|
162
|
+
"controlnet_cond_embedding.conv_in.weight": "controlnet_conv_in.blocks.0.weight",
|
|
163
|
+
"controlnet_cond_embedding.conv_in.bias": "controlnet_conv_in.blocks.0.bias",
|
|
164
|
+
"controlnet_cond_embedding.blocks.0.weight": "controlnet_conv_in.blocks.2.weight",
|
|
165
|
+
"controlnet_cond_embedding.blocks.0.bias": "controlnet_conv_in.blocks.2.bias",
|
|
166
|
+
"controlnet_cond_embedding.blocks.1.weight": "controlnet_conv_in.blocks.4.weight",
|
|
167
|
+
"controlnet_cond_embedding.blocks.1.bias": "controlnet_conv_in.blocks.4.bias",
|
|
168
|
+
"controlnet_cond_embedding.blocks.2.weight": "controlnet_conv_in.blocks.6.weight",
|
|
169
|
+
"controlnet_cond_embedding.blocks.2.bias": "controlnet_conv_in.blocks.6.bias",
|
|
170
|
+
"controlnet_cond_embedding.blocks.3.weight": "controlnet_conv_in.blocks.8.weight",
|
|
171
|
+
"controlnet_cond_embedding.blocks.3.bias": "controlnet_conv_in.blocks.8.bias",
|
|
172
|
+
"controlnet_cond_embedding.blocks.4.weight": "controlnet_conv_in.blocks.10.weight",
|
|
173
|
+
"controlnet_cond_embedding.blocks.4.bias": "controlnet_conv_in.blocks.10.bias",
|
|
174
|
+
"controlnet_cond_embedding.blocks.5.weight": "controlnet_conv_in.blocks.12.weight",
|
|
175
|
+
"controlnet_cond_embedding.blocks.5.bias": "controlnet_conv_in.blocks.12.bias",
|
|
176
|
+
"controlnet_cond_embedding.conv_out.weight": "controlnet_conv_in.blocks.14.weight",
|
|
177
|
+
"controlnet_cond_embedding.conv_out.bias": "controlnet_conv_in.blocks.14.bias",
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
# Rename each parameter
|
|
181
|
+
name_list = sorted([name for name in state_dict])
|
|
182
|
+
rename_dict = {}
|
|
183
|
+
block_id = {"ResnetBlock": -1, "AttentionBlock": -1, "DownSampler": -1, "UpSampler": -1}
|
|
184
|
+
last_block_type_with_id = {"ResnetBlock": "", "AttentionBlock": "", "DownSampler": "", "UpSampler": ""}
|
|
185
|
+
for name in name_list:
|
|
186
|
+
names = name.split(".")
|
|
187
|
+
if names[0] in ["conv_in", "conv_norm_out", "conv_out"]:
|
|
188
|
+
pass
|
|
189
|
+
elif name in controlnet_rename_dict:
|
|
190
|
+
names = controlnet_rename_dict[name].split(".")
|
|
191
|
+
elif names[0] == "controlnet_down_blocks":
|
|
192
|
+
names[0] = "controlnet_blocks"
|
|
193
|
+
elif names[0] == "controlnet_mid_block":
|
|
194
|
+
names = ["controlnet_blocks", "12", names[-1]]
|
|
195
|
+
elif names[0] in ["time_embedding", "add_embedding"]:
|
|
196
|
+
if names[0] == "add_embedding":
|
|
197
|
+
names[0] = "add_time_embedding"
|
|
198
|
+
names[1] = {"linear_1": "0", "linear_2": "2"}[names[1]]
|
|
199
|
+
elif names[0] in ["down_blocks", "mid_block", "up_blocks"]:
|
|
200
|
+
if names[0] == "mid_block":
|
|
201
|
+
names.insert(1, "0")
|
|
202
|
+
block_type = {"resnets": "ResnetBlock", "attentions": "AttentionBlock", "downsamplers": "DownSampler", "upsamplers": "UpSampler"}[names[2]]
|
|
203
|
+
block_type_with_id = ".".join(names[:4])
|
|
204
|
+
if block_type_with_id != last_block_type_with_id[block_type]:
|
|
205
|
+
block_id[block_type] += 1
|
|
206
|
+
last_block_type_with_id[block_type] = block_type_with_id
|
|
207
|
+
while block_id[block_type] < len(block_types) and block_types[block_id[block_type]] != block_type:
|
|
208
|
+
block_id[block_type] += 1
|
|
209
|
+
block_type_with_id = ".".join(names[:4])
|
|
210
|
+
names = ["blocks", str(block_id[block_type])] + names[4:]
|
|
211
|
+
if "ff" in names:
|
|
212
|
+
ff_index = names.index("ff")
|
|
213
|
+
component = ".".join(names[ff_index:ff_index+3])
|
|
214
|
+
component = {"ff.net.0": "act_fn", "ff.net.2": "ff"}[component]
|
|
215
|
+
names = names[:ff_index] + [component] + names[ff_index+3:]
|
|
216
|
+
if "to_out" in names:
|
|
217
|
+
names.pop(names.index("to_out") + 1)
|
|
218
|
+
else:
|
|
219
|
+
raise ValueError(f"Unknown parameters: {name}")
|
|
220
|
+
rename_dict[name] = ".".join(names)
|
|
221
|
+
|
|
222
|
+
# Convert state_dict
|
|
223
|
+
state_dict_ = {}
|
|
224
|
+
for name, param in state_dict.items():
|
|
225
|
+
if ".proj_in." in name or ".proj_out." in name:
|
|
226
|
+
param = param.squeeze()
|
|
227
|
+
if rename_dict[name] in [
|
|
228
|
+
"controlnet_blocks.1.bias", "controlnet_blocks.2.bias", "controlnet_blocks.3.bias", "controlnet_blocks.5.bias", "controlnet_blocks.6.bias",
|
|
229
|
+
"controlnet_blocks.8.bias", "controlnet_blocks.9.bias", "controlnet_blocks.10.bias", "controlnet_blocks.11.bias", "controlnet_blocks.12.bias"
|
|
230
|
+
]:
|
|
231
|
+
continue
|
|
232
|
+
state_dict_[rename_dict[name]] = param
|
|
233
|
+
return state_dict_
|
|
234
|
+
|
|
235
|
+
def from_civitai(self, state_dict):
|
|
236
|
+
if "mid_block.resnets.1.time_emb_proj.weight" in state_dict:
|
|
237
|
+
# For controlnets in diffusers format
|
|
238
|
+
return self.from_diffusers(state_dict)
|
|
239
|
+
rename_dict = {
|
|
240
|
+
"control_model.time_embed.0.weight": "time_embedding.0.weight",
|
|
241
|
+
"control_model.time_embed.0.bias": "time_embedding.0.bias",
|
|
242
|
+
"control_model.time_embed.2.weight": "time_embedding.2.weight",
|
|
243
|
+
"control_model.time_embed.2.bias": "time_embedding.2.bias",
|
|
244
|
+
"control_model.input_blocks.0.0.weight": "conv_in.weight",
|
|
245
|
+
"control_model.input_blocks.0.0.bias": "conv_in.bias",
|
|
246
|
+
"control_model.input_blocks.1.0.in_layers.0.weight": "blocks.0.norm1.weight",
|
|
247
|
+
"control_model.input_blocks.1.0.in_layers.0.bias": "blocks.0.norm1.bias",
|
|
248
|
+
"control_model.input_blocks.1.0.in_layers.2.weight": "blocks.0.conv1.weight",
|
|
249
|
+
"control_model.input_blocks.1.0.in_layers.2.bias": "blocks.0.conv1.bias",
|
|
250
|
+
"control_model.input_blocks.1.0.emb_layers.1.weight": "blocks.0.time_emb_proj.weight",
|
|
251
|
+
"control_model.input_blocks.1.0.emb_layers.1.bias": "blocks.0.time_emb_proj.bias",
|
|
252
|
+
"control_model.input_blocks.1.0.out_layers.0.weight": "blocks.0.norm2.weight",
|
|
253
|
+
"control_model.input_blocks.1.0.out_layers.0.bias": "blocks.0.norm2.bias",
|
|
254
|
+
"control_model.input_blocks.1.0.out_layers.3.weight": "blocks.0.conv2.weight",
|
|
255
|
+
"control_model.input_blocks.1.0.out_layers.3.bias": "blocks.0.conv2.bias",
|
|
256
|
+
"control_model.input_blocks.1.1.norm.weight": "blocks.1.norm.weight",
|
|
257
|
+
"control_model.input_blocks.1.1.norm.bias": "blocks.1.norm.bias",
|
|
258
|
+
"control_model.input_blocks.1.1.proj_in.weight": "blocks.1.proj_in.weight",
|
|
259
|
+
"control_model.input_blocks.1.1.proj_in.bias": "blocks.1.proj_in.bias",
|
|
260
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn1.to_q.weight": "blocks.1.transformer_blocks.0.attn1.to_q.weight",
|
|
261
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn1.to_k.weight": "blocks.1.transformer_blocks.0.attn1.to_k.weight",
|
|
262
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn1.to_v.weight": "blocks.1.transformer_blocks.0.attn1.to_v.weight",
|
|
263
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.1.transformer_blocks.0.attn1.to_out.weight",
|
|
264
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.1.transformer_blocks.0.attn1.to_out.bias",
|
|
265
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.1.transformer_blocks.0.act_fn.proj.weight",
|
|
266
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.1.transformer_blocks.0.act_fn.proj.bias",
|
|
267
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.ff.net.2.weight": "blocks.1.transformer_blocks.0.ff.weight",
|
|
268
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.ff.net.2.bias": "blocks.1.transformer_blocks.0.ff.bias",
|
|
269
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn2.to_q.weight": "blocks.1.transformer_blocks.0.attn2.to_q.weight",
|
|
270
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn2.to_k.weight": "blocks.1.transformer_blocks.0.attn2.to_k.weight",
|
|
271
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn2.to_v.weight": "blocks.1.transformer_blocks.0.attn2.to_v.weight",
|
|
272
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.1.transformer_blocks.0.attn2.to_out.weight",
|
|
273
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.1.transformer_blocks.0.attn2.to_out.bias",
|
|
274
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm1.weight": "blocks.1.transformer_blocks.0.norm1.weight",
|
|
275
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm1.bias": "blocks.1.transformer_blocks.0.norm1.bias",
|
|
276
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm2.weight": "blocks.1.transformer_blocks.0.norm2.weight",
|
|
277
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm2.bias": "blocks.1.transformer_blocks.0.norm2.bias",
|
|
278
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm3.weight": "blocks.1.transformer_blocks.0.norm3.weight",
|
|
279
|
+
"control_model.input_blocks.1.1.transformer_blocks.0.norm3.bias": "blocks.1.transformer_blocks.0.norm3.bias",
|
|
280
|
+
"control_model.input_blocks.1.1.proj_out.weight": "blocks.1.proj_out.weight",
|
|
281
|
+
"control_model.input_blocks.1.1.proj_out.bias": "blocks.1.proj_out.bias",
|
|
282
|
+
"control_model.input_blocks.2.0.in_layers.0.weight": "blocks.3.norm1.weight",
|
|
283
|
+
"control_model.input_blocks.2.0.in_layers.0.bias": "blocks.3.norm1.bias",
|
|
284
|
+
"control_model.input_blocks.2.0.in_layers.2.weight": "blocks.3.conv1.weight",
|
|
285
|
+
"control_model.input_blocks.2.0.in_layers.2.bias": "blocks.3.conv1.bias",
|
|
286
|
+
"control_model.input_blocks.2.0.emb_layers.1.weight": "blocks.3.time_emb_proj.weight",
|
|
287
|
+
"control_model.input_blocks.2.0.emb_layers.1.bias": "blocks.3.time_emb_proj.bias",
|
|
288
|
+
"control_model.input_blocks.2.0.out_layers.0.weight": "blocks.3.norm2.weight",
|
|
289
|
+
"control_model.input_blocks.2.0.out_layers.0.bias": "blocks.3.norm2.bias",
|
|
290
|
+
"control_model.input_blocks.2.0.out_layers.3.weight": "blocks.3.conv2.weight",
|
|
291
|
+
"control_model.input_blocks.2.0.out_layers.3.bias": "blocks.3.conv2.bias",
|
|
292
|
+
"control_model.input_blocks.2.1.norm.weight": "blocks.4.norm.weight",
|
|
293
|
+
"control_model.input_blocks.2.1.norm.bias": "blocks.4.norm.bias",
|
|
294
|
+
"control_model.input_blocks.2.1.proj_in.weight": "blocks.4.proj_in.weight",
|
|
295
|
+
"control_model.input_blocks.2.1.proj_in.bias": "blocks.4.proj_in.bias",
|
|
296
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn1.to_q.weight": "blocks.4.transformer_blocks.0.attn1.to_q.weight",
|
|
297
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn1.to_k.weight": "blocks.4.transformer_blocks.0.attn1.to_k.weight",
|
|
298
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn1.to_v.weight": "blocks.4.transformer_blocks.0.attn1.to_v.weight",
|
|
299
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.4.transformer_blocks.0.attn1.to_out.weight",
|
|
300
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.4.transformer_blocks.0.attn1.to_out.bias",
|
|
301
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.4.transformer_blocks.0.act_fn.proj.weight",
|
|
302
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.4.transformer_blocks.0.act_fn.proj.bias",
|
|
303
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.ff.net.2.weight": "blocks.4.transformer_blocks.0.ff.weight",
|
|
304
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.ff.net.2.bias": "blocks.4.transformer_blocks.0.ff.bias",
|
|
305
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn2.to_q.weight": "blocks.4.transformer_blocks.0.attn2.to_q.weight",
|
|
306
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn2.to_k.weight": "blocks.4.transformer_blocks.0.attn2.to_k.weight",
|
|
307
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn2.to_v.weight": "blocks.4.transformer_blocks.0.attn2.to_v.weight",
|
|
308
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.4.transformer_blocks.0.attn2.to_out.weight",
|
|
309
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.4.transformer_blocks.0.attn2.to_out.bias",
|
|
310
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm1.weight": "blocks.4.transformer_blocks.0.norm1.weight",
|
|
311
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm1.bias": "blocks.4.transformer_blocks.0.norm1.bias",
|
|
312
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm2.weight": "blocks.4.transformer_blocks.0.norm2.weight",
|
|
313
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm2.bias": "blocks.4.transformer_blocks.0.norm2.bias",
|
|
314
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm3.weight": "blocks.4.transformer_blocks.0.norm3.weight",
|
|
315
|
+
"control_model.input_blocks.2.1.transformer_blocks.0.norm3.bias": "blocks.4.transformer_blocks.0.norm3.bias",
|
|
316
|
+
"control_model.input_blocks.2.1.proj_out.weight": "blocks.4.proj_out.weight",
|
|
317
|
+
"control_model.input_blocks.2.1.proj_out.bias": "blocks.4.proj_out.bias",
|
|
318
|
+
"control_model.input_blocks.3.0.op.weight": "blocks.6.conv.weight",
|
|
319
|
+
"control_model.input_blocks.3.0.op.bias": "blocks.6.conv.bias",
|
|
320
|
+
"control_model.input_blocks.4.0.in_layers.0.weight": "blocks.8.norm1.weight",
|
|
321
|
+
"control_model.input_blocks.4.0.in_layers.0.bias": "blocks.8.norm1.bias",
|
|
322
|
+
"control_model.input_blocks.4.0.in_layers.2.weight": "blocks.8.conv1.weight",
|
|
323
|
+
"control_model.input_blocks.4.0.in_layers.2.bias": "blocks.8.conv1.bias",
|
|
324
|
+
"control_model.input_blocks.4.0.emb_layers.1.weight": "blocks.8.time_emb_proj.weight",
|
|
325
|
+
"control_model.input_blocks.4.0.emb_layers.1.bias": "blocks.8.time_emb_proj.bias",
|
|
326
|
+
"control_model.input_blocks.4.0.out_layers.0.weight": "blocks.8.norm2.weight",
|
|
327
|
+
"control_model.input_blocks.4.0.out_layers.0.bias": "blocks.8.norm2.bias",
|
|
328
|
+
"control_model.input_blocks.4.0.out_layers.3.weight": "blocks.8.conv2.weight",
|
|
329
|
+
"control_model.input_blocks.4.0.out_layers.3.bias": "blocks.8.conv2.bias",
|
|
330
|
+
"control_model.input_blocks.4.0.skip_connection.weight": "blocks.8.conv_shortcut.weight",
|
|
331
|
+
"control_model.input_blocks.4.0.skip_connection.bias": "blocks.8.conv_shortcut.bias",
|
|
332
|
+
"control_model.input_blocks.4.1.norm.weight": "blocks.9.norm.weight",
|
|
333
|
+
"control_model.input_blocks.4.1.norm.bias": "blocks.9.norm.bias",
|
|
334
|
+
"control_model.input_blocks.4.1.proj_in.weight": "blocks.9.proj_in.weight",
|
|
335
|
+
"control_model.input_blocks.4.1.proj_in.bias": "blocks.9.proj_in.bias",
|
|
336
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn1.to_q.weight": "blocks.9.transformer_blocks.0.attn1.to_q.weight",
|
|
337
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn1.to_k.weight": "blocks.9.transformer_blocks.0.attn1.to_k.weight",
|
|
338
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn1.to_v.weight": "blocks.9.transformer_blocks.0.attn1.to_v.weight",
|
|
339
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.9.transformer_blocks.0.attn1.to_out.weight",
|
|
340
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.9.transformer_blocks.0.attn1.to_out.bias",
|
|
341
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.9.transformer_blocks.0.act_fn.proj.weight",
|
|
342
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.9.transformer_blocks.0.act_fn.proj.bias",
|
|
343
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.ff.net.2.weight": "blocks.9.transformer_blocks.0.ff.weight",
|
|
344
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.ff.net.2.bias": "blocks.9.transformer_blocks.0.ff.bias",
|
|
345
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn2.to_q.weight": "blocks.9.transformer_blocks.0.attn2.to_q.weight",
|
|
346
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn2.to_k.weight": "blocks.9.transformer_blocks.0.attn2.to_k.weight",
|
|
347
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn2.to_v.weight": "blocks.9.transformer_blocks.0.attn2.to_v.weight",
|
|
348
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.9.transformer_blocks.0.attn2.to_out.weight",
|
|
349
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.9.transformer_blocks.0.attn2.to_out.bias",
|
|
350
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm1.weight": "blocks.9.transformer_blocks.0.norm1.weight",
|
|
351
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm1.bias": "blocks.9.transformer_blocks.0.norm1.bias",
|
|
352
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm2.weight": "blocks.9.transformer_blocks.0.norm2.weight",
|
|
353
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm2.bias": "blocks.9.transformer_blocks.0.norm2.bias",
|
|
354
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm3.weight": "blocks.9.transformer_blocks.0.norm3.weight",
|
|
355
|
+
"control_model.input_blocks.4.1.transformer_blocks.0.norm3.bias": "blocks.9.transformer_blocks.0.norm3.bias",
|
|
356
|
+
"control_model.input_blocks.4.1.proj_out.weight": "blocks.9.proj_out.weight",
|
|
357
|
+
"control_model.input_blocks.4.1.proj_out.bias": "blocks.9.proj_out.bias",
|
|
358
|
+
"control_model.input_blocks.5.0.in_layers.0.weight": "blocks.11.norm1.weight",
|
|
359
|
+
"control_model.input_blocks.5.0.in_layers.0.bias": "blocks.11.norm1.bias",
|
|
360
|
+
"control_model.input_blocks.5.0.in_layers.2.weight": "blocks.11.conv1.weight",
|
|
361
|
+
"control_model.input_blocks.5.0.in_layers.2.bias": "blocks.11.conv1.bias",
|
|
362
|
+
"control_model.input_blocks.5.0.emb_layers.1.weight": "blocks.11.time_emb_proj.weight",
|
|
363
|
+
"control_model.input_blocks.5.0.emb_layers.1.bias": "blocks.11.time_emb_proj.bias",
|
|
364
|
+
"control_model.input_blocks.5.0.out_layers.0.weight": "blocks.11.norm2.weight",
|
|
365
|
+
"control_model.input_blocks.5.0.out_layers.0.bias": "blocks.11.norm2.bias",
|
|
366
|
+
"control_model.input_blocks.5.0.out_layers.3.weight": "blocks.11.conv2.weight",
|
|
367
|
+
"control_model.input_blocks.5.0.out_layers.3.bias": "blocks.11.conv2.bias",
|
|
368
|
+
"control_model.input_blocks.5.1.norm.weight": "blocks.12.norm.weight",
|
|
369
|
+
"control_model.input_blocks.5.1.norm.bias": "blocks.12.norm.bias",
|
|
370
|
+
"control_model.input_blocks.5.1.proj_in.weight": "blocks.12.proj_in.weight",
|
|
371
|
+
"control_model.input_blocks.5.1.proj_in.bias": "blocks.12.proj_in.bias",
|
|
372
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn1.to_q.weight": "blocks.12.transformer_blocks.0.attn1.to_q.weight",
|
|
373
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn1.to_k.weight": "blocks.12.transformer_blocks.0.attn1.to_k.weight",
|
|
374
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn1.to_v.weight": "blocks.12.transformer_blocks.0.attn1.to_v.weight",
|
|
375
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.12.transformer_blocks.0.attn1.to_out.weight",
|
|
376
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.12.transformer_blocks.0.attn1.to_out.bias",
|
|
377
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.12.transformer_blocks.0.act_fn.proj.weight",
|
|
378
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.12.transformer_blocks.0.act_fn.proj.bias",
|
|
379
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.ff.net.2.weight": "blocks.12.transformer_blocks.0.ff.weight",
|
|
380
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.ff.net.2.bias": "blocks.12.transformer_blocks.0.ff.bias",
|
|
381
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn2.to_q.weight": "blocks.12.transformer_blocks.0.attn2.to_q.weight",
|
|
382
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn2.to_k.weight": "blocks.12.transformer_blocks.0.attn2.to_k.weight",
|
|
383
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn2.to_v.weight": "blocks.12.transformer_blocks.0.attn2.to_v.weight",
|
|
384
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.12.transformer_blocks.0.attn2.to_out.weight",
|
|
385
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.12.transformer_blocks.0.attn2.to_out.bias",
|
|
386
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm1.weight": "blocks.12.transformer_blocks.0.norm1.weight",
|
|
387
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm1.bias": "blocks.12.transformer_blocks.0.norm1.bias",
|
|
388
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm2.weight": "blocks.12.transformer_blocks.0.norm2.weight",
|
|
389
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm2.bias": "blocks.12.transformer_blocks.0.norm2.bias",
|
|
390
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm3.weight": "blocks.12.transformer_blocks.0.norm3.weight",
|
|
391
|
+
"control_model.input_blocks.5.1.transformer_blocks.0.norm3.bias": "blocks.12.transformer_blocks.0.norm3.bias",
|
|
392
|
+
"control_model.input_blocks.5.1.proj_out.weight": "blocks.12.proj_out.weight",
|
|
393
|
+
"control_model.input_blocks.5.1.proj_out.bias": "blocks.12.proj_out.bias",
|
|
394
|
+
"control_model.input_blocks.6.0.op.weight": "blocks.14.conv.weight",
|
|
395
|
+
"control_model.input_blocks.6.0.op.bias": "blocks.14.conv.bias",
|
|
396
|
+
"control_model.input_blocks.7.0.in_layers.0.weight": "blocks.16.norm1.weight",
|
|
397
|
+
"control_model.input_blocks.7.0.in_layers.0.bias": "blocks.16.norm1.bias",
|
|
398
|
+
"control_model.input_blocks.7.0.in_layers.2.weight": "blocks.16.conv1.weight",
|
|
399
|
+
"control_model.input_blocks.7.0.in_layers.2.bias": "blocks.16.conv1.bias",
|
|
400
|
+
"control_model.input_blocks.7.0.emb_layers.1.weight": "blocks.16.time_emb_proj.weight",
|
|
401
|
+
"control_model.input_blocks.7.0.emb_layers.1.bias": "blocks.16.time_emb_proj.bias",
|
|
402
|
+
"control_model.input_blocks.7.0.out_layers.0.weight": "blocks.16.norm2.weight",
|
|
403
|
+
"control_model.input_blocks.7.0.out_layers.0.bias": "blocks.16.norm2.bias",
|
|
404
|
+
"control_model.input_blocks.7.0.out_layers.3.weight": "blocks.16.conv2.weight",
|
|
405
|
+
"control_model.input_blocks.7.0.out_layers.3.bias": "blocks.16.conv2.bias",
|
|
406
|
+
"control_model.input_blocks.7.0.skip_connection.weight": "blocks.16.conv_shortcut.weight",
|
|
407
|
+
"control_model.input_blocks.7.0.skip_connection.bias": "blocks.16.conv_shortcut.bias",
|
|
408
|
+
"control_model.input_blocks.7.1.norm.weight": "blocks.17.norm.weight",
|
|
409
|
+
"control_model.input_blocks.7.1.norm.bias": "blocks.17.norm.bias",
|
|
410
|
+
"control_model.input_blocks.7.1.proj_in.weight": "blocks.17.proj_in.weight",
|
|
411
|
+
"control_model.input_blocks.7.1.proj_in.bias": "blocks.17.proj_in.bias",
|
|
412
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn1.to_q.weight": "blocks.17.transformer_blocks.0.attn1.to_q.weight",
|
|
413
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn1.to_k.weight": "blocks.17.transformer_blocks.0.attn1.to_k.weight",
|
|
414
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn1.to_v.weight": "blocks.17.transformer_blocks.0.attn1.to_v.weight",
|
|
415
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.17.transformer_blocks.0.attn1.to_out.weight",
|
|
416
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.17.transformer_blocks.0.attn1.to_out.bias",
|
|
417
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.17.transformer_blocks.0.act_fn.proj.weight",
|
|
418
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.17.transformer_blocks.0.act_fn.proj.bias",
|
|
419
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.ff.net.2.weight": "blocks.17.transformer_blocks.0.ff.weight",
|
|
420
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.ff.net.2.bias": "blocks.17.transformer_blocks.0.ff.bias",
|
|
421
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn2.to_q.weight": "blocks.17.transformer_blocks.0.attn2.to_q.weight",
|
|
422
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn2.to_k.weight": "blocks.17.transformer_blocks.0.attn2.to_k.weight",
|
|
423
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn2.to_v.weight": "blocks.17.transformer_blocks.0.attn2.to_v.weight",
|
|
424
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.17.transformer_blocks.0.attn2.to_out.weight",
|
|
425
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.17.transformer_blocks.0.attn2.to_out.bias",
|
|
426
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm1.weight": "blocks.17.transformer_blocks.0.norm1.weight",
|
|
427
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm1.bias": "blocks.17.transformer_blocks.0.norm1.bias",
|
|
428
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm2.weight": "blocks.17.transformer_blocks.0.norm2.weight",
|
|
429
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm2.bias": "blocks.17.transformer_blocks.0.norm2.bias",
|
|
430
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm3.weight": "blocks.17.transformer_blocks.0.norm3.weight",
|
|
431
|
+
"control_model.input_blocks.7.1.transformer_blocks.0.norm3.bias": "blocks.17.transformer_blocks.0.norm3.bias",
|
|
432
|
+
"control_model.input_blocks.7.1.proj_out.weight": "blocks.17.proj_out.weight",
|
|
433
|
+
"control_model.input_blocks.7.1.proj_out.bias": "blocks.17.proj_out.bias",
|
|
434
|
+
"control_model.input_blocks.8.0.in_layers.0.weight": "blocks.19.norm1.weight",
|
|
435
|
+
"control_model.input_blocks.8.0.in_layers.0.bias": "blocks.19.norm1.bias",
|
|
436
|
+
"control_model.input_blocks.8.0.in_layers.2.weight": "blocks.19.conv1.weight",
|
|
437
|
+
"control_model.input_blocks.8.0.in_layers.2.bias": "blocks.19.conv1.bias",
|
|
438
|
+
"control_model.input_blocks.8.0.emb_layers.1.weight": "blocks.19.time_emb_proj.weight",
|
|
439
|
+
"control_model.input_blocks.8.0.emb_layers.1.bias": "blocks.19.time_emb_proj.bias",
|
|
440
|
+
"control_model.input_blocks.8.0.out_layers.0.weight": "blocks.19.norm2.weight",
|
|
441
|
+
"control_model.input_blocks.8.0.out_layers.0.bias": "blocks.19.norm2.bias",
|
|
442
|
+
"control_model.input_blocks.8.0.out_layers.3.weight": "blocks.19.conv2.weight",
|
|
443
|
+
"control_model.input_blocks.8.0.out_layers.3.bias": "blocks.19.conv2.bias",
|
|
444
|
+
"control_model.input_blocks.8.1.norm.weight": "blocks.20.norm.weight",
|
|
445
|
+
"control_model.input_blocks.8.1.norm.bias": "blocks.20.norm.bias",
|
|
446
|
+
"control_model.input_blocks.8.1.proj_in.weight": "blocks.20.proj_in.weight",
|
|
447
|
+
"control_model.input_blocks.8.1.proj_in.bias": "blocks.20.proj_in.bias",
|
|
448
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn1.to_q.weight": "blocks.20.transformer_blocks.0.attn1.to_q.weight",
|
|
449
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn1.to_k.weight": "blocks.20.transformer_blocks.0.attn1.to_k.weight",
|
|
450
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn1.to_v.weight": "blocks.20.transformer_blocks.0.attn1.to_v.weight",
|
|
451
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.20.transformer_blocks.0.attn1.to_out.weight",
|
|
452
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.20.transformer_blocks.0.attn1.to_out.bias",
|
|
453
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.20.transformer_blocks.0.act_fn.proj.weight",
|
|
454
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.20.transformer_blocks.0.act_fn.proj.bias",
|
|
455
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.ff.net.2.weight": "blocks.20.transformer_blocks.0.ff.weight",
|
|
456
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.ff.net.2.bias": "blocks.20.transformer_blocks.0.ff.bias",
|
|
457
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn2.to_q.weight": "blocks.20.transformer_blocks.0.attn2.to_q.weight",
|
|
458
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn2.to_k.weight": "blocks.20.transformer_blocks.0.attn2.to_k.weight",
|
|
459
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn2.to_v.weight": "blocks.20.transformer_blocks.0.attn2.to_v.weight",
|
|
460
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.20.transformer_blocks.0.attn2.to_out.weight",
|
|
461
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.20.transformer_blocks.0.attn2.to_out.bias",
|
|
462
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm1.weight": "blocks.20.transformer_blocks.0.norm1.weight",
|
|
463
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm1.bias": "blocks.20.transformer_blocks.0.norm1.bias",
|
|
464
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm2.weight": "blocks.20.transformer_blocks.0.norm2.weight",
|
|
465
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm2.bias": "blocks.20.transformer_blocks.0.norm2.bias",
|
|
466
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm3.weight": "blocks.20.transformer_blocks.0.norm3.weight",
|
|
467
|
+
"control_model.input_blocks.8.1.transformer_blocks.0.norm3.bias": "blocks.20.transformer_blocks.0.norm3.bias",
|
|
468
|
+
"control_model.input_blocks.8.1.proj_out.weight": "blocks.20.proj_out.weight",
|
|
469
|
+
"control_model.input_blocks.8.1.proj_out.bias": "blocks.20.proj_out.bias",
|
|
470
|
+
"control_model.input_blocks.9.0.op.weight": "blocks.22.conv.weight",
|
|
471
|
+
"control_model.input_blocks.9.0.op.bias": "blocks.22.conv.bias",
|
|
472
|
+
"control_model.input_blocks.10.0.in_layers.0.weight": "blocks.24.norm1.weight",
|
|
473
|
+
"control_model.input_blocks.10.0.in_layers.0.bias": "blocks.24.norm1.bias",
|
|
474
|
+
"control_model.input_blocks.10.0.in_layers.2.weight": "blocks.24.conv1.weight",
|
|
475
|
+
"control_model.input_blocks.10.0.in_layers.2.bias": "blocks.24.conv1.bias",
|
|
476
|
+
"control_model.input_blocks.10.0.emb_layers.1.weight": "blocks.24.time_emb_proj.weight",
|
|
477
|
+
"control_model.input_blocks.10.0.emb_layers.1.bias": "blocks.24.time_emb_proj.bias",
|
|
478
|
+
"control_model.input_blocks.10.0.out_layers.0.weight": "blocks.24.norm2.weight",
|
|
479
|
+
"control_model.input_blocks.10.0.out_layers.0.bias": "blocks.24.norm2.bias",
|
|
480
|
+
"control_model.input_blocks.10.0.out_layers.3.weight": "blocks.24.conv2.weight",
|
|
481
|
+
"control_model.input_blocks.10.0.out_layers.3.bias": "blocks.24.conv2.bias",
|
|
482
|
+
"control_model.input_blocks.11.0.in_layers.0.weight": "blocks.26.norm1.weight",
|
|
483
|
+
"control_model.input_blocks.11.0.in_layers.0.bias": "blocks.26.norm1.bias",
|
|
484
|
+
"control_model.input_blocks.11.0.in_layers.2.weight": "blocks.26.conv1.weight",
|
|
485
|
+
"control_model.input_blocks.11.0.in_layers.2.bias": "blocks.26.conv1.bias",
|
|
486
|
+
"control_model.input_blocks.11.0.emb_layers.1.weight": "blocks.26.time_emb_proj.weight",
|
|
487
|
+
"control_model.input_blocks.11.0.emb_layers.1.bias": "blocks.26.time_emb_proj.bias",
|
|
488
|
+
"control_model.input_blocks.11.0.out_layers.0.weight": "blocks.26.norm2.weight",
|
|
489
|
+
"control_model.input_blocks.11.0.out_layers.0.bias": "blocks.26.norm2.bias",
|
|
490
|
+
"control_model.input_blocks.11.0.out_layers.3.weight": "blocks.26.conv2.weight",
|
|
491
|
+
"control_model.input_blocks.11.0.out_layers.3.bias": "blocks.26.conv2.bias",
|
|
492
|
+
"control_model.zero_convs.0.0.weight": "controlnet_blocks.0.weight",
|
|
493
|
+
"control_model.zero_convs.0.0.bias": "controlnet_blocks.0.bias",
|
|
494
|
+
"control_model.zero_convs.1.0.weight": "controlnet_blocks.1.weight",
|
|
495
|
+
"control_model.zero_convs.1.0.bias": "controlnet_blocks.0.bias",
|
|
496
|
+
"control_model.zero_convs.2.0.weight": "controlnet_blocks.2.weight",
|
|
497
|
+
"control_model.zero_convs.2.0.bias": "controlnet_blocks.0.bias",
|
|
498
|
+
"control_model.zero_convs.3.0.weight": "controlnet_blocks.3.weight",
|
|
499
|
+
"control_model.zero_convs.3.0.bias": "controlnet_blocks.0.bias",
|
|
500
|
+
"control_model.zero_convs.4.0.weight": "controlnet_blocks.4.weight",
|
|
501
|
+
"control_model.zero_convs.4.0.bias": "controlnet_blocks.4.bias",
|
|
502
|
+
"control_model.zero_convs.5.0.weight": "controlnet_blocks.5.weight",
|
|
503
|
+
"control_model.zero_convs.5.0.bias": "controlnet_blocks.4.bias",
|
|
504
|
+
"control_model.zero_convs.6.0.weight": "controlnet_blocks.6.weight",
|
|
505
|
+
"control_model.zero_convs.6.0.bias": "controlnet_blocks.4.bias",
|
|
506
|
+
"control_model.zero_convs.7.0.weight": "controlnet_blocks.7.weight",
|
|
507
|
+
"control_model.zero_convs.7.0.bias": "controlnet_blocks.7.bias",
|
|
508
|
+
"control_model.zero_convs.8.0.weight": "controlnet_blocks.8.weight",
|
|
509
|
+
"control_model.zero_convs.8.0.bias": "controlnet_blocks.7.bias",
|
|
510
|
+
"control_model.zero_convs.9.0.weight": "controlnet_blocks.9.weight",
|
|
511
|
+
"control_model.zero_convs.9.0.bias": "controlnet_blocks.7.bias",
|
|
512
|
+
"control_model.zero_convs.10.0.weight": "controlnet_blocks.10.weight",
|
|
513
|
+
"control_model.zero_convs.10.0.bias": "controlnet_blocks.7.bias",
|
|
514
|
+
"control_model.zero_convs.11.0.weight": "controlnet_blocks.11.weight",
|
|
515
|
+
"control_model.zero_convs.11.0.bias": "controlnet_blocks.7.bias",
|
|
516
|
+
"control_model.input_hint_block.0.weight": "controlnet_conv_in.blocks.0.weight",
|
|
517
|
+
"control_model.input_hint_block.0.bias": "controlnet_conv_in.blocks.0.bias",
|
|
518
|
+
"control_model.input_hint_block.2.weight": "controlnet_conv_in.blocks.2.weight",
|
|
519
|
+
"control_model.input_hint_block.2.bias": "controlnet_conv_in.blocks.2.bias",
|
|
520
|
+
"control_model.input_hint_block.4.weight": "controlnet_conv_in.blocks.4.weight",
|
|
521
|
+
"control_model.input_hint_block.4.bias": "controlnet_conv_in.blocks.4.bias",
|
|
522
|
+
"control_model.input_hint_block.6.weight": "controlnet_conv_in.blocks.6.weight",
|
|
523
|
+
"control_model.input_hint_block.6.bias": "controlnet_conv_in.blocks.6.bias",
|
|
524
|
+
"control_model.input_hint_block.8.weight": "controlnet_conv_in.blocks.8.weight",
|
|
525
|
+
"control_model.input_hint_block.8.bias": "controlnet_conv_in.blocks.8.bias",
|
|
526
|
+
"control_model.input_hint_block.10.weight": "controlnet_conv_in.blocks.10.weight",
|
|
527
|
+
"control_model.input_hint_block.10.bias": "controlnet_conv_in.blocks.10.bias",
|
|
528
|
+
"control_model.input_hint_block.12.weight": "controlnet_conv_in.blocks.12.weight",
|
|
529
|
+
"control_model.input_hint_block.12.bias": "controlnet_conv_in.blocks.12.bias",
|
|
530
|
+
"control_model.input_hint_block.14.weight": "controlnet_conv_in.blocks.14.weight",
|
|
531
|
+
"control_model.input_hint_block.14.bias": "controlnet_conv_in.blocks.14.bias",
|
|
532
|
+
"control_model.middle_block.0.in_layers.0.weight": "blocks.28.norm1.weight",
|
|
533
|
+
"control_model.middle_block.0.in_layers.0.bias": "blocks.28.norm1.bias",
|
|
534
|
+
"control_model.middle_block.0.in_layers.2.weight": "blocks.28.conv1.weight",
|
|
535
|
+
"control_model.middle_block.0.in_layers.2.bias": "blocks.28.conv1.bias",
|
|
536
|
+
"control_model.middle_block.0.emb_layers.1.weight": "blocks.28.time_emb_proj.weight",
|
|
537
|
+
"control_model.middle_block.0.emb_layers.1.bias": "blocks.28.time_emb_proj.bias",
|
|
538
|
+
"control_model.middle_block.0.out_layers.0.weight": "blocks.28.norm2.weight",
|
|
539
|
+
"control_model.middle_block.0.out_layers.0.bias": "blocks.28.norm2.bias",
|
|
540
|
+
"control_model.middle_block.0.out_layers.3.weight": "blocks.28.conv2.weight",
|
|
541
|
+
"control_model.middle_block.0.out_layers.3.bias": "blocks.28.conv2.bias",
|
|
542
|
+
"control_model.middle_block.1.norm.weight": "blocks.29.norm.weight",
|
|
543
|
+
"control_model.middle_block.1.norm.bias": "blocks.29.norm.bias",
|
|
544
|
+
"control_model.middle_block.1.proj_in.weight": "blocks.29.proj_in.weight",
|
|
545
|
+
"control_model.middle_block.1.proj_in.bias": "blocks.29.proj_in.bias",
|
|
546
|
+
"control_model.middle_block.1.transformer_blocks.0.attn1.to_q.weight": "blocks.29.transformer_blocks.0.attn1.to_q.weight",
|
|
547
|
+
"control_model.middle_block.1.transformer_blocks.0.attn1.to_k.weight": "blocks.29.transformer_blocks.0.attn1.to_k.weight",
|
|
548
|
+
"control_model.middle_block.1.transformer_blocks.0.attn1.to_v.weight": "blocks.29.transformer_blocks.0.attn1.to_v.weight",
|
|
549
|
+
"control_model.middle_block.1.transformer_blocks.0.attn1.to_out.0.weight": "blocks.29.transformer_blocks.0.attn1.to_out.weight",
|
|
550
|
+
"control_model.middle_block.1.transformer_blocks.0.attn1.to_out.0.bias": "blocks.29.transformer_blocks.0.attn1.to_out.bias",
|
|
551
|
+
"control_model.middle_block.1.transformer_blocks.0.ff.net.0.proj.weight": "blocks.29.transformer_blocks.0.act_fn.proj.weight",
|
|
552
|
+
"control_model.middle_block.1.transformer_blocks.0.ff.net.0.proj.bias": "blocks.29.transformer_blocks.0.act_fn.proj.bias",
|
|
553
|
+
"control_model.middle_block.1.transformer_blocks.0.ff.net.2.weight": "blocks.29.transformer_blocks.0.ff.weight",
|
|
554
|
+
"control_model.middle_block.1.transformer_blocks.0.ff.net.2.bias": "blocks.29.transformer_blocks.0.ff.bias",
|
|
555
|
+
"control_model.middle_block.1.transformer_blocks.0.attn2.to_q.weight": "blocks.29.transformer_blocks.0.attn2.to_q.weight",
|
|
556
|
+
"control_model.middle_block.1.transformer_blocks.0.attn2.to_k.weight": "blocks.29.transformer_blocks.0.attn2.to_k.weight",
|
|
557
|
+
"control_model.middle_block.1.transformer_blocks.0.attn2.to_v.weight": "blocks.29.transformer_blocks.0.attn2.to_v.weight",
|
|
558
|
+
"control_model.middle_block.1.transformer_blocks.0.attn2.to_out.0.weight": "blocks.29.transformer_blocks.0.attn2.to_out.weight",
|
|
559
|
+
"control_model.middle_block.1.transformer_blocks.0.attn2.to_out.0.bias": "blocks.29.transformer_blocks.0.attn2.to_out.bias",
|
|
560
|
+
"control_model.middle_block.1.transformer_blocks.0.norm1.weight": "blocks.29.transformer_blocks.0.norm1.weight",
|
|
561
|
+
"control_model.middle_block.1.transformer_blocks.0.norm1.bias": "blocks.29.transformer_blocks.0.norm1.bias",
|
|
562
|
+
"control_model.middle_block.1.transformer_blocks.0.norm2.weight": "blocks.29.transformer_blocks.0.norm2.weight",
|
|
563
|
+
"control_model.middle_block.1.transformer_blocks.0.norm2.bias": "blocks.29.transformer_blocks.0.norm2.bias",
|
|
564
|
+
"control_model.middle_block.1.transformer_blocks.0.norm3.weight": "blocks.29.transformer_blocks.0.norm3.weight",
|
|
565
|
+
"control_model.middle_block.1.transformer_blocks.0.norm3.bias": "blocks.29.transformer_blocks.0.norm3.bias",
|
|
566
|
+
"control_model.middle_block.1.proj_out.weight": "blocks.29.proj_out.weight",
|
|
567
|
+
"control_model.middle_block.1.proj_out.bias": "blocks.29.proj_out.bias",
|
|
568
|
+
"control_model.middle_block.2.in_layers.0.weight": "blocks.30.norm1.weight",
|
|
569
|
+
"control_model.middle_block.2.in_layers.0.bias": "blocks.30.norm1.bias",
|
|
570
|
+
"control_model.middle_block.2.in_layers.2.weight": "blocks.30.conv1.weight",
|
|
571
|
+
"control_model.middle_block.2.in_layers.2.bias": "blocks.30.conv1.bias",
|
|
572
|
+
"control_model.middle_block.2.emb_layers.1.weight": "blocks.30.time_emb_proj.weight",
|
|
573
|
+
"control_model.middle_block.2.emb_layers.1.bias": "blocks.30.time_emb_proj.bias",
|
|
574
|
+
"control_model.middle_block.2.out_layers.0.weight": "blocks.30.norm2.weight",
|
|
575
|
+
"control_model.middle_block.2.out_layers.0.bias": "blocks.30.norm2.bias",
|
|
576
|
+
"control_model.middle_block.2.out_layers.3.weight": "blocks.30.conv2.weight",
|
|
577
|
+
"control_model.middle_block.2.out_layers.3.bias": "blocks.30.conv2.bias",
|
|
578
|
+
"control_model.middle_block_out.0.weight": "controlnet_blocks.12.weight",
|
|
579
|
+
"control_model.middle_block_out.0.bias": "controlnet_blocks.7.bias",
|
|
580
|
+
}
|
|
581
|
+
state_dict_ = {}
|
|
582
|
+
for name in state_dict:
|
|
583
|
+
if name in rename_dict:
|
|
584
|
+
param = state_dict[name]
|
|
585
|
+
if ".proj_in." in name or ".proj_out." in name:
|
|
586
|
+
param = param.squeeze()
|
|
587
|
+
state_dict_[rename_dict[name]] = param
|
|
588
|
+
return state_dict_
|