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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"nbformat": 4,
|
| 3 |
+
"nbformat_minor": 0,
|
| 4 |
+
"metadata": {
|
| 5 |
+
"colab": {
|
| 6 |
+
"provenance": [],
|
| 7 |
+
"gpuType": "T4"
|
| 8 |
+
},
|
| 9 |
+
"kernelspec": {
|
| 10 |
+
"name": "python3",
|
| 11 |
+
"display_name": "Python 3"
|
| 12 |
+
},
|
| 13 |
+
"language_info": {
|
| 14 |
+
"name": "python"
|
| 15 |
+
},
|
| 16 |
+
"accelerator": "GPU"
|
| 17 |
+
},
|
| 18 |
+
"cells": [
|
| 19 |
+
{
|
| 20 |
+
"cell_type": "markdown",
|
| 21 |
+
"source": [
|
| 22 |
+
"# Cast civitai trained LoRa in torch.bfloat16 to Tensor Art Compatible torch.float16 dtype\n",
|
| 23 |
+
"\n",
|
| 24 |
+
"Created by Adcom: https://tensor.art/u/743241123023077878"
|
| 25 |
+
],
|
| 26 |
+
"metadata": {
|
| 27 |
+
"id": "YDCnQpDdqDe4"
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"cell_type": "code",
|
| 32 |
+
"source": [
|
| 33 |
+
"#initialize\n",
|
| 34 |
+
"import torch\n",
|
| 35 |
+
"from safetensors.torch import load_file\n",
|
| 36 |
+
"from google.colab import drive\n",
|
| 37 |
+
"drive.mount('/content/drive')"
|
| 38 |
+
],
|
| 39 |
+
"metadata": {
|
| 40 |
+
"id": "CBVTifA_ZwdC"
|
| 41 |
+
},
|
| 42 |
+
"execution_count": null,
|
| 43 |
+
"outputs": []
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"cell_type": "code",
|
| 47 |
+
"source": [
|
| 48 |
+
"\n",
|
| 49 |
+
"\n",
|
| 50 |
+
"device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
|
| 51 |
+
"\n",
|
| 52 |
+
"doll = load_file('/content/drive/MyDrive/Saved from Chrome/dolls.safetensors')\n",
|
| 53 |
+
"euro = load_file('/content/drive/MyDrive/Saved from Chrome/euro.safetensors')\n",
|
| 54 |
+
"scale = load_file('/content/drive/MyDrive/Saved from Chrome/scale.safetensors')\n",
|
| 55 |
+
"cgi = load_file('/content/drive/MyDrive/Saved from Chrome/cgi.safetensors')\n",
|
| 56 |
+
"guns = load_file('/content/drive/MyDrive/Saved from Chrome/guns.safetensors')\n",
|
| 57 |
+
"iris = load_file('/content/drive/MyDrive/Saved from Chrome/iris.safetensors')\n",
|
| 58 |
+
"\n",
|
| 59 |
+
"for key in doll:\n",
|
| 60 |
+
" doll[f'{key}'] = doll[f'{key}'].to(device = device , dtype=torch.float16)\n",
|
| 61 |
+
" euro[f'{key}'] = euro[f'{key}'].to(device = device , dtype=torch.float16)\n",
|
| 62 |
+
" scale[f'{key}'] = scale[f'{key}'].to(device = device , dtype=torch.float16)\n",
|
| 63 |
+
" iris[f'{key}'] = iris[f'{key}'].to(device = device , dtype=torch.float16)\n",
|
| 64 |
+
" cgi[f'{key}'] = cgi[f'{key}'].to(device = device , dtype=torch.float16)\n",
|
| 65 |
+
" guns[f'{key}'] = guns[f'{key}'].to(device = device , dtype=torch.float16)"
|
| 66 |
+
],
|
| 67 |
+
"metadata": {
|
| 68 |
+
"id": "1oxeJYHRqxQC"
|
| 69 |
+
},
|
| 70 |
+
"execution_count": 28,
|
| 71 |
+
"outputs": []
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"cell_type": "code",
|
| 75 |
+
"source": [
|
| 76 |
+
"cgi = load_file('/content/drive/MyDrive/Saved from Chrome/cgi_style.safetensors')"
|
| 77 |
+
],
|
| 78 |
+
"metadata": {
|
| 79 |
+
"id": "JuGDCX5272Bh"
|
| 80 |
+
},
|
| 81 |
+
"execution_count": 10,
|
| 82 |
+
"outputs": []
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"cell_type": "code",
|
| 86 |
+
"source": [
|
| 87 |
+
"#cgi = load_file('/content/drive/MyDrive/Saved from Chrome/cgi_style.safetensors')\n",
|
| 88 |
+
"doll = load_file('/content/drive/MyDrive/Saved from Chrome/dolls.safetensors')\n",
|
| 89 |
+
"euro = load_file('/content/drive/MyDrive/Saved from Chrome/euro.safetensors')\n",
|
| 90 |
+
"scale = load_file('/content/drive/MyDrive/Saved from Chrome/scale.safetensors')\n",
|
| 91 |
+
"cgi = load_file('/content/drive/MyDrive/Saved from Chrome/cgi.safetensors')\n",
|
| 92 |
+
"guns = load_file('/content/drive/MyDrive/Saved from Chrome/guns.safetensors')\n",
|
| 93 |
+
"iris = load_file('/content/drive/MyDrive/Saved from Chrome/iris.safetensors')"
|
| 94 |
+
],
|
| 95 |
+
"metadata": {
|
| 96 |
+
"id": "FftDdBRG7su6"
|
| 97 |
+
},
|
| 98 |
+
"execution_count": 57,
|
| 99 |
+
"outputs": []
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"cell_type": "code",
|
| 103 |
+
"source": [
|
| 104 |
+
"for key in doll:\n",
|
| 105 |
+
" doll[f'{key}'] = doll[f'{key}'].to(dtype=torch.float16)\n",
|
| 106 |
+
" euro[f'{key}'] = euro[f'{key}'].to(dtype=torch.float16)\n",
|
| 107 |
+
" scale[f'{key}'] = scale[f'{key}'].to(dtype=torch.float16)"
|
| 108 |
+
],
|
| 109 |
+
"metadata": {
|
| 110 |
+
"id": "RII9SEqh8KH2"
|
| 111 |
+
},
|
| 112 |
+
"execution_count": 60,
|
| 113 |
+
"outputs": []
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"cell_type": "code",
|
| 117 |
+
"source": [
|
| 118 |
+
"import torch\n",
|
| 119 |
+
"import torch.nn as nn\n",
|
| 120 |
+
"#define metric for similarity\n",
|
| 121 |
+
"tgt_dim = torch.Size([64, 3072])\n",
|
| 122 |
+
"cos0 = nn.CosineSimilarity(dim=1)\n",
|
| 123 |
+
"cos = nn.CosineSimilarity(dim=1)\n",
|
| 124 |
+
"\n",
|
| 125 |
+
"\n",
|
| 126 |
+
"def sim(tgt , ref ,key):\n",
|
| 127 |
+
" return torch.sum(torch.abs(cos(tgt, ref[f'{key}']))) + torch.sum(torch.abs(cos0(tgt, ref[f'{key}'])))\n",
|
| 128 |
+
"#-----#\n",
|
| 129 |
+
"\n",
|
| 130 |
+
"from torch import linalg as LA\n",
|
| 131 |
+
"\n",
|
| 132 |
+
"LA.matrix_norm\n",
|
| 133 |
+
"def rand_search(A , B , key , iters):\n",
|
| 134 |
+
" tgt_norm = (LA.matrix_norm(A[f'{key}']) + LA.matrix_norm(B[f'{key}']))/2\n",
|
| 135 |
+
" tgt_avg = (A[f'{key}'] + B[f'{key}'])/2\n",
|
| 136 |
+
"\n",
|
| 137 |
+
" max_sim = (sim(tgt_avg , A , key) + sim(tgt_avg , B , key))\n",
|
| 138 |
+
" cand = tgt_avg\n",
|
| 139 |
+
"\n",
|
| 140 |
+
" for iter in range(iters):\n",
|
| 141 |
+
" rand = torch.ones(tgt_dim)*(-0.5) + torch.rand(tgt_dim)\n",
|
| 142 |
+
" rand = rand * (tgt_norm/LA.matrix_norm(rand))\n",
|
| 143 |
+
" #rand = (rand + tgt_avg)/2\n",
|
| 144 |
+
" #rand = rand * (tgt_norm/LA.matrix_norm(rand))\n",
|
| 145 |
+
"\n",
|
| 146 |
+
" tmp = sim(rand,A, key) + sim(rand , B, key)\n",
|
| 147 |
+
" if (tmp > max_sim):\n",
|
| 148 |
+
" max_sim = tmp\n",
|
| 149 |
+
" cand = rand\n",
|
| 150 |
+
" print('found!')\n",
|
| 151 |
+
" break\n",
|
| 152 |
+
" #------#\n",
|
| 153 |
+
" print('returning')\n",
|
| 154 |
+
" return cand , max_sim\n",
|
| 155 |
+
"#-----#"
|
| 156 |
+
],
|
| 157 |
+
"metadata": {
|
| 158 |
+
"id": "hJL6QEclHdHn"
|
| 159 |
+
},
|
| 160 |
+
"execution_count": 104,
|
| 161 |
+
"outputs": []
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"cell_type": "code",
|
| 165 |
+
"source": [
|
| 166 |
+
"cand , max_sim = rand_search(cgi , iris , 'lora_unet_double_blocks_0_img_attn_proj.lora_down.weight' , 1000)\n",
|
| 167 |
+
"print(sim(cand , iris , key))\n",
|
| 168 |
+
"print(sim(cand , cgi , key))"
|
| 169 |
+
],
|
| 170 |
+
"metadata": {
|
| 171 |
+
"colab": {
|
| 172 |
+
"base_uri": "https://localhost:8080/"
|
| 173 |
+
},
|
| 174 |
+
"id": "ckyBSQi5Ll4F",
|
| 175 |
+
"outputId": "341f7192-083d-4423-f61f-4f49d5756e79"
|
| 176 |
+
},
|
| 177 |
+
"execution_count": 106,
|
| 178 |
+
"outputs": [
|
| 179 |
+
{
|
| 180 |
+
"output_type": "stream",
|
| 181 |
+
"name": "stdout",
|
| 182 |
+
"text": [
|
| 183 |
+
"returning\n",
|
| 184 |
+
"tensor(91.1875, dtype=torch.float16)\n",
|
| 185 |
+
"tensor(90.2500, dtype=torch.float16)\n"
|
| 186 |
+
]
|
| 187 |
+
}
|
| 188 |
+
]
|
| 189 |
+
},
|
| 190 |
+
{
|
| 191 |
+
"cell_type": "code",
|
| 192 |
+
"source": [
|
| 193 |
+
"(torch.rand(1).to(dtype=torch.float16)*3).item()"
|
| 194 |
+
],
|
| 195 |
+
"metadata": {
|
| 196 |
+
"colab": {
|
| 197 |
+
"base_uri": "https://localhost:8080/"
|
| 198 |
+
},
|
| 199 |
+
"id": "XLwslN61hiIJ",
|
| 200 |
+
"outputId": "9e3cbba6-3727-4772-f453-fecf8a408790"
|
| 201 |
+
},
|
| 202 |
+
"execution_count": 16,
|
| 203 |
+
"outputs": [
|
| 204 |
+
{
|
| 205 |
+
"output_type": "execute_result",
|
| 206 |
+
"data": {
|
| 207 |
+
"text/plain": [
|
| 208 |
+
"0.2138671875"
|
| 209 |
+
]
|
| 210 |
+
},
|
| 211 |
+
"metadata": {},
|
| 212 |
+
"execution_count": 16
|
| 213 |
+
}
|
| 214 |
+
]
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"cell_type": "code",
|
| 218 |
+
"source": [
|
| 219 |
+
"torch.rand(1).to(dtype=torch.float16)*10"
|
| 220 |
+
],
|
| 221 |
+
"metadata": {
|
| 222 |
+
"colab": {
|
| 223 |
+
"base_uri": "https://localhost:8080/"
|
| 224 |
+
},
|
| 225 |
+
"id": "AKwh0lZ1f8dJ",
|
| 226 |
+
"outputId": "59186526-bd73-4efe-925a-3e7a9c738e53"
|
| 227 |
+
},
|
| 228 |
+
"execution_count": 13,
|
| 229 |
+
"outputs": [
|
| 230 |
+
{
|
| 231 |
+
"output_type": "execute_result",
|
| 232 |
+
"data": {
|
| 233 |
+
"text/plain": [
|
| 234 |
+
"tensor([6.8555], dtype=torch.float16)"
|
| 235 |
+
]
|
| 236 |
+
},
|
| 237 |
+
"metadata": {},
|
| 238 |
+
"execution_count": 13
|
| 239 |
+
}
|
| 240 |
+
]
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"cell_type": "code",
|
| 244 |
+
"source": [
|
| 245 |
+
"import torch\n",
|
| 246 |
+
"import torch.nn as nn\n",
|
| 247 |
+
"#define metric for similarity\n",
|
| 248 |
+
"tgt_dim = torch.Size([64, 3072])\n",
|
| 249 |
+
"cos0 = nn.CosineSimilarity(dim=0)\n",
|
| 250 |
+
"\n",
|
| 251 |
+
"\n",
|
| 252 |
+
"\n",
|
| 253 |
+
"cos = nn.CosineSimilarity(dim=1)\n",
|
| 254 |
+
"\n",
|
| 255 |
+
"\n",
|
| 256 |
+
"def sim(tgt , ref ,key):\n",
|
| 257 |
+
" return torch.sum(torch.abs(cos(tgt, ref[f'{key}']))) + torch.sum(torch.abs(cos0(tgt, ref[f'{key}'])))\n",
|
| 258 |
+
"#-----#"
|
| 259 |
+
],
|
| 260 |
+
"metadata": {
|
| 261 |
+
"colab": {
|
| 262 |
+
"base_uri": "https://localhost:8080/"
|
| 263 |
+
},
|
| 264 |
+
"id": "SNCvvkb2h3Zb",
|
| 265 |
+
"outputId": "725fabd1-3fe2-4ac2-f24c-5f9309d45e4a"
|
| 266 |
+
},
|
| 267 |
+
"execution_count": 37,
|
| 268 |
+
"outputs": [
|
| 269 |
+
{
|
| 270 |
+
"output_type": "execute_result",
|
| 271 |
+
"data": {
|
| 272 |
+
"text/plain": [
|
| 273 |
+
"7.715576171875"
|
| 274 |
+
]
|
| 275 |
+
},
|
| 276 |
+
"metadata": {},
|
| 277 |
+
"execution_count": 37
|
| 278 |
+
}
|
| 279 |
+
]
|
| 280 |
+
},
|
| 281 |
+
{
|
| 282 |
+
"cell_type": "code",
|
| 283 |
+
"source": [
|
| 284 |
+
"from safetensors.torch import load_file , save_file\n",
|
| 285 |
+
"import torch\n",
|
| 286 |
+
"import torch.nn as nn\n",
|
| 287 |
+
"from torch import linalg as LA\n",
|
| 288 |
+
"device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
|
| 289 |
+
"#define metric for similarity\n",
|
| 290 |
+
"cos0 = nn.CosineSimilarity(dim=0).to(device)\n",
|
| 291 |
+
"final_score = 0\n",
|
| 292 |
+
"highest_score = 0\n",
|
| 293 |
+
"w_cgi = 1\n",
|
| 294 |
+
"w_doll = 2\n",
|
| 295 |
+
"w_euro = 2\n",
|
| 296 |
+
"w_guns = 1\n",
|
| 297 |
+
"w_iris = 2\n",
|
| 298 |
+
"w_scale = 1\n",
|
| 299 |
+
"\n",
|
| 300 |
+
"w_noise = 0.00001 * (w_cgi + w_doll + w_euro + w_guns + w_iris + w_scale)\n",
|
| 301 |
+
"fixed_noise = {}\n",
|
| 302 |
+
"\n",
|
| 303 |
+
"#for key in doll:\n",
|
| 304 |
+
"# fixed_noise[f'{key}'] = torch.zeros(doll[f'{key}'].shape).to(device = device , dtype=torch.float16)\n",
|
| 305 |
+
"#------#\n",
|
| 306 |
+
"#w_offset = 0* (w1+w2+w3)\n",
|
| 307 |
+
"#_w_offset = 0\n",
|
| 308 |
+
"\n",
|
| 309 |
+
"W = (w_cgi + w_doll + w_euro + w_guns + w_iris + w_scale + w_noise)*torch.ones(1).to(device = device,dtype=torch.float16)\n",
|
| 310 |
+
"\n",
|
| 311 |
+
"SCALE = 0.0001\n",
|
| 312 |
+
"one = torch.ones(1).to(dtype=torch.float16).to(device)\n",
|
| 313 |
+
"\n",
|
| 314 |
+
"for attempt in range(1000):\n",
|
| 315 |
+
" print(f'attempt no : {attempt+1} ')\n",
|
| 316 |
+
" merge = load_file('/content/drive/MyDrive/Saved from Chrome/dolls.safetensors')\n",
|
| 317 |
+
" for key in doll:\n",
|
| 318 |
+
" tgt_dim = doll[f'{key}'].shape\n",
|
| 319 |
+
" if tgt_dim == torch.Size([]): continue\n",
|
| 320 |
+
" r_cgi = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_cgi\n",
|
| 321 |
+
" r_doll = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_doll\n",
|
| 322 |
+
" r_euro = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_euro\n",
|
| 323 |
+
" r_guns = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_guns\n",
|
| 324 |
+
" r_iris = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_iris\n",
|
| 325 |
+
" r_scale = torch.rand(1).to(device = device,dtype=torch.float16).item()*w_scale\n",
|
| 326 |
+
" #------#\n",
|
| 327 |
+
" noise = torch.rand(tgt_dim).to(device = device,dtype=torch.float16)\n",
|
| 328 |
+
" noise_norm = LA.matrix_norm(noise).to(device = device,dtype=torch.float16).item()\n",
|
| 329 |
+
" noise = (w_noise/noise_norm)*noise.to(device = device,dtype=torch.float16)\n",
|
| 330 |
+
" #-----#\n",
|
| 331 |
+
" merge[f'{key}'] = r_cgi * cgi[f'{key}'] #overwrite\n",
|
| 332 |
+
" merge[f'{key}'] = merge[f'{key}'] + r_doll * doll[f'{key}']\n",
|
| 333 |
+
" merge[f'{key}'] = merge[f'{key}'] + r_euro * euro[f'{key}']\n",
|
| 334 |
+
" merge[f'{key}'] = merge[f'{key}'] + r_guns * guns[f'{key}']\n",
|
| 335 |
+
" merge[f'{key}'] = merge[f'{key}'] + r_iris * iris[f'{key}']\n",
|
| 336 |
+
" merge[f'{key}'] = merge[f'{key}'] + r_scale * scale[f'{key}']\n",
|
| 337 |
+
" merge[f'{key}'] = ((merge[f'{key}'] + noise)/W).to(device = device,dtype=torch.float16)\n",
|
| 338 |
+
" #-------#\n",
|
| 339 |
+
" score = torch.zeros(1).to(device = device, dtype=torch.float32)\n",
|
| 340 |
+
" #----#\n",
|
| 341 |
+
" NUM_ITERS = 10\n",
|
| 342 |
+
" for iter in range(NUM_ITERS):\n",
|
| 343 |
+
" for key in doll:\n",
|
| 344 |
+
" tgt_dim = doll[f'{key}'].shape\n",
|
| 345 |
+
" if tgt_dim == torch.Size([]): continue\n",
|
| 346 |
+
" vec = torch.rand(tgt_dim[0]).to(device = device,dtype=torch.float16)\n",
|
| 347 |
+
" cgi_out = torch.matmul(vec , cgi[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 348 |
+
" doll_out = torch.matmul(vec , doll[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 349 |
+
" euro_out = torch.matmul(vec , euro[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 350 |
+
" guns_out = torch.matmul(vec , guns[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 351 |
+
" iris_out = torch.matmul(vec , iris[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 352 |
+
" scale_out = torch.matmul(vec , scale[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 353 |
+
" merge_out = torch.matmul(vec , merge[f'{key}']).to(device = device,dtype=torch.float16)\n",
|
| 354 |
+
" #-------#\n",
|
| 355 |
+
" sim_value_cgi = torch.abs(cos0(cgi_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 356 |
+
" sim_value_doll = torch.abs(cos0(doll_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 357 |
+
" sim_value_euro = torch.abs(cos0(euro_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 358 |
+
" sim_value_guns = torch.abs(cos0(guns_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 359 |
+
" sim_value_iris = torch.abs(cos0(iris_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 360 |
+
" sim_value_scale = torch.abs(cos0(scale_out , merge_out)).to(device = device,dtype=torch.float32)*SCALE\n",
|
| 361 |
+
" score = score + SCALE*(sim_value_cgi + 2*sim_value_doll + 2*sim_value_euro + sim_value_guns + 2*sim_value_iris + sim_value_scale)/9 #<--- This score can be anything at all\n",
|
| 362 |
+
" #----#\n",
|
| 363 |
+
" #-----#\n",
|
| 364 |
+
"\n",
|
| 365 |
+
" final_score = (1000/(NUM_ITERS * SCALE))*score.to(device = 'cpu' , dtype=torch.float32).item()\n",
|
| 366 |
+
" if (final_score>highest_score) :\n",
|
| 367 |
+
" highest_score = final_score\n",
|
| 368 |
+
" print('new highscore!')\n",
|
| 369 |
+
" print(f'score : {final_score} pts')\n",
|
| 370 |
+
" #------#\n",
|
| 371 |
+
" save_file(merge , 'all_merge_R4.safetensors')\n",
|
| 372 |
+
" #------#\n",
|
| 373 |
+
"\n",
|
| 374 |
+
"print(f'------------')\n",
|
| 375 |
+
"print(f'Final score : {highest_score} pts')\n",
|
| 376 |
+
"\n",
|
| 377 |
+
"\n",
|
| 378 |
+
"#all R1 23.190992578747682\n",
|
| 379 |
+
"\n",
|
| 380 |
+
"#all R2 23.333244826062582\n",
|
| 381 |
+
"\n",
|
| 382 |
+
"#all R3 23.34471355425194\n",
|
| 383 |
+
"\n",
|
| 384 |
+
"#all R4 23.402637452818453"
|
| 385 |
+
],
|
| 386 |
+
"metadata": {
|
| 387 |
+
"colab": {
|
| 388 |
+
"base_uri": "https://localhost:8080/",
|
| 389 |
+
"height": 1000
|
| 390 |
+
},
|
| 391 |
+
"id": "9L_g5Zp9Du2E",
|
| 392 |
+
"outputId": "a3aa2bde-061e-43f5-ca35-96bdc470be80"
|
| 393 |
+
},
|
| 394 |
+
"execution_count": 33,
|
| 395 |
+
"outputs": [
|
| 396 |
+
{
|
| 397 |
+
"output_type": "stream",
|
| 398 |
+
"name": "stdout",
|
| 399 |
+
"text": [
|
| 400 |
+
"attempt no : 1 \n",
|
| 401 |
+
"new highscore!\n",
|
| 402 |
+
"score : 23.264414267032407 pts\n",
|
| 403 |
+
"attempt no : 2 \n",
|
| 404 |
+
"attempt no : 3 \n",
|
| 405 |
+
"attempt no : 4 \n",
|
| 406 |
+
"new highscore!\n",
|
| 407 |
+
"score : 23.29399467271287 pts\n",
|
| 408 |
+
"attempt no : 5 \n",
|
| 409 |
+
"attempt no : 6 \n",
|
| 410 |
+
"attempt no : 7 \n",
|
| 411 |
+
"attempt no : 8 \n",
|
| 412 |
+
"attempt no : 9 \n",
|
| 413 |
+
"attempt no : 10 \n",
|
| 414 |
+
"attempt no : 11 \n",
|
| 415 |
+
"new highscore!\n",
|
| 416 |
+
"score : 23.362628780887462 pts\n",
|
| 417 |
+
"attempt no : 12 \n",
|
| 418 |
+
"attempt no : 13 \n",
|
| 419 |
+
"attempt no : 14 \n",
|
| 420 |
+
"attempt no : 15 \n",
|
| 421 |
+
"attempt no : 16 \n",
|
| 422 |
+
"attempt no : 17 \n",
|
| 423 |
+
"attempt no : 18 \n",
|
| 424 |
+
"attempt no : 19 \n",
|
| 425 |
+
"attempt no : 20 \n",
|
| 426 |
+
"attempt no : 21 \n",
|
| 427 |
+
"attempt no : 22 \n",
|
| 428 |
+
"attempt no : 23 \n",
|
| 429 |
+
"new highscore!\n",
|
| 430 |
+
"score : 23.37011210329365 pts\n",
|
| 431 |
+
"attempt no : 24 \n",
|
| 432 |
+
"attempt no : 25 \n",
|
| 433 |
+
"attempt no : 26 \n",
|
| 434 |
+
"attempt no : 27 \n",
|
| 435 |
+
"attempt no : 28 \n",
|
| 436 |
+
"attempt no : 29 \n",
|
| 437 |
+
"attempt no : 30 \n",
|
| 438 |
+
"attempt no : 31 \n",
|
| 439 |
+
"attempt no : 32 \n",
|
| 440 |
+
"attempt no : 33 \n",
|
| 441 |
+
"attempt no : 34 \n",
|
| 442 |
+
"new highscore!\n",
|
| 443 |
+
"score : 23.402637452818453 pts\n",
|
| 444 |
+
"attempt no : 35 \n",
|
| 445 |
+
"attempt no : 36 \n",
|
| 446 |
+
"attempt no : 37 \n",
|
| 447 |
+
"attempt no : 38 \n",
|
| 448 |
+
"attempt no : 39 \n",
|
| 449 |
+
"attempt no : 40 \n",
|
| 450 |
+
"attempt no : 41 \n",
|
| 451 |
+
"attempt no : 42 \n",
|
| 452 |
+
"attempt no : 43 \n",
|
| 453 |
+
"attempt no : 44 \n",
|
| 454 |
+
"attempt no : 45 \n",
|
| 455 |
+
"attempt no : 46 \n",
|
| 456 |
+
"attempt no : 47 \n",
|
| 457 |
+
"attempt no : 48 \n",
|
| 458 |
+
"attempt no : 49 \n",
|
| 459 |
+
"attempt no : 50 \n",
|
| 460 |
+
"attempt no : 51 \n",
|
| 461 |
+
"attempt no : 52 \n",
|
| 462 |
+
"attempt no : 53 \n",
|
| 463 |
+
"attempt no : 54 \n",
|
| 464 |
+
"attempt no : 55 \n",
|
| 465 |
+
"attempt no : 56 \n",
|
| 466 |
+
"attempt no : 57 \n",
|
| 467 |
+
"attempt no : 58 \n",
|
| 468 |
+
"attempt no : 59 \n",
|
| 469 |
+
"attempt no : 60 \n",
|
| 470 |
+
"attempt no : 61 \n",
|
| 471 |
+
"attempt no : 62 \n",
|
| 472 |
+
"attempt no : 63 \n",
|
| 473 |
+
"attempt no : 64 \n",
|
| 474 |
+
"attempt no : 65 \n",
|
| 475 |
+
"attempt no : 66 \n",
|
| 476 |
+
"attempt no : 67 \n",
|
| 477 |
+
"attempt no : 68 \n",
|
| 478 |
+
"attempt no : 69 \n",
|
| 479 |
+
"attempt no : 70 \n",
|
| 480 |
+
"attempt no : 71 \n",
|
| 481 |
+
"attempt no : 72 \n",
|
| 482 |
+
"attempt no : 73 \n",
|
| 483 |
+
"attempt no : 74 \n",
|
| 484 |
+
"attempt no : 75 \n",
|
| 485 |
+
"attempt no : 76 \n",
|
| 486 |
+
"attempt no : 77 \n",
|
| 487 |
+
"attempt no : 78 \n",
|
| 488 |
+
"attempt no : 79 \n",
|
| 489 |
+
"attempt no : 80 \n",
|
| 490 |
+
"attempt no : 81 \n",
|
| 491 |
+
"attempt no : 82 \n",
|
| 492 |
+
"attempt no : 83 \n",
|
| 493 |
+
"attempt no : 84 \n",
|
| 494 |
+
"attempt no : 85 \n",
|
| 495 |
+
"attempt no : 86 \n"
|
| 496 |
+
]
|
| 497 |
+
},
|
| 498 |
+
{
|
| 499 |
+
"output_type": "error",
|
| 500 |
+
"ename": "KeyboardInterrupt",
|
| 501 |
+
"evalue": "",
|
| 502 |
+
"traceback": [
|
| 503 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 504 |
+
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
|
| 505 |
+
"\u001b[0;32m<ipython-input-33-037249458db5>\u001b[0m in \u001b[0;36m<cell line: 31>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 61\u001b[0m \u001b[0mtgt_dim\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdoll\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34mf'{key}'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtgt_dim\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mcontinue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 63\u001b[0;31m \u001b[0mvec\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtgt_dim\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfloat16\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 64\u001b[0m \u001b[0mcgi_out\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatmul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvec\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0mcgi\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34mf'{key}'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfloat16\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[0mdoll_out\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatmul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvec\u001b[0m \u001b[0;34m,\u001b[0m \u001b[0mdoll\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34mf'{key}'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfloat16\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
| 506 |
+
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
|
| 507 |
+
]
|
| 508 |
+
}
|
| 509 |
+
]
|
| 510 |
+
},
|
| 511 |
+
{
|
| 512 |
+
"cell_type": "code",
|
| 513 |
+
"source": [
|
| 514 |
+
" for key in doll:\n",
|
| 515 |
+
" if final_score<38.5: break\n",
|
| 516 |
+
" _w_offset = w_offset\n",
|
| 517 |
+
" W = (w1+w2+w3 + w_noise + _w_offset)*torch.ones(1).to(device = device,dtype=torch.float16)\n",
|
| 518 |
+
" tgt_dim = doll[f'{key}'].shape\n",
|
| 519 |
+
" if tgt_dim == torch.Size([]): continue\n",
|
| 520 |
+
" fixed_noise[f'{key}'] = fixed_noise[f'{key}'] + merge[f'{key}']\n",
|
| 521 |
+
" fixed_noise[f'{key}'] = (fixed_noise[f'{key}'] * (w_offset*torch.ones(1).to(device = device,dtype=torch.float16)/LA.matrix_norm(fixed_noise[f'{key}']))).to(device = device,dtype=torch.float16)"
|
| 522 |
+
],
|
| 523 |
+
"metadata": {
|
| 524 |
+
"id": "jWFHMJN6TqDq"
|
| 525 |
+
},
|
| 526 |
+
"execution_count": null,
|
| 527 |
+
"outputs": []
|
| 528 |
+
},
|
| 529 |
+
{
|
| 530 |
+
"cell_type": "code",
|
| 531 |
+
"source": [
|
| 532 |
+
" vec = torch.rand(tgt_dim[0]).to(dtype=torch.float16)\n",
|
| 533 |
+
" same = torch.abs(cos0(vec ,vec))"
|
| 534 |
+
],
|
| 535 |
+
"metadata": {
|
| 536 |
+
"id": "k7Pq-kDbuNnQ"
|
| 537 |
+
},
|
| 538 |
+
"execution_count": 64,
|
| 539 |
+
"outputs": []
|
| 540 |
+
},
|
| 541 |
+
{
|
| 542 |
+
"cell_type": "code",
|
| 543 |
+
"source": [
|
| 544 |
+
"same"
|
| 545 |
+
],
|
| 546 |
+
"metadata": {
|
| 547 |
+
"colab": {
|
| 548 |
+
"base_uri": "https://localhost:8080/"
|
| 549 |
+
},
|
| 550 |
+
"id": "ANBPfP7tuOoa",
|
| 551 |
+
"outputId": "24300487-f874-4f1b-beb7-0f441ec7df4a"
|
| 552 |
+
},
|
| 553 |
+
"execution_count": 65,
|
| 554 |
+
"outputs": [
|
| 555 |
+
{
|
| 556 |
+
"output_type": "execute_result",
|
| 557 |
+
"data": {
|
| 558 |
+
"text/plain": [
|
| 559 |
+
"tensor(1., dtype=torch.float16)"
|
| 560 |
+
]
|
| 561 |
+
},
|
| 562 |
+
"metadata": {},
|
| 563 |
+
"execution_count": 65
|
| 564 |
+
}
|
| 565 |
+
]
|
| 566 |
+
},
|
| 567 |
+
{
|
| 568 |
+
"cell_type": "code",
|
| 569 |
+
"source": [
|
| 570 |
+
"torch.ones(1).to(dtype=torch.float16)"
|
| 571 |
+
],
|
| 572 |
+
"metadata": {
|
| 573 |
+
"colab": {
|
| 574 |
+
"base_uri": "https://localhost:8080/"
|
| 575 |
+
},
|
| 576 |
+
"id": "zN92j8JJuQ6G",
|
| 577 |
+
"outputId": "b810f4e6-a8f3-426a-ae52-ffbd44fb3f00"
|
| 578 |
+
},
|
| 579 |
+
"execution_count": 66,
|
| 580 |
+
"outputs": [
|
| 581 |
+
{
|
| 582 |
+
"output_type": "execute_result",
|
| 583 |
+
"data": {
|
| 584 |
+
"text/plain": [
|
| 585 |
+
"tensor([1.], dtype=torch.float16)"
|
| 586 |
+
]
|
| 587 |
+
},
|
| 588 |
+
"metadata": {},
|
| 589 |
+
"execution_count": 66
|
| 590 |
+
}
|
| 591 |
+
]
|
| 592 |
+
},
|
| 593 |
+
{
|
| 594 |
+
"cell_type": "code",
|
| 595 |
+
"source": [
|
| 596 |
+
"\n",
|
| 597 |
+
"\n",
|
| 598 |
+
"\n",
|
| 599 |
+
"\n",
|
| 600 |
+
"\n",
|
| 601 |
+
""
|
| 602 |
+
],
|
| 603 |
+
"metadata": {
|
| 604 |
+
"colab": {
|
| 605 |
+
"base_uri": "https://localhost:8080/"
|
| 606 |
+
},
|
| 607 |
+
"id": "py-JMJzhsAI4",
|
| 608 |
+
"outputId": "207cd809-031c-48e3-af0a-98bc114d910e"
|
| 609 |
+
},
|
| 610 |
+
"execution_count": 85,
|
| 611 |
+
"outputs": [
|
| 612 |
+
{
|
| 613 |
+
"output_type": "stream",
|
| 614 |
+
"name": "stdout",
|
| 615 |
+
"text": [
|
| 616 |
+
"score : 45.8125 pts\n"
|
| 617 |
+
]
|
| 618 |
+
}
|
| 619 |
+
]
|
| 620 |
+
},
|
| 621 |
+
{
|
| 622 |
+
"cell_type": "code",
|
| 623 |
+
"source": [
|
| 624 |
+
"%cd /content/\n",
|
| 625 |
+
"save_file(merge , 'doll_euro_scale_R_merge.safetensors')"
|
| 626 |
+
],
|
| 627 |
+
"metadata": {
|
| 628 |
+
"id": "7qogsYsAr2QU"
|
| 629 |
+
},
|
| 630 |
+
"execution_count": null,
|
| 631 |
+
"outputs": []
|
| 632 |
+
},
|
| 633 |
+
{
|
| 634 |
+
"cell_type": "code",
|
| 635 |
+
"source": [],
|
| 636 |
+
"metadata": {
|
| 637 |
+
"id": "9wzLwurSpwpL"
|
| 638 |
+
},
|
| 639 |
+
"execution_count": null,
|
| 640 |
+
"outputs": []
|
| 641 |
+
},
|
| 642 |
+
{
|
| 643 |
+
"cell_type": "code",
|
| 644 |
+
"source": [
|
| 645 |
+
"test = torch.rand(tgt_dim)\n",
|
| 646 |
+
"vec = torch.rand(tgt_dim[0])"
|
| 647 |
+
],
|
| 648 |
+
"metadata": {
|
| 649 |
+
"id": "DHdy4DptowYG"
|
| 650 |
+
},
|
| 651 |
+
"execution_count": 47,
|
| 652 |
+
"outputs": []
|
| 653 |
+
},
|
| 654 |
+
{
|
| 655 |
+
"cell_type": "code",
|
| 656 |
+
"source": [
|
| 657 |
+
"tgt_dim[0]"
|
| 658 |
+
],
|
| 659 |
+
"metadata": {
|
| 660 |
+
"colab": {
|
| 661 |
+
"base_uri": "https://localhost:8080/"
|
| 662 |
+
},
|
| 663 |
+
"id": "WeNJ0bquphtx",
|
| 664 |
+
"outputId": "442bfb2e-c1ab-4549-a4ea-ca80d3cc9a7d"
|
| 665 |
+
},
|
| 666 |
+
"execution_count": 46,
|
| 667 |
+
"outputs": [
|
| 668 |
+
{
|
| 669 |
+
"output_type": "execute_result",
|
| 670 |
+
"data": {
|
| 671 |
+
"text/plain": [
|
| 672 |
+
"9216"
|
| 673 |
+
]
|
| 674 |
+
},
|
| 675 |
+
"metadata": {},
|
| 676 |
+
"execution_count": 46
|
| 677 |
+
}
|
| 678 |
+
]
|
| 679 |
+
},
|
| 680 |
+
{
|
| 681 |
+
"cell_type": "code",
|
| 682 |
+
"source": [
|
| 683 |
+
"(torch.matmul(vec,test)).shape"
|
| 684 |
+
],
|
| 685 |
+
"metadata": {
|
| 686 |
+
"colab": {
|
| 687 |
+
"base_uri": "https://localhost:8080/"
|
| 688 |
+
},
|
| 689 |
+
"id": "xqZp3Xo8pQuW",
|
| 690 |
+
"outputId": "68e5c25e-3391-45e7-9c73-45e0174ddbc1"
|
| 691 |
+
},
|
| 692 |
+
"execution_count": 48,
|
| 693 |
+
"outputs": [
|
| 694 |
+
{
|
| 695 |
+
"output_type": "execute_result",
|
| 696 |
+
"data": {
|
| 697 |
+
"text/plain": [
|
| 698 |
+
"torch.Size([64])"
|
| 699 |
+
]
|
| 700 |
+
},
|
| 701 |
+
"metadata": {},
|
| 702 |
+
"execution_count": 48
|
| 703 |
+
}
|
| 704 |
+
]
|
| 705 |
+
},
|
| 706 |
+
{
|
| 707 |
+
"cell_type": "code",
|
| 708 |
+
"source": [
|
| 709 |
+
"tgt_dim = torch.Size([64, 3072])\n",
|
| 710 |
+
"cosa = nn.CosineSimilarity(dim=0)\n",
|
| 711 |
+
"cos_dim1 = nn.CosineSimilarity(dim=1)\n",
|
| 712 |
+
"\n",
|
| 713 |
+
"for key in cgi:\n",
|
| 714 |
+
" if not cgi[f'{key}'].shape == torch.Size([64, 3072]): continue\n",
|
| 715 |
+
" print(f'{key} : ')\n",
|
| 716 |
+
" print(torch.sum(torch.abs(cos_dim1(cgi[f'{key}'] , iris[f'{key}']))))"
|
| 717 |
+
],
|
| 718 |
+
"metadata": {
|
| 719 |
+
"colab": {
|
| 720 |
+
"base_uri": "https://localhost:8080/"
|
| 721 |
+
},
|
| 722 |
+
"id": "VFNw0Nck8V6Q",
|
| 723 |
+
"outputId": "e48bab98-18f7-43bb-d1cf-89f3e00f7ccf"
|
| 724 |
+
},
|
| 725 |
+
"execution_count": 39,
|
| 726 |
+
"outputs": [
|
| 727 |
+
{
|
| 728 |
+
"output_type": "stream",
|
| 729 |
+
"name": "stdout",
|
| 730 |
+
"text": [
|
| 731 |
+
"lora_unet_double_blocks_0_img_attn_proj.lora_down.weight : \n",
|
| 732 |
+
"tensor(1.6982, dtype=torch.float16)\n",
|
| 733 |
+
"lora_unet_double_blocks_0_img_attn_qkv.lora_down.weight : \n",
|
| 734 |
+
"tensor(1.8145, dtype=torch.float16)\n",
|
| 735 |
+
"lora_unet_double_blocks_0_img_mlp_0.lora_down.weight : \n",
|
| 736 |
+
"tensor(1.6309, dtype=torch.float16)\n",
|
| 737 |
+
"lora_unet_double_blocks_0_img_mod_lin.lora_down.weight : \n",
|
| 738 |
+
"tensor(2.6211, dtype=torch.float16)\n",
|
| 739 |
+
"lora_unet_double_blocks_0_txt_attn_proj.lora_down.weight : \n",
|
| 740 |
+
"tensor(2.3203, dtype=torch.float16)\n",
|
| 741 |
+
"lora_unet_double_blocks_0_txt_attn_qkv.lora_down.weight : \n",
|
| 742 |
+
"tensor(2.3027, dtype=torch.float16)\n",
|
| 743 |
+
"lora_unet_double_blocks_0_txt_mlp_0.lora_down.weight : \n",
|
| 744 |
+
"tensor(2.5898, dtype=torch.float16)\n",
|
| 745 |
+
"lora_unet_double_blocks_0_txt_mod_lin.lora_down.weight : \n",
|
| 746 |
+
"tensor(2.7402, dtype=torch.float16)\n",
|
| 747 |
+
"lora_unet_double_blocks_10_img_attn_proj.lora_down.weight : \n",
|
| 748 |
+
"tensor(2.0410, dtype=torch.float16)\n",
|
| 749 |
+
"lora_unet_double_blocks_10_img_attn_qkv.lora_down.weight : \n",
|
| 750 |
+
"tensor(1.3350, dtype=torch.float16)\n",
|
| 751 |
+
"lora_unet_double_blocks_10_img_mlp_0.lora_down.weight : \n",
|
| 752 |
+
"tensor(2.0020, dtype=torch.float16)\n",
|
| 753 |
+
"lora_unet_double_blocks_10_img_mod_lin.lora_down.weight : \n",
|
| 754 |
+
"tensor(2.6562, dtype=torch.float16)\n",
|
| 755 |
+
"lora_unet_double_blocks_10_txt_attn_proj.lora_down.weight : \n",
|
| 756 |
+
"tensor(1.1816, dtype=torch.float16)\n",
|
| 757 |
+
"lora_unet_double_blocks_10_txt_attn_qkv.lora_down.weight : \n",
|
| 758 |
+
"tensor(1.1348, dtype=torch.float16)\n",
|
| 759 |
+
"lora_unet_double_blocks_10_txt_mlp_0.lora_down.weight : \n",
|
| 760 |
+
"tensor(3.0156, dtype=torch.float16)\n",
|
| 761 |
+
"lora_unet_double_blocks_10_txt_mod_lin.lora_down.weight : \n",
|
| 762 |
+
"tensor(1.4746, dtype=torch.float16)\n",
|
| 763 |
+
"lora_unet_double_blocks_11_img_attn_proj.lora_down.weight : \n",
|
| 764 |
+
"tensor(1.8359, dtype=torch.float16)\n",
|
| 765 |
+
"lora_unet_double_blocks_11_img_attn_qkv.lora_down.weight : \n",
|
| 766 |
+
"tensor(1.5312, dtype=torch.float16)\n",
|
| 767 |
+
"lora_unet_double_blocks_11_img_mlp_0.lora_down.weight : \n",
|
| 768 |
+
"tensor(2.1465, dtype=torch.float16)\n",
|
| 769 |
+
"lora_unet_double_blocks_11_img_mod_lin.lora_down.weight : \n",
|
| 770 |
+
"tensor(3.9277, dtype=torch.float16)\n",
|
| 771 |
+
"lora_unet_double_blocks_11_txt_attn_proj.lora_down.weight : \n",
|
| 772 |
+
"tensor(1.7246, dtype=torch.float16)\n",
|
| 773 |
+
"lora_unet_double_blocks_11_txt_attn_qkv.lora_down.weight : \n",
|
| 774 |
+
"tensor(1.8594, dtype=torch.float16)\n",
|
| 775 |
+
"lora_unet_double_blocks_11_txt_mlp_0.lora_down.weight : \n",
|
| 776 |
+
"tensor(3.6465, dtype=torch.float16)\n",
|
| 777 |
+
"lora_unet_double_blocks_11_txt_mod_lin.lora_down.weight : \n",
|
| 778 |
+
"tensor(2.6152, dtype=torch.float16)\n",
|
| 779 |
+
"lora_unet_double_blocks_12_img_attn_proj.lora_down.weight : \n",
|
| 780 |
+
"tensor(1.7295, dtype=torch.float16)\n",
|
| 781 |
+
"lora_unet_double_blocks_12_img_attn_qkv.lora_down.weight : \n",
|
| 782 |
+
"tensor(1.4795, dtype=torch.float16)\n",
|
| 783 |
+
"lora_unet_double_blocks_12_img_mlp_0.lora_down.weight : \n",
|
| 784 |
+
"tensor(3.4043, dtype=torch.float16)\n",
|
| 785 |
+
"lora_unet_double_blocks_12_img_mod_lin.lora_down.weight : \n",
|
| 786 |
+
"tensor(2.0137, dtype=torch.float16)\n",
|
| 787 |
+
"lora_unet_double_blocks_12_txt_attn_proj.lora_down.weight : \n",
|
| 788 |
+
"tensor(1.4375, dtype=torch.float16)\n",
|
| 789 |
+
"lora_unet_double_blocks_12_txt_attn_qkv.lora_down.weight : \n",
|
| 790 |
+
"tensor(1.8994, dtype=torch.float16)\n",
|
| 791 |
+
"lora_unet_double_blocks_12_txt_mlp_0.lora_down.weight : \n",
|
| 792 |
+
"tensor(2.1152, dtype=torch.float16)\n",
|
| 793 |
+
"lora_unet_double_blocks_12_txt_mod_lin.lora_down.weight : \n",
|
| 794 |
+
"tensor(1.2744, dtype=torch.float16)\n",
|
| 795 |
+
"lora_unet_double_blocks_13_img_attn_proj.lora_down.weight : \n",
|
| 796 |
+
"tensor(3.0742, dtype=torch.float16)\n",
|
| 797 |
+
"lora_unet_double_blocks_13_img_attn_qkv.lora_down.weight : \n",
|
| 798 |
+
"tensor(1.4980, dtype=torch.float16)\n",
|
| 799 |
+
"lora_unet_double_blocks_13_img_mlp_0.lora_down.weight : \n",
|
| 800 |
+
"tensor(1.9609, dtype=torch.float16)\n",
|
| 801 |
+
"lora_unet_double_blocks_13_img_mod_lin.lora_down.weight : \n",
|
| 802 |
+
"tensor(2.6133, dtype=torch.float16)\n",
|
| 803 |
+
"lora_unet_double_blocks_13_txt_attn_proj.lora_down.weight : \n",
|
| 804 |
+
"tensor(1.6904, dtype=torch.float16)\n",
|
| 805 |
+
"lora_unet_double_blocks_13_txt_attn_qkv.lora_down.weight : \n",
|
| 806 |
+
"tensor(2.1680, dtype=torch.float16)\n",
|
| 807 |
+
"lora_unet_double_blocks_13_txt_mlp_0.lora_down.weight : \n",
|
| 808 |
+
"tensor(2.8574, dtype=torch.float16)\n",
|
| 809 |
+
"lora_unet_double_blocks_13_txt_mod_lin.lora_down.weight : \n",
|
| 810 |
+
"tensor(1.9053, dtype=torch.float16)\n",
|
| 811 |
+
"lora_unet_double_blocks_14_img_attn_proj.lora_down.weight : \n",
|
| 812 |
+
"tensor(1.8135, dtype=torch.float16)\n",
|
| 813 |
+
"lora_unet_double_blocks_14_img_attn_qkv.lora_down.weight : \n",
|
| 814 |
+
"tensor(1.4033, dtype=torch.float16)\n",
|
| 815 |
+
"lora_unet_double_blocks_14_img_mlp_0.lora_down.weight : \n",
|
| 816 |
+
"tensor(1.5547, dtype=torch.float16)\n",
|
| 817 |
+
"lora_unet_double_blocks_14_img_mod_lin.lora_down.weight : \n",
|
| 818 |
+
"tensor(2.8906, dtype=torch.float16)\n",
|
| 819 |
+
"lora_unet_double_blocks_14_txt_attn_proj.lora_down.weight : \n",
|
| 820 |
+
"tensor(1.1328, dtype=torch.float16)\n",
|
| 821 |
+
"lora_unet_double_blocks_14_txt_attn_qkv.lora_down.weight : \n",
|
| 822 |
+
"tensor(1.3701, dtype=torch.float16)\n",
|
| 823 |
+
"lora_unet_double_blocks_14_txt_mlp_0.lora_down.weight : \n",
|
| 824 |
+
"tensor(3.3145, dtype=torch.float16)\n",
|
| 825 |
+
"lora_unet_double_blocks_14_txt_mod_lin.lora_down.weight : \n",
|
| 826 |
+
"tensor(1.2031, dtype=torch.float16)\n",
|
| 827 |
+
"lora_unet_double_blocks_15_img_attn_proj.lora_down.weight : \n",
|
| 828 |
+
"tensor(1.5137, dtype=torch.float16)\n",
|
| 829 |
+
"lora_unet_double_blocks_15_img_attn_qkv.lora_down.weight : \n",
|
| 830 |
+
"tensor(1.3809, dtype=torch.float16)\n",
|
| 831 |
+
"lora_unet_double_blocks_15_img_mlp_0.lora_down.weight : \n",
|
| 832 |
+
"tensor(1.4834, dtype=torch.float16)\n",
|
| 833 |
+
"lora_unet_double_blocks_15_img_mod_lin.lora_down.weight : \n",
|
| 834 |
+
"tensor(1.6465, dtype=torch.float16)\n",
|
| 835 |
+
"lora_unet_double_blocks_15_txt_attn_proj.lora_down.weight : \n",
|
| 836 |
+
"tensor(1.7256, dtype=torch.float16)\n",
|
| 837 |
+
"lora_unet_double_blocks_15_txt_attn_qkv.lora_down.weight : \n",
|
| 838 |
+
"tensor(2.8672, dtype=torch.float16)\n",
|
| 839 |
+
"lora_unet_double_blocks_15_txt_mlp_0.lora_down.weight : \n",
|
| 840 |
+
"tensor(2.1953, dtype=torch.float16)\n",
|
| 841 |
+
"lora_unet_double_blocks_15_txt_mod_lin.lora_down.weight : \n",
|
| 842 |
+
"tensor(0.9858, dtype=torch.float16)\n",
|
| 843 |
+
"lora_unet_double_blocks_16_img_attn_proj.lora_down.weight : \n",
|
| 844 |
+
"tensor(1.5703, dtype=torch.float16)\n",
|
| 845 |
+
"lora_unet_double_blocks_16_img_attn_qkv.lora_down.weight : \n",
|
| 846 |
+
"tensor(1.4648, dtype=torch.float16)\n",
|
| 847 |
+
"lora_unet_double_blocks_16_img_mlp_0.lora_down.weight : \n",
|
| 848 |
+
"tensor(1.5537, dtype=torch.float16)\n",
|
| 849 |
+
"lora_unet_double_blocks_16_img_mod_lin.lora_down.weight : \n",
|
| 850 |
+
"tensor(2.6133, dtype=torch.float16)\n",
|
| 851 |
+
"lora_unet_double_blocks_16_txt_attn_proj.lora_down.weight : \n",
|
| 852 |
+
"tensor(2.2559, dtype=torch.float16)\n",
|
| 853 |
+
"lora_unet_double_blocks_16_txt_attn_qkv.lora_down.weight : \n",
|
| 854 |
+
"tensor(1.9365, dtype=torch.float16)\n",
|
| 855 |
+
"lora_unet_double_blocks_16_txt_mlp_0.lora_down.weight : \n",
|
| 856 |
+
"tensor(2.7891, dtype=torch.float16)\n",
|
| 857 |
+
"lora_unet_double_blocks_16_txt_mod_lin.lora_down.weight : \n",
|
| 858 |
+
"tensor(1.3174, dtype=torch.float16)\n",
|
| 859 |
+
"lora_unet_double_blocks_17_img_attn_proj.lora_down.weight : \n",
|
| 860 |
+
"tensor(2.4609, dtype=torch.float16)\n",
|
| 861 |
+
"lora_unet_double_blocks_17_img_attn_qkv.lora_down.weight : \n",
|
| 862 |
+
"tensor(1.6240, dtype=torch.float16)\n",
|
| 863 |
+
"lora_unet_double_blocks_17_img_mlp_0.lora_down.weight : \n",
|
| 864 |
+
"tensor(3.1406, dtype=torch.float16)\n",
|
| 865 |
+
"lora_unet_double_blocks_17_img_mod_lin.lora_down.weight : \n",
|
| 866 |
+
"tensor(2.1055, dtype=torch.float16)\n",
|
| 867 |
+
"lora_unet_double_blocks_17_txt_attn_proj.lora_down.weight : \n",
|
| 868 |
+
"tensor(1.7480, dtype=torch.float16)\n",
|
| 869 |
+
"lora_unet_double_blocks_17_txt_attn_qkv.lora_down.weight : \n",
|
| 870 |
+
"tensor(1.6436, dtype=torch.float16)\n",
|
| 871 |
+
"lora_unet_double_blocks_17_txt_mlp_0.lora_down.weight : \n",
|
| 872 |
+
"tensor(1.9688, dtype=torch.float16)\n",
|
| 873 |
+
"lora_unet_double_blocks_17_txt_mod_lin.lora_down.weight : \n",
|
| 874 |
+
"tensor(1.8184, dtype=torch.float16)\n",
|
| 875 |
+
"lora_unet_double_blocks_18_img_attn_proj.lora_down.weight : \n",
|
| 876 |
+
"tensor(2.3887, dtype=torch.float16)\n",
|
| 877 |
+
"lora_unet_double_blocks_18_img_attn_qkv.lora_down.weight : \n",
|
| 878 |
+
"tensor(1.6738, dtype=torch.float16)\n",
|
| 879 |
+
"lora_unet_double_blocks_18_img_mlp_0.lora_down.weight : \n",
|
| 880 |
+
"tensor(3.7500, dtype=torch.float16)\n",
|
| 881 |
+
"lora_unet_double_blocks_18_img_mod_lin.lora_down.weight : \n",
|
| 882 |
+
"tensor(2.7285, dtype=torch.float16)\n",
|
| 883 |
+
"lora_unet_double_blocks_18_txt_attn_proj.lora_down.weight : \n",
|
| 884 |
+
"tensor(2.0410, dtype=torch.float16)\n",
|
| 885 |
+
"lora_unet_double_blocks_18_txt_attn_qkv.lora_down.weight : \n",
|
| 886 |
+
"tensor(2.0586, dtype=torch.float16)\n",
|
| 887 |
+
"lora_unet_double_blocks_18_txt_mlp_0.lora_down.weight : \n",
|
| 888 |
+
"tensor(2.0801, dtype=torch.float16)\n",
|
| 889 |
+
"lora_unet_double_blocks_18_txt_mod_lin.lora_down.weight : \n",
|
| 890 |
+
"tensor(1.5684, dtype=torch.float16)\n",
|
| 891 |
+
"lora_unet_double_blocks_1_img_attn_proj.lora_down.weight : \n",
|
| 892 |
+
"tensor(4.9844, dtype=torch.float16)\n",
|
| 893 |
+
"lora_unet_double_blocks_1_img_attn_qkv.lora_down.weight : \n",
|
| 894 |
+
"tensor(1.8613, dtype=torch.float16)\n",
|
| 895 |
+
"lora_unet_double_blocks_1_img_mlp_0.lora_down.weight : \n",
|
| 896 |
+
"tensor(2.2266, dtype=torch.float16)\n",
|
| 897 |
+
"lora_unet_double_blocks_1_img_mod_lin.lora_down.weight : \n",
|
| 898 |
+
"tensor(2.8164, dtype=torch.float16)\n",
|
| 899 |
+
"lora_unet_double_blocks_1_txt_attn_proj.lora_down.weight : \n",
|
| 900 |
+
"tensor(1.7500, dtype=torch.float16)\n",
|
| 901 |
+
"lora_unet_double_blocks_1_txt_attn_qkv.lora_down.weight : \n",
|
| 902 |
+
"tensor(2.3105, dtype=torch.float16)\n",
|
| 903 |
+
"lora_unet_double_blocks_1_txt_mlp_0.lora_down.weight : \n",
|
| 904 |
+
"tensor(1.9639, dtype=torch.float16)\n",
|
| 905 |
+
"lora_unet_double_blocks_1_txt_mod_lin.lora_down.weight : \n",
|
| 906 |
+
"tensor(2.6504, dtype=torch.float16)\n",
|
| 907 |
+
"lora_unet_double_blocks_2_img_attn_proj.lora_down.weight : \n",
|
| 908 |
+
"tensor(4.6367, dtype=torch.float16)\n",
|
| 909 |
+
"lora_unet_double_blocks_2_img_attn_qkv.lora_down.weight : \n",
|
| 910 |
+
"tensor(1.7988, dtype=torch.float16)\n",
|
| 911 |
+
"lora_unet_double_blocks_2_img_mlp_0.lora_down.weight : \n",
|
| 912 |
+
"tensor(4.6758, dtype=torch.float16)\n",
|
| 913 |
+
"lora_unet_double_blocks_2_img_mod_lin.lora_down.weight : \n",
|
| 914 |
+
"tensor(3.1445, dtype=torch.float16)\n",
|
| 915 |
+
"lora_unet_double_blocks_2_txt_attn_proj.lora_down.weight : \n",
|
| 916 |
+
"tensor(2.2285, dtype=torch.float16)\n",
|
| 917 |
+
"lora_unet_double_blocks_2_txt_attn_qkv.lora_down.weight : \n",
|
| 918 |
+
"tensor(1.4990, dtype=torch.float16)\n",
|
| 919 |
+
"lora_unet_double_blocks_2_txt_mlp_0.lora_down.weight : \n",
|
| 920 |
+
"tensor(2.3984, dtype=torch.float16)\n",
|
| 921 |
+
"lora_unet_double_blocks_2_txt_mod_lin.lora_down.weight : \n",
|
| 922 |
+
"tensor(1.4443, dtype=torch.float16)\n",
|
| 923 |
+
"lora_unet_double_blocks_3_img_attn_proj.lora_down.weight : \n",
|
| 924 |
+
"tensor(3.6855, dtype=torch.float16)\n",
|
| 925 |
+
"lora_unet_double_blocks_3_img_attn_qkv.lora_down.weight : \n",
|
| 926 |
+
"tensor(1.9971, dtype=torch.float16)\n",
|
| 927 |
+
"lora_unet_double_blocks_3_img_mlp_0.lora_down.weight : \n",
|
| 928 |
+
"tensor(3.3301, dtype=torch.float16)\n",
|
| 929 |
+
"lora_unet_double_blocks_3_img_mod_lin.lora_down.weight : \n",
|
| 930 |
+
"tensor(2.3379, dtype=torch.float16)\n",
|
| 931 |
+
"lora_unet_double_blocks_3_txt_attn_proj.lora_down.weight : \n",
|
| 932 |
+
"tensor(2.0117, dtype=torch.float16)\n",
|
| 933 |
+
"lora_unet_double_blocks_3_txt_attn_qkv.lora_down.weight : \n",
|
| 934 |
+
"tensor(2.1621, dtype=torch.float16)\n",
|
| 935 |
+
"lora_unet_double_blocks_3_txt_mlp_0.lora_down.weight : \n",
|
| 936 |
+
"tensor(2.7676, dtype=torch.float16)\n",
|
| 937 |
+
"lora_unet_double_blocks_3_txt_mod_lin.lora_down.weight : \n",
|
| 938 |
+
"tensor(3.1895, dtype=torch.float16)\n",
|
| 939 |
+
"lora_unet_double_blocks_4_img_attn_proj.lora_down.weight : \n",
|
| 940 |
+
"tensor(2.3848, dtype=torch.float16)\n",
|
| 941 |
+
"lora_unet_double_blocks_4_img_attn_qkv.lora_down.weight : \n",
|
| 942 |
+
"tensor(1.7783, dtype=torch.float16)\n",
|
| 943 |
+
"lora_unet_double_blocks_4_img_mlp_0.lora_down.weight : \n",
|
| 944 |
+
"tensor(2.0234, dtype=torch.float16)\n",
|
| 945 |
+
"lora_unet_double_blocks_4_img_mod_lin.lora_down.weight : \n",
|
| 946 |
+
"tensor(1.9082, dtype=torch.float16)\n",
|
| 947 |
+
"lora_unet_double_blocks_4_txt_attn_proj.lora_down.weight : \n",
|
| 948 |
+
"tensor(1.7588, dtype=torch.float16)\n",
|
| 949 |
+
"lora_unet_double_blocks_4_txt_attn_qkv.lora_down.weight : \n",
|
| 950 |
+
"tensor(2.9902, dtype=torch.float16)\n",
|
| 951 |
+
"lora_unet_double_blocks_4_txt_mlp_0.lora_down.weight : \n",
|
| 952 |
+
"tensor(1.5859, dtype=torch.float16)\n",
|
| 953 |
+
"lora_unet_double_blocks_4_txt_mod_lin.lora_down.weight : \n",
|
| 954 |
+
"tensor(1.5654, dtype=torch.float16)\n",
|
| 955 |
+
"lora_unet_double_blocks_5_img_attn_proj.lora_down.weight : \n",
|
| 956 |
+
"tensor(2.7402, dtype=torch.float16)\n",
|
| 957 |
+
"lora_unet_double_blocks_5_img_attn_qkv.lora_down.weight : \n",
|
| 958 |
+
"tensor(1.6221, dtype=torch.float16)\n",
|
| 959 |
+
"lora_unet_double_blocks_5_img_mlp_0.lora_down.weight : \n",
|
| 960 |
+
"tensor(1.6318, dtype=torch.float16)\n",
|
| 961 |
+
"lora_unet_double_blocks_5_img_mod_lin.lora_down.weight : \n",
|
| 962 |
+
"tensor(1.7988, dtype=torch.float16)\n",
|
| 963 |
+
"lora_unet_double_blocks_5_txt_attn_proj.lora_down.weight : \n",
|
| 964 |
+
"tensor(1.1699, dtype=torch.float16)\n",
|
| 965 |
+
"lora_unet_double_blocks_5_txt_attn_qkv.lora_down.weight : \n",
|
| 966 |
+
"tensor(3.5566, dtype=torch.float16)\n",
|
| 967 |
+
"lora_unet_double_blocks_5_txt_mlp_0.lora_down.weight : \n",
|
| 968 |
+
"tensor(1.5791, dtype=torch.float16)\n",
|
| 969 |
+
"lora_unet_double_blocks_5_txt_mod_lin.lora_down.weight : \n",
|
| 970 |
+
"tensor(1.5547, dtype=torch.float16)\n",
|
| 971 |
+
"lora_unet_double_blocks_6_img_attn_proj.lora_down.weight : \n",
|
| 972 |
+
"tensor(1.7988, dtype=torch.float16)\n",
|
| 973 |
+
"lora_unet_double_blocks_6_img_attn_qkv.lora_down.weight : \n",
|
| 974 |
+
"tensor(1.4531, dtype=torch.float16)\n",
|
| 975 |
+
"lora_unet_double_blocks_6_img_mlp_0.lora_down.weight : \n",
|
| 976 |
+
"tensor(2.4141, dtype=torch.float16)\n",
|
| 977 |
+
"lora_unet_double_blocks_6_img_mod_lin.lora_down.weight : \n",
|
| 978 |
+
"tensor(6.0234, dtype=torch.float16)\n",
|
| 979 |
+
"lora_unet_double_blocks_6_txt_attn_proj.lora_down.weight : \n",
|
| 980 |
+
"tensor(1.0068, dtype=torch.float16)\n",
|
| 981 |
+
"lora_unet_double_blocks_6_txt_attn_qkv.lora_down.weight : \n",
|
| 982 |
+
"tensor(2.0098, dtype=torch.float16)\n",
|
| 983 |
+
"lora_unet_double_blocks_6_txt_mlp_0.lora_down.weight : \n",
|
| 984 |
+
"tensor(4.0312, dtype=torch.float16)\n",
|
| 985 |
+
"lora_unet_double_blocks_6_txt_mod_lin.lora_down.weight : \n",
|
| 986 |
+
"tensor(2.6309, dtype=torch.float16)\n",
|
| 987 |
+
"lora_unet_double_blocks_7_img_attn_proj.lora_down.weight : \n",
|
| 988 |
+
"tensor(1.4814, dtype=torch.float16)\n",
|
| 989 |
+
"lora_unet_double_blocks_7_img_attn_qkv.lora_down.weight : \n",
|
| 990 |
+
"tensor(1.4854, dtype=torch.float16)\n",
|
| 991 |
+
"lora_unet_double_blocks_7_img_mlp_0.lora_down.weight : \n",
|
| 992 |
+
"tensor(1.3877, dtype=torch.float16)\n",
|
| 993 |
+
"lora_unet_double_blocks_7_img_mod_lin.lora_down.weight : \n",
|
| 994 |
+
"tensor(2.3125, dtype=torch.float16)\n",
|
| 995 |
+
"lora_unet_double_blocks_7_txt_attn_proj.lora_down.weight : \n",
|
| 996 |
+
"tensor(3.4746, dtype=torch.float16)\n",
|
| 997 |
+
"lora_unet_double_blocks_7_txt_attn_qkv.lora_down.weight : \n",
|
| 998 |
+
"tensor(2.0430, dtype=torch.float16)\n",
|
| 999 |
+
"lora_unet_double_blocks_7_txt_mlp_0.lora_down.weight : \n",
|
| 1000 |
+
"tensor(1.8018, dtype=torch.float16)\n",
|
| 1001 |
+
"lora_unet_double_blocks_7_txt_mod_lin.lora_down.weight : \n",
|
| 1002 |
+
"tensor(1.1709, dtype=torch.float16)\n",
|
| 1003 |
+
"lora_unet_double_blocks_8_img_attn_proj.lora_down.weight : \n",
|
| 1004 |
+
"tensor(1.8857, dtype=torch.float16)\n",
|
| 1005 |
+
"lora_unet_double_blocks_8_img_attn_qkv.lora_down.weight : \n",
|
| 1006 |
+
"tensor(1.8848, dtype=torch.float16)\n",
|
| 1007 |
+
"lora_unet_double_blocks_8_img_mlp_0.lora_down.weight : \n",
|
| 1008 |
+
"tensor(1.7627, dtype=torch.float16)\n",
|
| 1009 |
+
"lora_unet_double_blocks_8_img_mod_lin.lora_down.weight : \n",
|
| 1010 |
+
"tensor(4.2852, dtype=torch.float16)\n",
|
| 1011 |
+
"lora_unet_double_blocks_8_txt_attn_proj.lora_down.weight : \n",
|
| 1012 |
+
"tensor(1.3887, dtype=torch.float16)\n",
|
| 1013 |
+
"lora_unet_double_blocks_8_txt_attn_qkv.lora_down.weight : \n",
|
| 1014 |
+
"tensor(1.6289, dtype=torch.float16)\n",
|
| 1015 |
+
"lora_unet_double_blocks_8_txt_mlp_0.lora_down.weight : \n",
|
| 1016 |
+
"tensor(2.2188, dtype=torch.float16)\n",
|
| 1017 |
+
"lora_unet_double_blocks_8_txt_mod_lin.lora_down.weight : \n",
|
| 1018 |
+
"tensor(1.5742, dtype=torch.float16)\n",
|
| 1019 |
+
"lora_unet_double_blocks_9_img_attn_proj.lora_down.weight : \n",
|
| 1020 |
+
"tensor(2.3125, dtype=torch.float16)\n",
|
| 1021 |
+
"lora_unet_double_blocks_9_img_attn_qkv.lora_down.weight : \n",
|
| 1022 |
+
"tensor(1.4854, dtype=torch.float16)\n",
|
| 1023 |
+
"lora_unet_double_blocks_9_img_mlp_0.lora_down.weight : \n",
|
| 1024 |
+
"tensor(1.9492, dtype=torch.float16)\n",
|
| 1025 |
+
"lora_unet_double_blocks_9_img_mod_lin.lora_down.weight : \n",
|
| 1026 |
+
"tensor(2.2949, dtype=torch.float16)\n",
|
| 1027 |
+
"lora_unet_double_blocks_9_txt_attn_proj.lora_down.weight : \n",
|
| 1028 |
+
"tensor(2.0781, dtype=torch.float16)\n",
|
| 1029 |
+
"lora_unet_double_blocks_9_txt_attn_qkv.lora_down.weight : \n",
|
| 1030 |
+
"tensor(2.6172, dtype=torch.float16)\n",
|
| 1031 |
+
"lora_unet_double_blocks_9_txt_mlp_0.lora_down.weight : \n",
|
| 1032 |
+
"tensor(3.1367, dtype=torch.float16)\n",
|
| 1033 |
+
"lora_unet_double_blocks_9_txt_mod_lin.lora_down.weight : \n",
|
| 1034 |
+
"tensor(1.2451, dtype=torch.float16)\n",
|
| 1035 |
+
"lora_unet_single_blocks_0_linear1.lora_down.weight : \n",
|
| 1036 |
+
"tensor(2.4375, dtype=torch.float16)\n",
|
| 1037 |
+
"lora_unet_single_blocks_0_modulation_lin.lora_down.weight : \n",
|
| 1038 |
+
"tensor(3.5684, dtype=torch.float16)\n",
|
| 1039 |
+
"lora_unet_single_blocks_10_linear1.lora_down.weight : \n",
|
| 1040 |
+
"tensor(2.6328, dtype=torch.float16)\n",
|
| 1041 |
+
"lora_unet_single_blocks_10_modulation_lin.lora_down.weight : \n",
|
| 1042 |
+
"tensor(2.9961, dtype=torch.float16)\n",
|
| 1043 |
+
"lora_unet_single_blocks_11_linear1.lora_down.weight : \n",
|
| 1044 |
+
"tensor(3.1211, dtype=torch.float16)\n",
|
| 1045 |
+
"lora_unet_single_blocks_11_modulation_lin.lora_down.weight : \n",
|
| 1046 |
+
"tensor(3.3672, dtype=torch.float16)\n",
|
| 1047 |
+
"lora_unet_single_blocks_12_linear1.lora_down.weight : \n",
|
| 1048 |
+
"tensor(3.0293, dtype=torch.float16)\n",
|
| 1049 |
+
"lora_unet_single_blocks_12_modulation_lin.lora_down.weight : \n",
|
| 1050 |
+
"tensor(3.6602, dtype=torch.float16)\n",
|
| 1051 |
+
"lora_unet_single_blocks_13_linear1.lora_down.weight : \n",
|
| 1052 |
+
"tensor(2.5918, dtype=torch.float16)\n",
|
| 1053 |
+
"lora_unet_single_blocks_13_modulation_lin.lora_down.weight : \n",
|
| 1054 |
+
"tensor(4.6367, dtype=torch.float16)\n",
|
| 1055 |
+
"lora_unet_single_blocks_14_linear1.lora_down.weight : \n",
|
| 1056 |
+
"tensor(2.0215, dtype=torch.float16)\n",
|
| 1057 |
+
"lora_unet_single_blocks_14_modulation_lin.lora_down.weight : \n",
|
| 1058 |
+
"tensor(3.5371, dtype=torch.float16)\n",
|
| 1059 |
+
"lora_unet_single_blocks_15_linear1.lora_down.weight : \n",
|
| 1060 |
+
"tensor(2.1719, dtype=torch.float16)\n",
|
| 1061 |
+
"lora_unet_single_blocks_15_modulation_lin.lora_down.weight : \n",
|
| 1062 |
+
"tensor(4.2812, dtype=torch.float16)\n",
|
| 1063 |
+
"lora_unet_single_blocks_16_linear1.lora_down.weight : \n",
|
| 1064 |
+
"tensor(2.1992, dtype=torch.float16)\n",
|
| 1065 |
+
"lora_unet_single_blocks_16_modulation_lin.lora_down.weight : \n",
|
| 1066 |
+
"tensor(4.1094, dtype=torch.float16)\n",
|
| 1067 |
+
"lora_unet_single_blocks_17_linear1.lora_down.weight : \n",
|
| 1068 |
+
"tensor(2.0703, dtype=torch.float16)\n",
|
| 1069 |
+
"lora_unet_single_blocks_17_modulation_lin.lora_down.weight : \n",
|
| 1070 |
+
"tensor(2.9277, dtype=torch.float16)\n",
|
| 1071 |
+
"lora_unet_single_blocks_18_linear1.lora_down.weight : \n",
|
| 1072 |
+
"tensor(2.0371, dtype=torch.float16)\n",
|
| 1073 |
+
"lora_unet_single_blocks_18_modulation_lin.lora_down.weight : \n",
|
| 1074 |
+
"tensor(2.6133, dtype=torch.float16)\n",
|
| 1075 |
+
"lora_unet_single_blocks_19_linear1.lora_down.weight : \n",
|
| 1076 |
+
"tensor(2.0723, dtype=torch.float16)\n",
|
| 1077 |
+
"lora_unet_single_blocks_19_modulation_lin.lora_down.weight : \n",
|
| 1078 |
+
"tensor(3.4980, dtype=torch.float16)\n",
|
| 1079 |
+
"lora_unet_single_blocks_1_linear1.lora_down.weight : \n",
|
| 1080 |
+
"tensor(1.7432, dtype=torch.float16)\n",
|
| 1081 |
+
"lora_unet_single_blocks_1_modulation_lin.lora_down.weight : \n",
|
| 1082 |
+
"tensor(2.3848, dtype=torch.float16)\n",
|
| 1083 |
+
"lora_unet_single_blocks_20_linear1.lora_down.weight : \n",
|
| 1084 |
+
"tensor(2.0137, dtype=torch.float16)\n",
|
| 1085 |
+
"lora_unet_single_blocks_20_modulation_lin.lora_down.weight : \n",
|
| 1086 |
+
"tensor(2.8203, dtype=torch.float16)\n",
|
| 1087 |
+
"lora_unet_single_blocks_21_linear1.lora_down.weight : \n",
|
| 1088 |
+
"tensor(1.8955, dtype=torch.float16)\n",
|
| 1089 |
+
"lora_unet_single_blocks_21_modulation_lin.lora_down.weight : \n",
|
| 1090 |
+
"tensor(2.7305, dtype=torch.float16)\n",
|
| 1091 |
+
"lora_unet_single_blocks_22_linear1.lora_down.weight : \n",
|
| 1092 |
+
"tensor(2.7559, dtype=torch.float16)\n",
|
| 1093 |
+
"lora_unet_single_blocks_22_modulation_lin.lora_down.weight : \n",
|
| 1094 |
+
"tensor(4.6133, dtype=torch.float16)\n",
|
| 1095 |
+
"lora_unet_single_blocks_23_linear1.lora_down.weight : \n",
|
| 1096 |
+
"tensor(2.5508, dtype=torch.float16)\n",
|
| 1097 |
+
"lora_unet_single_blocks_23_modulation_lin.lora_down.weight : \n",
|
| 1098 |
+
"tensor(4.4180, dtype=torch.float16)\n",
|
| 1099 |
+
"lora_unet_single_blocks_24_linear1.lora_down.weight : \n",
|
| 1100 |
+
"tensor(1.9219, dtype=torch.float16)\n",
|
| 1101 |
+
"lora_unet_single_blocks_24_modulation_lin.lora_down.weight : \n",
|
| 1102 |
+
"tensor(2.9453, dtype=torch.float16)\n",
|
| 1103 |
+
"lora_unet_single_blocks_25_linear1.lora_down.weight : \n",
|
| 1104 |
+
"tensor(2.7539, dtype=torch.float16)\n",
|
| 1105 |
+
"lora_unet_single_blocks_25_modulation_lin.lora_down.weight : \n",
|
| 1106 |
+
"tensor(4.5938, dtype=torch.float16)\n",
|
| 1107 |
+
"lora_unet_single_blocks_26_linear1.lora_down.weight : \n",
|
| 1108 |
+
"tensor(3.3750, dtype=torch.float16)\n",
|
| 1109 |
+
"lora_unet_single_blocks_26_modulation_lin.lora_down.weight : \n",
|
| 1110 |
+
"tensor(4.7344, dtype=torch.float16)\n",
|
| 1111 |
+
"lora_unet_single_blocks_27_linear1.lora_down.weight : \n",
|
| 1112 |
+
"tensor(2.3809, dtype=torch.float16)\n",
|
| 1113 |
+
"lora_unet_single_blocks_27_modulation_lin.lora_down.weight : \n",
|
| 1114 |
+
"tensor(4.9883, dtype=torch.float16)\n",
|
| 1115 |
+
"lora_unet_single_blocks_28_linear1.lora_down.weight : \n",
|
| 1116 |
+
"tensor(3.0859, dtype=torch.float16)\n",
|
| 1117 |
+
"lora_unet_single_blocks_28_modulation_lin.lora_down.weight : \n",
|
| 1118 |
+
"tensor(5.7539, dtype=torch.float16)\n",
|
| 1119 |
+
"lora_unet_single_blocks_29_linear1.lora_down.weight : \n",
|
| 1120 |
+
"tensor(2.3242, dtype=torch.float16)\n",
|
| 1121 |
+
"lora_unet_single_blocks_29_modulation_lin.lora_down.weight : \n",
|
| 1122 |
+
"tensor(3.9160, dtype=torch.float16)\n",
|
| 1123 |
+
"lora_unet_single_blocks_2_linear1.lora_down.weight : \n",
|
| 1124 |
+
"tensor(2.1406, dtype=torch.float16)\n",
|
| 1125 |
+
"lora_unet_single_blocks_2_modulation_lin.lora_down.weight : \n",
|
| 1126 |
+
"tensor(2.1621, dtype=torch.float16)\n",
|
| 1127 |
+
"lora_unet_single_blocks_30_linear1.lora_down.weight : \n",
|
| 1128 |
+
"tensor(2.1211, dtype=torch.float16)\n",
|
| 1129 |
+
"lora_unet_single_blocks_30_modulation_lin.lora_down.weight : \n",
|
| 1130 |
+
"tensor(4.8516, dtype=torch.float16)\n",
|
| 1131 |
+
"lora_unet_single_blocks_31_linear1.lora_down.weight : \n",
|
| 1132 |
+
"tensor(2.2773, dtype=torch.float16)\n",
|
| 1133 |
+
"lora_unet_single_blocks_31_modulation_lin.lora_down.weight : \n",
|
| 1134 |
+
"tensor(4.1367, dtype=torch.float16)\n",
|
| 1135 |
+
"lora_unet_single_blocks_32_linear1.lora_down.weight : \n",
|
| 1136 |
+
"tensor(2.5273, dtype=torch.float16)\n",
|
| 1137 |
+
"lora_unet_single_blocks_32_modulation_lin.lora_down.weight : \n",
|
| 1138 |
+
"tensor(5.0508, dtype=torch.float16)\n",
|
| 1139 |
+
"lora_unet_single_blocks_33_linear1.lora_down.weight : \n",
|
| 1140 |
+
"tensor(2.7051, dtype=torch.float16)\n",
|
| 1141 |
+
"lora_unet_single_blocks_33_modulation_lin.lora_down.weight : \n",
|
| 1142 |
+
"tensor(5.2930, dtype=torch.float16)\n",
|
| 1143 |
+
"lora_unet_single_blocks_34_linear1.lora_down.weight : \n",
|
| 1144 |
+
"tensor(2.6738, dtype=torch.float16)\n",
|
| 1145 |
+
"lora_unet_single_blocks_34_modulation_lin.lora_down.weight : \n",
|
| 1146 |
+
"tensor(4.7852, dtype=torch.float16)\n",
|
| 1147 |
+
"lora_unet_single_blocks_35_linear1.lora_down.weight : \n",
|
| 1148 |
+
"tensor(2.5117, dtype=torch.float16)\n",
|
| 1149 |
+
"lora_unet_single_blocks_35_modulation_lin.lora_down.weight : \n",
|
| 1150 |
+
"tensor(6.7734, dtype=torch.float16)\n",
|
| 1151 |
+
"lora_unet_single_blocks_36_linear1.lora_down.weight : \n",
|
| 1152 |
+
"tensor(1.8418, dtype=torch.float16)\n",
|
| 1153 |
+
"lora_unet_single_blocks_36_modulation_lin.lora_down.weight : \n",
|
| 1154 |
+
"tensor(6.5859, dtype=torch.float16)\n",
|
| 1155 |
+
"lora_unet_single_blocks_37_linear1.lora_down.weight : \n",
|
| 1156 |
+
"tensor(2.4473, dtype=torch.float16)\n",
|
| 1157 |
+
"lora_unet_single_blocks_37_modulation_lin.lora_down.weight : \n",
|
| 1158 |
+
"tensor(2.5742, dtype=torch.float16)\n",
|
| 1159 |
+
"lora_unet_single_blocks_3_linear1.lora_down.weight : \n",
|
| 1160 |
+
"tensor(2.5566, dtype=torch.float16)\n",
|
| 1161 |
+
"lora_unet_single_blocks_3_modulation_lin.lora_down.weight : \n",
|
| 1162 |
+
"tensor(4.7148, dtype=torch.float16)\n",
|
| 1163 |
+
"lora_unet_single_blocks_4_linear1.lora_down.weight : \n",
|
| 1164 |
+
"tensor(2.2832, dtype=torch.float16)\n",
|
| 1165 |
+
"lora_unet_single_blocks_4_modulation_lin.lora_down.weight : \n",
|
| 1166 |
+
"tensor(2.0566, dtype=torch.float16)\n",
|
| 1167 |
+
"lora_unet_single_blocks_5_linear1.lora_down.weight : \n",
|
| 1168 |
+
"tensor(2.2109, dtype=torch.float16)\n",
|
| 1169 |
+
"lora_unet_single_blocks_5_modulation_lin.lora_down.weight : \n",
|
| 1170 |
+
"tensor(2.7793, dtype=torch.float16)\n",
|
| 1171 |
+
"lora_unet_single_blocks_6_linear1.lora_down.weight : \n",
|
| 1172 |
+
"tensor(3.0176, dtype=torch.float16)\n",
|
| 1173 |
+
"lora_unet_single_blocks_6_modulation_lin.lora_down.weight : \n",
|
| 1174 |
+
"tensor(2.9180, dtype=torch.float16)\n",
|
| 1175 |
+
"lora_unet_single_blocks_7_linear1.lora_down.weight : \n",
|
| 1176 |
+
"tensor(2.2461, dtype=torch.float16)\n",
|
| 1177 |
+
"lora_unet_single_blocks_7_modulation_lin.lora_down.weight : \n",
|
| 1178 |
+
"tensor(2.1074, dtype=torch.float16)\n",
|
| 1179 |
+
"lora_unet_single_blocks_8_linear1.lora_down.weight : \n",
|
| 1180 |
+
"tensor(3.0391, dtype=torch.float16)\n",
|
| 1181 |
+
"lora_unet_single_blocks_8_modulation_lin.lora_down.weight : \n",
|
| 1182 |
+
"tensor(2.0039, dtype=torch.float16)\n",
|
| 1183 |
+
"lora_unet_single_blocks_9_linear1.lora_down.weight : \n",
|
| 1184 |
+
"tensor(3.8789, dtype=torch.float16)\n",
|
| 1185 |
+
"lora_unet_single_blocks_9_modulation_lin.lora_down.weight : \n",
|
| 1186 |
+
"tensor(4.0547, dtype=torch.float16)\n"
|
| 1187 |
+
]
|
| 1188 |
+
}
|
| 1189 |
+
]
|
| 1190 |
+
},
|
| 1191 |
+
{
|
| 1192 |
+
"cell_type": "markdown",
|
| 1193 |
+
"source": [
|
| 1194 |
+
"<---- Upload your civiai trained .safetensor file to Google Colab before running the next cell\n",
|
| 1195 |
+
"\n"
|
| 1196 |
+
],
|
| 1197 |
+
"metadata": {
|
| 1198 |
+
"id": "oDAUwfFzqzgj"
|
| 1199 |
+
}
|
| 1200 |
+
},
|
| 1201 |
+
{
|
| 1202 |
+
"cell_type": "code",
|
| 1203 |
+
"execution_count": null,
|
| 1204 |
+
"metadata": {
|
| 1205 |
+
"id": "WQZ3BZn1p-pw"
|
| 1206 |
+
},
|
| 1207 |
+
"outputs": [],
|
| 1208 |
+
"source": [
|
| 1209 |
+
"civiai_lora = '' # @param {type:'string' ,placeholder:'ex. civitai_trained_e19.safetensors'}\n",
|
| 1210 |
+
"tensor_art_filename = '' # @param {type:'string' ,placeholder:'ex. e19.safetensors'}\n",
|
| 1211 |
+
"%cd /content/\n",
|
| 1212 |
+
"tgt = load_file(f'{civiai_lora}')\n",
|
| 1213 |
+
"for key in tgt:\n",
|
| 1214 |
+
" tgt[f'{key}'] = tgt[f'{key}'].to(dtype=torch.float16)\n",
|
| 1215 |
+
"%cd /content/\n",
|
| 1216 |
+
"save_file(tgt , f'{tensor_art_filename}')"
|
| 1217 |
+
]
|
| 1218 |
+
},
|
| 1219 |
+
{
|
| 1220 |
+
"cell_type": "markdown",
|
| 1221 |
+
"source": [
|
| 1222 |
+
"Download the new .safetensor file to your device.\n",
|
| 1223 |
+
"\n",
|
| 1224 |
+
"Downloading from CoLab Notebook will seemingly do nothing for ~5min. Then the file will download , so be patient.\n",
|
| 1225 |
+
"\n",
|
| 1226 |
+
"For faster/more consistent downloads , download your .safetensor file from your Google Drive"
|
| 1227 |
+
],
|
| 1228 |
+
"metadata": {
|
| 1229 |
+
"id": "blnBW-U4rAS7"
|
| 1230 |
+
}
|
| 1231 |
+
}
|
| 1232 |
+
]
|
| 1233 |
+
}
|