hanzogak commited on
Commit
4db5c4a
·
verified ·
1 Parent(s): 038d11d

Upload 2 files

Browse files
sd3_manual_surgery-test1_medium_incl_clips_t5xxlfp8.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torchvision.transforms as T
3
+ from safetensors.torch import load_file, save_file
4
+ file_path = "./sd3_medium_incl_clips_t5xxlfp8.safetensors"
5
+ loaded = load_file(file_path)
6
+ for i in loaded:
7
+ #print(i)
8
+ if i.find("model.diffusion_model.joint_blocks.2.x_block.attn.qkv.weight") != -1:
9
+ print(i)
10
+ loaded[i] = loaded[i] * ((0.9 + 1) / 2)
11
+ elif i.find("model.diffusion_model.joint_blocks.3.x_block.attn.qkv.weight") != -1:
12
+ print(i)
13
+ loaded[i] = loaded[i] * ((0.9 + 1) / 2)
14
+ elif i.find("model.diffusion_model.joint_blocks.10.x_block.attn.qkv.weight") != -1:
15
+ print(i)
16
+ loaded[i] = loaded[i] * ((0.8 + 1) / 2)
17
+ elif i.find("model.diffusion_model.joint_blocks.12.x_block.attn.qkv.weight") != -1:
18
+ print(i)
19
+ loaded[i] = loaded[i] * ((0.85 + 1) / 2)
20
+ elif i.find("model.diffusion_model.joint_blocks.13.x_block.attn.qkv.weight") != -1:
21
+ print(i)
22
+ loaded[i] = loaded[i] * ((0.8 + 1) / 2)
23
+ elif i.find("model.diffusion_model.joint_blocks.19.x_block.attn.qkv.weight") != -1:
24
+ print(i)
25
+ loaded[i] = loaded[i] * ((1.15 + 1) / 2)
26
+ elif i.find("model.diffusion_model.joint_blocks.20.x_block.attn.qkv.weight") != -1:
27
+ print(i)
28
+ loaded[i] = loaded[i] * ((0.9 + 1) / 2)
29
+ save_file(loaded, "sd3_manual_surgery-test1_medium_incl_clips_t5xxlfp8.safetensors")
30
+
31
+ # manual surgery
sd3_manual_surgery-test1_medium_incl_clips_t5xxlfp8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40ba666d393ed0d7b1e7e101f6dc11be91c290daf8fe3af6dbb508a4c07cd611
3
+ size 10867132254