scrap halving logic. it made no sense

This commit is contained in:
Mackerel
2023-04-21 18:27:42 -04:00
parent 2bcbd9fd8c
commit c7dc1ea19b
2 changed files with 5 additions and 7 deletions
+2 -1
View File
@@ -23,4 +23,5 @@ The classifier models have been taken from the sdweb-auto-MBW repo
- many hardcoded settings are arbitrary - such as the sampler and block processing order
- generated images are not saved
- the final model is saved in the models/checkpoints directory with a timestamped name
- the resulting model will contain the text encoder and VAE sent to the node, without modification.
- the resulting model will contain the text encoder and VAE sent to the node
- the unet will (probably) be fp16 and the rest fp32. that's how they're sent to the node
+3 -6
View File
@@ -60,6 +60,7 @@ class AutoMBW:
self.blocks_backup[key] = sd1[key].clone()
sd1[key].copy_(sd1[key] * (1 - ratio) + sd2[key] * ratio)
@torch.no_grad()
def unmerge(self):
sd1 = self.model1.model.state_dict()
@@ -142,16 +143,12 @@ class AutoMBW:
print(self.ratios)
sd1 = self.model1.model.state_dict()
precision = sd1['model.diffusion_model.middle_block.1.' \
+ 'transformer_blocks.0.attn1.to_q.weight'].dtype
vae = vae.first_stage_model.state_dict()
for key in vae:
sd1[f"first_stage_model.{key}"] = torch.as_tensor(vae[key],
dtype=precision)
sd1[f"first_stage_model.{key}"] = vae[key]
clip = clip.cond_stage_model.state_dict()
for key in clip:
sd1[f"cond_stage_model.{key}"] = torch.as_tensor(clip[key],
dtype=precision)
sd1[f"cond_stage_model.{key}"] = clip[key]
filename = pathlib.Path(folder_paths.folder_names_and_paths[
"checkpoints"][0][0]).joinpath(f"ambw{int(time.time())}")