File size: 121,119 Bytes
2fdce3c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 |
[ èªè
ã«ãªã ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://blog.hatena.ne.jp/hoshikat/hoshikat.hatenablog.com/subscribe?utm_medium%3Dbutton%26utm_source%3Dblogs_topright_button%26utm_campaign%3Dsubscribe_blog)
# [人工ç¥èœãšèŠªãããªãããã°](https://hoshikat-hatenablog-
com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
## 人工ç¥èœã«é¢ãããããã¯ãåãäžããããã°ã§ã
[ 2023-05-26 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/05/26?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
# [誰ã§ããããStable Diffusion Kohya_ssã䜿ã£ãLoRAåŠç¿èšå®ã培åºè§£èª¬](https://hoshikat-
hatenablog-
com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
ååã®èšäºã§ã¯ãStable Diffusionã¢ãã«ãè¿œå åŠç¿ããããã®WebUIç°å¢ãkohya_ssãã®å°å
¥æ³ã«ã€ããŠè§£èª¬ããŸããã
ä»åã¯ãLoRAã®ããã¿ã倧ãŸãã«èª¬æãããã®åŸã«kohya_ssã䜿ã£ãLoRAåŠç¿èšå®ã«ã€ããŠè§£èª¬ããŠãããŸãã
â»ä»åã®èšäºã¯éåžžã«é·ãã§ãïŒ
**ãã®èšäºã§ã¯ãåèšå®ã®æå³ãã®ã¿è§£èª¬ããŠããŸãã**
ãåŠç¿ç»åã®çšæã®ãããããšããç»åã«ã©ããã£ãã·ã§ã³ãã€ãããããšããã©ãåŠç¿ãå®è¡ããããã¯è§£èª¬ããŠããŸãããåŠç¿ã®å®è¡æ³ã«ã€ããŠã¯ãŸãå¥ã®èšäºã§è§£èª¬ããããšæããŸãã
* [LoRAã®ä»çµã¿ãç¥ãã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRAã®ä»çµã¿ãç¥ãã)
* [ãã¢ãã«ããšã¯](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#ã¢ãã«ãšã¯)
* [LoRAã¯å°ãããã¥ãŒã©ã«ããããè¿œå ãã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRAã¯å°ãããã¥ãŒã©ã«ããããè¿œå ãã)
* [å°ãããã¥ãŒã©ã«ãããã®æ§é ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#å°ãããã¥ãŒã©ã«ãããã®æ§é )
* [LoRAåŠç¿å¯Ÿè±¡1ïŒU-Net](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRAåŠç¿å¯Ÿè±¡1U-Net)
* [RoLAåŠç¿å¯Ÿè±¡2ïŒããã¹ããšã³ã³ãŒããŒ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#RoLAåŠç¿å¯Ÿè±¡2ããã¹ããšã³ã³ãŒããŒ)
* [kohya_ssãç«ã¡äžããŠã¿ãã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#kohya_ssãç«ã¡äžããŠã¿ãã)
* [LoRAåŠç¿ã®åèšå®](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRAåŠç¿ã®åèšå®)
* [LoRAèšå®ã®ã»ãŒããããŒã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRAèšå®ã®ã»ãŒãããŒã)
* [Source modelã¿ãïŒ åŠç¿ã«äœ¿ãããŒã¹ã¢ãã«ã®èšå®](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Source-modelã¿ãåŠç¿ã«äœ¿ãããŒã¹ã¢ãã«ã®èšå®)
* [Pretrained model name or path](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Pretrained-model-name-or-path)
* [Model Quick Pick](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Model-Quick-Pick)
* [Save trained model as](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-trained-model-as)
* [v2](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#v2)
* [v_parameterization](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#v_parameterization)
* [Foldersã¿ãïŒ åŠç¿ç»åã®å ŽæãšLoRAåºåå
ã®èšå®](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Foldersã¿ãåŠç¿ç»åã®å ŽæãšLoRAåºåå
ã®èšå®)
* [Image folder](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Image-folder)
* [Output folder](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Output-folder)
* [Regularisation folder](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Regularisation-folder)
* [Logging folder](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Logging-folder)
* [Model output name](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Model-output-name)
* [Training comment](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Training-comment)
* [Training parametersã¿ãïŒ åŠç¿ã®è©³çŽ°èšå®](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Training-parametersã¿ãåŠç¿ã®è©³çŽ°èšå®)
* [LoRA type](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRA-type)
* [LoRA network weights](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LoRA-network-weights)
* [DIM from weights](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#DIM-from-weights)
* [Train batch size](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Train-batch-size)
* [Epoch](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Epoch)
* [Save every N epochs](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-every-N-epochs)
* [Caption Extension](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Caption-Extension)
* [Mixed precision](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Mixed-precision)
* [Save precision](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-precision)
* [Number of CPU threads per core](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Number-of-CPU-threads-per-core)
* [Seed](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Seed)
* [Cache latents](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Cache-latents)
* [Cache latents to disk](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Cache-latents-to-disk)
* [Learning rate:](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Learning-rate)
* [LR Scheduler:](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LR-Scheduler)
* [LR warmup](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LR-warmup)
* [Optimizer](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Optimizer)
* [Optimizer extra arguments](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Optimizer-extra-arguments)
* [Text Encoder learning rate](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Text-Encoder-learning-rate)
* [Unet learning rate](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Unet-learning-rate)
* [Network Rank(Dimension)](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Network-RankDimension)
* [Network alpha:](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Network-alpha)
* [Max resolution](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Max-resolution)
* [Stop text encoder training](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Stop-text-encoder-training)
* [Enable buckets](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Enable-buckets)
* [Advanced Configuration](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Advanced-Configuration)
* [WeightsãBlocksãConv](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#WeightsBlocksConv)
* [Weights: Down LR weights/Mid LR weights/Up LR weights](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Weights-Down-LR-weightsMid-LR-weightsUp-LR-weights)
* [Weights: Blocks LR zero threshold](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Weights-Blocks-LR-zero-threshold)
* [Blocks: Block dims, Block alphas](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Blocks-Block-dims-Block-alphas)
* [Conv: Conv dims, Conv, alphas](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Conv-Conv-dims-Conv-alphas)
* [No token padding](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#No-token-padding)
* [Gradient accumulation steps](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Gradient-accumulation-steps)
* [Weighted captions](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Weighted-captions)
* [Prior loss weight](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Prior-loss-weight)
* [LR number of cycles](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LR-number-of-cycles)
* [LR power](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#LR-power)
* [Additional parameters](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Additional-parameters)
* [Save every N steps](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-every-N-steps)
* [Save last N steps](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-last-N-steps)
* [Keep n tokens](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Keep-n-tokens)
* [Clip skip](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Clip-skip)
* [Max Token Length](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Max-Token-Length)
* [Full fp16 training (experimental)](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Full-fp16-training-experimental)
* [Gradient checkpointing](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Gradient-checkpointing)
* [Shuffle caption](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Shuffle-caption)
* [Persistent data loader](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Persistent-data-loader)
* [Memory efficient attention](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Memory-efficient-attention)
* [Use xformers](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Use-xformers)
* [Color augmentation](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Color-augmentation)
* [Flip augmentation](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Flip-augmentation)
* [Min SNR gamma](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Min-SNR-gamma)
* [Don't upscale bucket resolution](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Dont-upscale-bucket-resolution)
* [Bucket resolution steps](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Bucket-resolution-steps)
* [Random crop instead of center crop](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Random-crop-instead-of-center-crop)
* [Noise offset type](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Noise-offset-type)
* [Noise offset](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Noise-offset)
* [Adaptive noise scale](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Adaptive-noise-scale)
* [Multires noise iterations](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Multires-noise-iterations)
* [Multires noise discount](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Multires-noise-discount)
* [Dropout caption every n epochs](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Dropout-caption-every-n-epochs)
* [Rate of caption dropout](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Rate-of-caption-dropout)
* [VAE batch size](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#VAE-batch-size)
* [Save training state](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Save-training-state)
* [Resume from saved training state](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Resume-from-saved-training-state)
* [Max train epoch](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Max-train-epoch)
* [Max num workers for DataLoader](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Max-num-workers-for-DataLoader)
* [WANDB API Key](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#WANDB-API-Key)
* [WANDB Logging](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#WANDB-Logging)
* [Sample images config](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Sample-images-config)
* [Sample every n steps](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Sample-every-n-steps)
* [Sample every n epochs](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Sample-every-n-epochs)
* [Sample sampler](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Sample-sampler)
* [Sample prompts](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#Sample-prompts)
* [ãŸãšã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#ãŸãšã)
### LoRAã®ä»çµã¿ãç¥ãã
kohya_ssã®åèšå®ã®æå³ãç¥ãã«ã¯ãLoRAãã©ãããã¡[ã«ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AB%25A5%25CB)ãºã ã§è¿œå åŠç¿ãããã®ãç¥ã£ãŠããå¿
èŠããããŸãã
è¿œå åŠç¿ã®å¯Ÿè±¡ã§ãããã¢ãã«ããšã¯äœãªã®ããåãããŠèª¬æããŸãã
#### ãã¢ãã«ããšã¯
Stable Diffusionã¯ã **ã¢ãã«** ããšåŒã°ããã¢ãžã¥ãŒã«ãèªã¿èŸŒãã§äœ¿ããŸããã¢ãã«ãšã¯ããã°ãè³ã¿ããã§ããã®æ£äœã¯ã
**[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãŠã§ã€ãæ
å ±**ãã§ãã
[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã¯ããããã®ã
**[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)**
ãããã§ããŠããŠã[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ã®ãŸãšãŸããäœå±€ãã®ã
**ã¬ã€ã€ãŒ**
ãã圢äœã£ãŠããŸããããã¬ã€ã€ãŒã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ã¯éãã¬ã€ã€ãŒã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ãšç·ã§ã€ãªãã£ãŠããŠããã®ã€ãªããã®åŒ·ããè¡šãã®ãã
**ãŠã§ã€ã** ãã§ããèšå€§ãªçµµã®æ
å ±ãä¿æããŠããã®ã¯ããã®ããŠã§ã€ãããªã®ã§ãã
####
LoRAã¯å°ãã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ãã
LoRAã¯ãè¿œå åŠç¿ãã®äžçš®ã§ãããè¿œå åŠç¿ãšã¯[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãããŒãžã§ã³ã¢ããããããšã§ãã
ãã®æ¹æ³ã¯ãããããããŸããããŸãæãã€ãã®ã¯äžã®å³ã®ããã«ã¢ãã«å
šéšãåŠç¿ããªããæ¹æ³ã§ãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230512/20230512000033.png)
è¿œå åŠç¿ã§ã¢ãã«ãéããªãã
ãDreamBoothããšããè¿œå åŠç¿æ³ããã®æ¹æ³ã䜿ã£ãŠããŸãã
ãã®æ¹æ³ã ãšãããè¿œå åŠç¿ããŒã¿ãå
¬éãããå Žåãè¿œå åŠç¿ã§æ°ãããªã£ãã¢ãã«ãäžžããšé
åžããå¿
èŠããããŸãã
ã¢ãã«ã®ãµã€ãºã¯éåžž2Gïœ5Gãã€ããããé
åžã¯ãªããªã倧å€ã§ãã
ããã«å¯ŸããŠãLoRAåŠç¿ã§ã¯ã¢ãã«ã«ã¯æãä»ãããæ°ãããå°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ããåŠç¿ãããäœçœ®ããšã«äœããŸããè¿œå åŠç¿ã¯ããã®å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã察象ã«ããŠè¡ãããŸãã
LoRAãé
åžããããšãã¯ãã®å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã ããé
åžããã°ããã®ã§ãããŒã¿ãµã€ãºãå°ãªãæžã¿ãŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230512/20230512005959.png)
RoLAåŠç¿ã¯å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)察象
#### å°ãã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®æ§é
LoRAã®å°ãã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã¯ïŒã€ã®å±€ããã§ããŠããŸããå·Šã®ãå
¥åå±€ããå³ã®ãåºåå±€ãã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ã®æ°ã¯ãã¿ãŒã²ããã®[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãå
¥åå±€ããåºåå±€ãã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)æ°ãšåãã§ããçãäžã®å±€(äžéå±€)ã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)æ°ã¯ãã©ã³ã¯æ°ã(ãŸãã¯æ¬¡å
æ°)ãšåŒã°ãããã®æ°ã¯åŠç¿ãããšãã«èªç±ã«æ±ºããããšãã§ããŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230512/20230512011058.png)
å°ããª[ãã¥ãŒã©ã«ãããã¯ãŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8%25A5%25EF%25A1%25BC%25A5%25AF)ã®æ§é
ã§ã¯ããã®å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã¯ã©ãã«è¿œå ãããã®ã§ãããïŒ
#### LoRAåŠç¿å¯Ÿè±¡1ïŒU-Net
äžã®å³ã¯Stable
Diffusionã®å¿èéšã§ãããU-Netããšããã¡[ã«ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AB%25A5%25CB)ãºã ã§ãã
U-Netã¯ãDownã(å·Šåå)ãMidãïŒäžçªäžïŒãUpãïŒå³ååïŒã«åããããŸãã
ãããŠãDown12ãããã¯ãMid1ãããã¯ãUp12ãããã¯ã®åèš25ãããã¯ããã§ããŠããŸãã
ããã®äžã®èµ€ãç¢å°ã®éšå(ãªã¬ã³ãžè²ã®ãããã¯)ãLoRAåŠç¿å¯Ÿè±¡ã§ããã€ãŸãããã®èµ€ãç¢å°ã®ãããã¯ã«å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ãããŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230512/20230512011350.png)
èµ€ãç¢å°ã®ãããã¯ãLoRAåŠç¿å¯Ÿè±¡ã®ãAttentionãããã¯ã
ãªã¬ã³ãžè²ã®ãããã¯ã§ã¯ãããã¹ãåŠçããã€ãŸãããã³ãããšããŠäžããããããã¹ããç»åã«åæ ãããåŠçãè¡ã£ãŠããŸãã
ãã®ãããã¯ãããã«çŽ°ããèŠããšã以äžã®ãããªåŠçãè¡ã£ãŠããŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230512/20230512011718.png)
èµ€ãç¢å°ã®éšåã«ããããå°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããã
ããã«ãèµ€ãç¢å°ãããã€ãã€ããŠããŸããããã®èµ€ãç¢å°ã®åŠçå
šéšã«ããããå¥ã®[ãã¥ãŒã©ã«ãããã¯ãŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8%25A5%25EF%25A1%25BC%25A5%25AF)ãè¿œå ãããŸãã
ããã«è¿œå ããã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ããšãKohya_ssã§ã¯åçŽã«ãUNetããšåŒãã§ããŸãã
####
RoLAåŠç¿å¯Ÿè±¡2ïŒããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)
LoRAã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããã®ã¯ããã ãã§ã¯ãããŸããã
äžã®å³ã®ãCross
Attentionããšãããããã¯ã¯ããããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ããšããã¢ãžã¥ãŒã«ããããã¹ãæ
å ±ãåãåããŸãããã®ãããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ãã¯ãããã¹ãããŒã¿ã§ããããã³ãããæ°åã®å(ãã¯ãã«)ã«å€æãããšãã圹å²ããããŸãã
ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã¯1ã€ãããªããU-Netå
ã®ãã¹ãŠã®Attentionãããã¯ã§å
±éã§äœ¿ãããŸãããã®ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã¯æ¬æ¥Stable
Diffusionå
ã§ã¯ãå®æåããšããŠæ±ãããã¢ãã«åŠç¿ã®å¯Ÿè±¡ã«ã¯ãªããŸããããLoRAã«ããè¿œå åŠç¿ã§ã¯ãããåŠç¿å¯Ÿè±¡ã§ãã
LoRAã§ã¢ããããŒãããããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã¯ãã¹ãŠã®Attentionãããã¯ã§äœ¿ãããã®ã§ãããã«è¿œå ããã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã¯å®æç»åã«ãšãŠã倧ããªåœ±é¿ãåãŒããŸãã
ããã«è¿œå ããã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®äºãKohya_ssã§ã¯ãText
EncoderããšåŒãã§ããŸãã
### kohya_ssãç«ã¡äžããŠã¿ãã
LoRAåŠç¿ã®ããã¿ãèŠãã®ã§ãããããkohya_ssã䜿ã£ãŠã¿ãŸãããã
kohya_ssãã©ã«ãå
ã«ããã[gui](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/gui).batããããã«ã¯ãªãã¯ãããšã[ã³ãã³ãããã³ãã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25B3%25A5%25DE%25A5%25F3%25A5%25C9%25A5%25D7%25A5%25ED%25A5%25F3%25A5%25D7%25A5%25C8)(é»èæ¯ã®æåã ãã®ãŠã£ã³ããŠ)ãç«ã¡äžãããŸãããã°ãããããšããã«URLã衚瀺ãããã®ã§ãããããŠã§ããã©ãŠã¶ã®URLæ¬ã«å
¥åããŠãªã¿ãŒã³ãæŒããškohya_ssã®ç»é¢ããã©ãŠã¶äžã«è¡šç€ºãããŸãã
kohya_ssãç«ã¡äžãããšãUIã®äžéšã«ã¿ããããã€ãçŸããŸãããã®äžã®ãDreambooth
LoRAããéžã³ãŸãããããããLoRAåŠç¿ã®ããã®ã¿ãã§ãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518004131.png)
å·Šãã2çªç®ã®ã¿ããLoRAåŠç¿èšå®
### LoRAåŠç¿ã®åèšå®
ãDreambooth LoRAãã¿ããéžã¶ãšãããããã®èšå®ãåºãŠããŸããããããããã§è§£èª¬ããŸãã
#### LoRAèšå®ã®ã»ãŒããããŒã
äžçªäžã«ããã®ã¯ãã³ã³ãã£ã°ãã¡ã€ã«ãã§ããããã§LoRAèšå®ãã³ã³ãã£ã°ãã¡ã€ã«ãšããŠã»ãŒããããŒãããããšãã§ããŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518004415.png)
èšå®ã¯ã³ã³ãã£ã°ãã¡ã€ã«ãšããŠã»ãŒããããŒãã§ãã
èšå®ãã³ã³ãã£ã°ãã¡ã€ã«ã«ä¿åããŠããã°åŸã§ãã®ã³ã³ãã£ã°ãã¡ã€ã«ãããŒãããŠèšå®ã埩å
ã§ããã®ã§ããæ°ã«å
¥ãã®èšå®ã¯ãªãã¹ãä¿åããŠãããŸãããã
次ã«ã4ã€ã®ã¿ãããããŸããæåã®3ã€ã«ã€ããŠãããã詳ããèŠãŠãããŸãã
(ãToolsãã¿ãã¯LoRAåŠç¿æã«ã¯äœ¿ããªãã®ã§èª¬æã¯çç¥ããŸãã)
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518004914.png)
ã¢ãã«éžæãåŠç¿ç»åãã©ã«ãã詳现èšå®ãããŒã«ã®åã¿ã
#### Source modelã¿ãïŒ åŠç¿ã«äœ¿ãããŒã¹ã¢ãã«ã®èšå®
##### Pretrained model name or path
ããã«ããŒã¹ã¢ãã«ã®å Žæãæå®ããŸããæåã«èª¬æããéããLoRAã¯æ¢åã®ã¢ãã«ã«å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããŸããã€ãŸããLoRAåŠç¿ãšã¯ãããŒã¹ã¢ãã«ïŒÎ±ãã®ãïŒÎ±ãã®éšåãäœãäœæ¥ã§ãã
LoRAåŠç¿ã¯ããŒã¹ã¢ãã«ã®ç¹åŸŽã«å€§ããªåœ±é¿ãåããã®ã§ã
* åŠç¿ããç»åãšçžæ§ã®ããããŒã¹ã¢ãã«
* ç»åçææã«äœ¿ã(ãšæ³å®ããã)ã¢ãã«ãšçžæ§ã®ããããŒã¹ã¢ãã«
ãéžã¶å¿
èŠããããŸããäŸãã°åŠç¿ç»åãå®åã®ãããªç»åãªããå®åçæãåŸæãªã¢ãã«ãéžã¶ãšããã§ããããåŠç¿ç»åã2次å
調ã§ãå®å調ã®ç»åçæãæ³å®ããŠãããªãã2次å
調ãš3次å
調ã®æ··åã¢ãã«ãéžã¶ã¹ããããããŸããã
ãªããåŠç¿åŸã«ã§ããLoRAãã¡ã€ã«ã¯ãè¿œå ããã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãã®ããŒã¿ã®ã¿ã§ãããŒã¹ã¢ãã«ã®ããŒã¿ã¯å
¥ã£ãŠããŸããããã®ãããå®æããLoRAãã¡ã€ã«ã䜿ã£ãŠç»åãçæãããšãã¯ãããã§æå®ããããŒã¹ã¢ãã«ã ãã§ãªããã©ããªã¢ãã«ãšãäžç·ã«äœ¿ãããšãã§ããŸãã
##### Model Quick Pick
ããã§ã¢ãã«ãéžã¶ãšãåŠç¿å®è¡æã«ãã®ã¢ãã«ãèªåçã«ãããçµç±ã§ããŠã³ããŒããããããŒã¹ã¢ãã«ãšããŠäœ¿çšãããŸããPretrained model
name or pathã®æå®ã¯ç¡èŠãããŸãã
ããã¢ãã«ãPCã«ä¿åãããŠããªãå Žåããã©ã®ã¢ãã«ã䜿ã£ãŠããã®ãåãããªãå Žåã¯ãããã§éžæã§ããã¢ãã«ãéžãã§äœ¿ããŸãããã
ãrunwayml/stable-diffusion-v1-5ãã䜿ãããããšãå€ãããã§ãã
èªåã§çšæããã¢ãã«ã䜿ãããå Žåã¯customã«ããŸãããã
##### Save trained model as
åŠç¿æžã¿ã®LoRAãã¡ã€ã«ãã©ã®ãã¡ã€ã«åœ¢åŒã§ä¿åããããæå®ã§ããŸãã
ckptã¯ãã€ãŠStable
Diffusionã§äœ¿ãããŠããäž»æµã®åœ¢åŒã§ãããããã®åœ¢åŒã«ã¯ã»ãã¥ãªãã£äžåé¡ããã£ããããsafetensorsãšããããå®å
šãªãã¡ã€ã«åœ¢åŒãçãŸããŸãããçŸåšã§ã¯safetensorsãäž»æµãšãªã£ãŠããŸãã
ç¹å¥ãªçç±ããªãéãsafetensorsãéžã³ãŸãããã
##### v2
Stable
Diffusionã®ã¢ãã«ã¯ãããŒãžã§ã³1ç³»ããšãããŒãžã§ã³2ç³»ãã®2ã€ã®ããŒãžã§ã³ãããããããã¯ããŒã¿æ§é ãããããéããŸããããŒãžã§ã³2ç³»ã¯(2023幎5ææç¹ã§)ãŸã æ®åããŠããããã»ãšãã©ã®æåã¢ãã«ã¯ãããŒãžã§ã³1ç³»ãã§ãã
ãããããããŒãžã§ã³2ç³»ãã®ã¢ãã«ãããŒã¹ã¢ãã«ãšããŠäœ¿ãå Žåã¯ãã®ãªãã·ã§ã³ããªã³ã«ããŸãããã
ããã©ã«ãã¯ãªãã§ãã
##### v_parameterization
v-parameterizationãšã¯ãããŒãžã§ã³2ç³»ãã¢ãã«ã§å°å
¥ãããææ³ã§ãåŸæ¥ãããå°ãªããµã³ããªã³ã°ã¹ãããã§å®å®ããŠç»åãçæããããã®ããªãã¯ã§ãã
ãããŒãžã§ã³1ç³»ãã®ã¢ãã«ã䜿çšãããšãã¯ãã®ãªãã·ã§ã³ã¯ãªãã§æ§ããŸããããã䜿ãã®ããŒã¹ã¢ãã«ãv-
parameterizationãå°å
¥ããŠããããšãåãã£ãŠããå Žåã¯ããããªã³ã«ããŠãã ãããããããªã³ã«ãããšãã¯å¿
ãv2ããªã³ã«ããŸãããã
ããã©ã«ãã¯ãªãã§ãã
#### Foldersã¿ãïŒ åŠç¿ç»åã®å ŽæãšLoRAåºåå
ã®èšå®
##### Image folder
åŠç¿ç»åãå«ããã©ã«ã(ã10_catãã®ãããªååã®ãã©ã«ã)ãããå Žæãæå®ããŸãã
ãç»åãããå Žæãã§ã¯ãããŸããïŒãç»åãå«ããã©ã«ããããå Žæããæå®ããŸãããã
##### Output folder
å®æåŸã®LoRAãã¡ã€ã«ã®åºåå
ãæå®ããŸããåŠç¿ã®éäžçµéã®LoRAãåºåããå Žå(åŸè¿°)ããããã§æå®ããåºåå
ã«åºåãããŸãã
##### Regularisation folder
LoRAåŠç¿ã§ã¯ãåŠç¿ç»åã®ç¹åŸŽãæå³ããªãåèªã«åŒ·ãçµã³ã€ããããŠããŸãããã®åèªãå
¥ãããã³ã«åŠç¿ç»åã«äŒŒãç»åããçæããªããªãããšããããšããã°ãã°èµ·ãããŸãã
ããã§ã[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åããšãããåŠç¿ç»åã£ãœããªããç»åãäžç·ã«åŠç¿ãããããšã§ãç¹å®ã®åèªã«åŠç¿å¯Ÿè±¡ã匷ãçµã³ã€ããŠããŸãã®ãé²ãããšãã§ããŸãã
[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åã®äœ¿çšã¯å¿
é ã§ã¯ãããŸãããããã[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åãåŠç¿ã«äœ¿ãå Žåã¯ãããã§[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åãå«ãã ãã©ã«ãã®å Žæãæå®ããŸãã
##### Logging folder
åŠç¿æã®åŠçããã°ãšããŠåºåããŠä¿åãããå Žåããã®å Žæãæå®ããŸãã
ããã§æå®ããååã®ãã©ã«ããäœæ¥ãã©ã«ãå
ã«äœæãããããã«ãã®äžã«åŠç¿æ¥æãè¡šãååã®ãã©ã«ããã§ããŸãããã°ã¯ããã«ä¿åãããŸãã
ãªãããã°ãã¡ã€ã«ã¯ãtensorboardããšããããŒã«ãŸãã¯ãWandBããšãããªã³ã©ã€ã³ãµãŒãã¹(åŸè¿°)ã§ã°ã©ãåã§ããŸãã
##### Model output name
å®æããLoRAãã¡ã€ã«ã®ååãããã§æå®ããŸããæ¡åŒµåãã€ããå¿
èŠã¯ãããŸããã
ããã_ver1.0ã(ããã¯åŠç¿å¯Ÿè±¡ã®åå)ã®ããã«ããŒãžã§ã³çªå·ä»ãã®ååã«ãããšåãããããã§ãããã
ãªããååã«ã¯æ¥æ¬èªã䜿ããªãããã«ããŸãããã
##### Training comment
å®æããLoRAãã¡ã€ã«ã«ã¯ã[ã¡ã¿ããŒã¿](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25E1%25A5%25BF%25A5%25C7%25A1%25BC%25A5%25BF)ããšããŠããã¹ããåã蟌ãããšãã§ããŸããããåã蟌ã¿ããããã¹ããããå Žåã¯ããã«èšè¿°ããŸãã
ãªãã[ã¡ã¿ããŒã¿](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25E1%25A5%25BF%25A5%25C7%25A1%25BC%25A5%25BF)ã¯Stable
Diffusion WebUIã®LoRAéžæç»é¢ã§âããŒã¯ãã¯ãªãã¯ãããšèŠãããšãã§ããŸãã
#### Training parametersã¿ãïŒ åŠç¿ã®è©³çŽ°èšå®
ãã®ã¿ãã§ã¯LoRAåŠç¿ã®ããã®ã»ãŒãã¹ãŠã®ãã©ã¡ãŒã¿ãèšå®ããŸãã
##### LoRA type
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518010422.png)
LoRAåŠç¿ã®ã¿ã€ããæå®ããŸããäžã§è§£èª¬ããLoRAã¯ãã¹ã¿ã³ããŒããã¿ã€ãã§ãããDyLoRAãã¯æå®ããRank以äžã®è€æ°ã®ã©ã³ã¯ãåæã«åŠç¿ããã®ã§ãæé©ãªã©ã³ã¯ãéžã³ãããšãã«äŸ¿å©ã§ããLoHaã¯é«å¹çãªLoRAãLoConã¯åŠç¿ãU-
Netã®Resãããã¯ãŸã§åºãããã®ã§ãã
æåã¯Standardã¿ã€ãã§åé¡ãããŸãããåŠç¿ãããŸããããªããšãã¯ã»ãã®ã¿ã€ããéžãã§ã¿ãŸãããã
##### LoRA network weights
æ¢ã«åŠç¿æžã¿ã®LoRAãã¡ã€ã«ã䜿ã£ãŠããã«è¿œå åŠç¿ãããããšãã¯ãããã§LoRAãã¡ã€ã«ãæå®ããŸãã
ããã§æå®ããLoRAã¯åŠç¿éå§æã«èªã¿èŸŒãŸãããã®LoRAã®ç¶æ
ããåŠç¿ãã¹ã¿ãŒãããŸããåŠç¿åŸã®LoRAã¯ãŸãå¥ã®ãã¡ã€ã«ãšããŠä¿åãããã®ã§ãããã§æå®ããLoRAãã¡ã€ã«ãäžæžããããããšã¯ãããŸããã
##### DIM from weights
ããã¯LoRA network weightsã§è¿œå åŠç¿ãè¡ããšãéå®ã®ãªãã·ã§ã³ã§ãã
äžã®å³ã«ããéããLoRAã¯å°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããŸããããã®äžéå±€ã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)æ°(ã©ã³ã¯æ°)ã¯Network
Rank(åŸè¿°)ã§èªç±ã«èšå®ããããšãã§ããŸãã
ãããããã®ãªãã·ã§ã³ããªã³ã«ãããšãäœæããLoRAã®ã©ã³ã¯æ°ãLoRA network
weightsã§æå®ããLoRAãšåãã©ã³ã¯æ°ã«èšå®ãããŸããããããªã³ã«ãããšãã¯Network Rankã®æå®ã¯ç¡èŠãããŸãã
äŸãã°è¿œå åŠç¿ã«äœ¿ãLoRAã®ã©ã³ã¯æ°ã32ã®æãäœæããLoRAã®ã©ã³ã¯æ°ã32ã«èšå®ãããŸãã
ããã©ã«ãã¯ãªãã§ãã
##### Train batch size
ããããµã€ãºãæå®ããŸããããããšã¯ããã£ãºãã«èªã¿èŸŒãç»åã®ææ°ãã§ããããããµã€ãº2ãªããäžåºŠã«2æã®ç»åãåæã«åŠç¿ããŸããéãçµµãè€æ°åæã«åŠç¿ãããšåã
ã®çµµã«å¯Ÿãããã¥ãŒãã³ã°ç²ŸåºŠã¯èœã¡ãŸãããè€æ°ã®çµµã®ç¹åŸŽãå
æ¬çã«ãšãããåŠç¿ã«ãªãã®ã§ãæçµçãªä»äžããã¯ããã£ãŠè¯ããªãå¯èœæ§ããããŸãã
(ç¹å®ã®çµµã«ãã¥ãŒãã³ã°ãããããšå¿çšã®å©ããªãLoRAã«ãªã£ãŠããŸããŸãã)
è€æ°ã®çµµãäžåºŠã«åŠç¿ããã®ã§ããããµã€ãºãäžããã°äžããã»ã©åŠç¿æéãçããªããŸããããã¥ãŒãã³ã°ç²ŸåºŠãäžãããããŠã§ã€ãå€æŽæ°ãæžãã®ã§ãå Žåã«ãã£ãŠã¯åŠç¿äžè¶³ã«ãªãå¯èœæ§ããããŸãã
(ããããµã€ãºãäžãããšãã¯åŠç¿ç(Learning
rateãåŸè¿°ããŸã)ãäžããæ¹ããããšããå ±åããããŸããäŸãã°ããããµã€ãº2ãªãåŠç¿çã2åã«ããããšãã£ãæãã§ãã)
ãŸããããããµã€ãºãäžããã»ã©ã¡ã¢ãªãå€ãæ¶è²»ããŸããã䜿ãã®PCã®VRAMã®ãµã€ãºã«åãããŠæ±ºããŸãããã
VRAMã6GBããã°ããããµã€ãº2ããããããŠå¯èœã§ãããã
ããã©ã«ãã¯1ã§ãã
â»ãããããšã«åæã«èªã¿èŸŒãç»åã¯ãã¹ãŠåããµã€ãºã§ãªããã°ãªããªãã®ã§ãåŠç¿ç»åã®ãµã€ãºããã©ãã©ã ãšãããã§æå®ãããããæ°ãããå°ãªãææ°ããåæåŠçããªãããšãããŸãã
##### Epoch
1ãšããã¯ã¯ã1ã»ããã®åŠç¿ãã§ãã
äŸãã°50æã®ç»åããããã10åãã€èªã¿èŸŒãã§åŠç¿ããããšããŸãããã®å Žåã1ãšããã¯ã¯50x10ïŒ500åã®åŠç¿ã§ãã2ãšããã¯ãªãããã2åç¹°ãè¿ãã®ã§ã500x2ïŒ1000åã®åŠç¿ã«ãªããŸãã
æå®ããããšããã¯æ°ã®åŠç¿ãçµãã£ãåŸã«ãLoRAãã¡ã€ã«ãäœæãããæå®ã®å Žæã«ä¿åãããŸãã
LoRAã®å Žåã2ïœ3ãšããã¯ã®åŠç¿ã§ãååå¹æãåŸãããŸãã
##### Save every N epochs
ããã§æå®ãããšããã¯æ°ããšã«ãéäžçµéãLoRAãã¡ã€ã«ãšããŠä¿åããããšãã§ããŸãã
äŸãã°ãEpochãã§10ãšæå®ãããSave every N
epochsãã2ã«æå®ãããšã2ãšããã¯ããš(2ã4ã6ã8ãšããã¯çµäºæ)ã«æå®ãã©ã«ãã«LoRAãã¡ã€ã«ãä¿åãããŸãã
éäžçµéã®LoRAäœæãäžèŠã®å Žåã¯ãããã®æ°å€ããEpochããšåãæ°å€ã«ããŸãããã
##### Caption Extension
ããç»åããšã«ãã£ãã·ã§ã³ãã¡ã€ã«ãçšæããŠããå Žåããã®ãã£ãã·ã§ã³ãã¡ã€ã«ã®æ¡åŒµåãããã§æå®ããŸãã
ããã空æ¬ã®å Žåãæ¡åŒµåã¯ã.captionãã«ãªããŸãããããã£ãã·ã§ã³ãã¡ã€ã«ã®æ¡åŒµåãã.txtãã®æã¯ãããã«ã.txtããšæå®ããŠãããŸãããã
ãã£ãã·ã§ã³ãã¡ã€ã«ããªãå Žåã¯ãç¡èŠããŠããŸããŸããã
##### Mixed precision
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518015736.png)
åŠç¿æã®ãŠã§ã€ãããŒã¿ã®æ··å粟床ã®ã¿ã€ããæå®ããŸãã
æ¬æ¥ãŠã§ã€ãããŒã¿ã¯32ãããåäœ(noéžæã®å Žå)ã§ãããå¿
èŠã«å¿ããŠ16ãããåäœã®ããŒã¿ãæ··ããŠåŠç¿ãããšããªãã®ã¡ã¢ãªç¯çŽãã¹ããŒãã¢ããã«ã€ãªãããŸããfp16ã¯ç²ŸåºŠãååã«ãã[ããŒã¿åœ¢åŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C7%25A1%25BC%25A5%25BF%25B7%25C1%25BC%25B0)ãbf16ã¯32ãããããŒã¿ãšåãæ°å€ã®å¹
ãåãæ±ãããã工倫ãã[ããŒã¿åœ¢åŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C7%25A1%25BC%25A5%25BF%25B7%25C1%25BC%25B0)ã§ãã
fp16ã§åå粟床ã®é«ãLoRAãåŸãããŸãã
##### Save precision
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230518/20230518021841.png)
LoRAãã¡ã€ã«ã«ä¿åãããŠã§ã€ãããŒã¿ã®ã¿ã€ããæå®ããŸãã
floatã¯32ããããfp16ãšbf16ã¯16ãããåäœã§ããäžã®äºã€ã®æ¹ããã¡ã€ã«ãµã€ãºãå°ãããªããŸãã
ããã©ã«ãã¯fp16ã§ãã
##### Number of CPU threads per core
åŠç¿æã®CPUã³ã¢ããšã®ã¹ã¬ããã®æ°ã§ããåºæ¬çã«æ°å€ã倧ããã»ã©å¹çãäžãããŸãããã¹ããã¯ã«å¿ããŠèšå®ã調ç¯ããå¿
èŠããããŸãã
ããã©ã«ãã¯2ã§ãã
##### Seed
åŠç¿æã«ã¯ãã©ãããé çªã§ç»åãèªã¿èŸŒãããããåŠç¿ç»åã«ãã€ãºãã©ããããä¹ããã(詳现ã¯çç¥)ããªã©ãã©ã³ãã ãªåŠçãããã€ããããŸãã
Seedã¯ãã®ã©ã³ãã åŠçã®æé ã決ããããã®IDã®ãããªãã®ã§ãåãSeedãæå®ããã°æ¯ååãã©ã³ãã æé ã䜿ãããã®ã§åŠç¿çµæãåçŸãããããªããŸãã
ãã ããã®Seedã䜿ããªãã©ã³ãã åŠç(äŸãã°ç»åãã©ã³ãã ã«åãæãåŠçãªã©)ãããã®ã§ãåãSeedãæå®ããŠãå¿
ãåãåŠç¿çµæãåŸããããšã¯éããŸããã
ããã©ã«ãã¯ç©ºæ¬ã§ããæå®ããªããã°åŠç¿å®è¡æã«Seedãé©åœã«èšå®ãããŸãã
çµæããªãã¹ãåçŸããããªãé©åœã«(1234ãšã)æ°åãèšå®ããŠãããŠæã¯ãããŸããã
##### Cache latents
åŠç¿ç»åã¯VRAMã«èªã¿èŸŒãŸããU-Netã«å
¥ãåã«Latentãšããç¶æ
ã«ãå§çž®ããããŠå°ãããªãããã®ç¶æ
ã§VRAMå
ã§åŠç¿ãããŸããéåžžãç»åã¯èªã¿èŸŒãŸãããã³ã«æ¯åãå§çž®ããããŸãããCache
latentsã«ãã§ãã¯ãå
¥ãããšããå§çž®ãæžã¿ã®ç»åãã¡ã€ã³ã¡ã¢ãªã«ä¿æããããæå®ã§ããŸãã
ã¡ã€ã³ã¡ã¢ãªã«ä¿æãããšVRAMã®ã¹ããŒã¹ç¯çŽã«ãªããã¹ããŒããäžãããŸããããå§çž®ãåã®ç»åå å·¥ãã§ããªããªãã®ã§ãflip_aug以å€ã®augmentation(åŸè¿°)ã䜿ããªããªããŸãããŸããç»åãæ¯åã©ã³ãã ãªç¯å²ã§åãæãrandom
crop(åŸè¿°)ã䜿ããªããªããŸãã
ããã©ã«ãã¯ãªã³ã§ãã
##### Cache latents to disk
Cache latentsãªãã·ã§ã³ãšäŒŒãŠããŸãããããã«ãã§ãã¯ãå
¥ãããšãå§çž®ç»åããŒã¿ãäžæãã¡ã€ã«ãšããŠãã£ã¹ã¯ã«ä¿åããããæå®ã§ããŸãã
kohya_ssãåèµ·åããåŸããã®äžæãã¡ã€ã«ãåå©çšã§ããã®ã§ãåãããŒã¿ã§äœåºŠãLoRAåŠç¿ããããå Žåã¯ãã®ãªãã·ã§ã³ããªã³ã«ãããšåŠç¿å¹çãäžãããŸãã
ãã ããããããªã³ã«ãããšflip_aug以å€ã®augmentationãšrandom cropã䜿ããªããªããŸãã
ããã©ã«ãã¯ãªãã§ãã
##### Learning rate:
åŠç¿çãæå®ããŸãããåŠç¿ããšã¯ãäžããããçµµãšãã£ãããªçµµãäœããããã«[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)å
ã®é
ç·ã®å€ªã(ãŠã§ã€ã)ãå€ããŠããããšã§ãããæ¯åçµµãäžããããããšã«ãŽããœãªé
ç·ãå€ããŠããŸããšãäžããããçµµã®ã¿ã«ãã¥ãŒãã³ã°ããããŠãä»ã®çµµããŸã£ããæããªããªã£ãŠããŸããŸãã
ãããé¿ãããããæ¯åãäžããããçµµãã¡ãã£ãšã ãåã蟌ãããã«ãã¡ãã£ãšã ããŠã§ã€ããå€ããŸãããã®ãã¡ãã£ãšã ããã®éã決ããã®ããåŠç¿çã(Learning
rate)ã§ãã
ããã©ã«ãå€ã¯0.0001ã§ãã
##### LR Scheduler:
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230519/20230519204207.png)
åŠç¿ã®éäžã§åŠç¿ç(Learning rate)ãå€ããããšãã§ããŸããã¹ã±ãžã¥ãŒã©ãŒãšã¯ãã©ããããµãã«åŠç¿çãå€ããŠãããã®èšå®ãã§ãã
* adafactorïŒ[ãªããã£ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AA%25A5%25D7%25A5%25C6%25A5%25A3%25A5%25DE)ã€ã¶ãŒ(åŸè¿°)ãAdafactorã«èšå®ããå Žåã¯ãããéžæãããVRAMç¯çŽã®ããç¶æ³ã«å¿ããŠåŠç¿çãèªå調ç¯ããªããåŠç¿
* constantïŒåŠç¿çã¯æåããæåŸãŸã§å€ãããªã
* constant_with_warmupïŒæåã¯åŠç¿ç0ããå§ããŠãŠã©ãŒã ã¢ããäžã«Learning rateèšå®å€ã«åããŠã ãã ãå¢ãããæ¬åŠç¿ã®æã¯Learning rateèšå®å€ã䜿ã
* [cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://d.hatena.ne.jp/keyword/cosine)ïŒæ³¢(ã³[ãµã€ã³ã«ãŒã](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25B5%25A5%25A4%25A5%25F3%25A5%25AB%25A1%25BC%25A5%25D6))ãæããªããåŠç¿çãã ãã ã0ã«åããŠæžãã
* [cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://d.hatena.ne.jp/keyword/cosine)_with_restartsïŒ[cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://d.hatena.ne.jp/keyword/cosine)ãäœåºŠãç¹°ãè¿ã(LR number of cyclesã®èª¬æãèŠãŠãã ãã)
* linearïŒæåã¯Learning rateèšå®å€ã§å§ãã0ã«åããŠäžçŽç·ã«æžãã
* polynomialïŒæåã¯linearãšåããæžããæ¹ãå°ãè€é(LR powerã®èª¬æãèŠãŠãã ãã)
åŠç¿çãLearning rateèšå®å€ã«åºå®ããããªãconstantã«ããŠãã ããã
ããã©ã«ãã¯[cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/cosine)ã§ãã
##### LR warmup
ã¹ã±ãžã¥ãŒã©ãŒã§constant_with_warmupãéžæããå ŽåããŠã©ãŒã ã¢ãããã©ããããã®åæ°è¡ãããããã§èšå®ããŸãã
ããã§æå®ããæ°å€ã¯å
šäœã®ã¹ãããæ°ã®ããŒã»ã³ãã§ãã
äŸãã°ã50æã®ç»åãããããµã€ãº1ã§10ååŠç¿ãããã2ãšããã¯è¡ããšããç·ã¹ãããæ°ã¯50x10x2=1000ã§ããããLR
warmupã10ã«èšå®ãããšãç·ã¹ããã1000ã®ãã¡æåã®10%ãã€ãŸã100ã¹ãããããŠã©ãŒã ã¢ããã«ãªããŸãã
ã¹ã±ãžã¥ãŒã©ãŒãconstant_with_warmupã§ãªããªãããã¯ç¡èŠããŠæ§ããŸããã
ããã©ã«ãã¯10ã§ãã
##### Optimizer
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230526/20230526012657.png)
[ãªããã£ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AA%25A5%25D7%25A5%25C6%25A5%25A3%25A5%25DE)ã€ã¶ãŒãšã¯ãåŠç¿äžã«[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãŠã§ã€ããã©ãã¢ããããŒãããããã®èšå®ã§ããè³¢ãåŠç¿ããããã«ãããããªææ³ãææ¡ãããŠããŸãããLoRAåŠç¿ã§æããã䜿ãããã®ã¯ãAdamWã(32ããã)ãŸãã¯ãAdamW8bitãã§ããAdamW8bitã¯VRAMã®äœ¿çšéãäœãã粟床ãååãªã®ã§è¿·ã£ããããã䜿ããŸãããã
ãã®ä»ãAdamææ³ãåãå
¥ãã€ã€åŠç¿ã®é²ã¿å
·åã«å¿ããŠåŠç¿çãé©åã«èª¿ç¯ãããAdafactorãããã䜿ãããããã§ã(Adafactorã䜿ãå Žåã¯Learning
rateèšå®ã¯ç¡èŠãããŸã)ã
ãDAdaptãã¯åŠç¿çã調ç¯ãã[ãªããã£ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AA%25A5%25D7%25A5%25C6%25A5%25A3%25A5%25DE)ã€ã¶ãŒããLionãã¯æ¯èŒçæ°ãã[ãªããã£ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AA%25A5%25D7%25A5%25C6%25A5%25A3%25A5%25DE)ã€ã¶ãŒã§ãããŸã ååæ€èšŒãããŠããŸããããSGDNesterovãã¯åŠç¿ç²ŸåºŠã¯è¯ããã®ã®é床ãäžãããšããå ±åããããŸãã
ããã©ã«ãã¯AdamW8bitã§ããåºæ¬çã«ãã®ãŸãŸã§åé¡ãããŸããã
##### Optimizer extra arguments
æå®ãã[ãªããã£ã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25AA%25A5%25D7%25A5%25C6%25A5%25A3%25A5%25DE)ã€ã¶ãŒã«å¯ŸããŠããã«çŽ°ããèšå®ãããå Žåã¯ãããã§ã³ãã³ããæžããŸãã
éåžžã¯ç©ºæ¬ã®ãŸãŸã§æ§ããŸããã
##### Text Encoder learning rate
ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã«å¯ŸããåŠç¿çãèšå®ããŸããæåã®ã»ãã§æžããéããããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã®è¿œå åŠç¿ã®åœ±é¿ã¯U-
Netå
šäœã«åã³ãŸãã
ãã®ãããéåžžã¯U-Netã®åãããã¯ã«å¯ŸããåŠç¿ç(Unet learning rate)ãããäœãããŠãããŸãã
ããã©ã«ãå€ã¯0.00005(5e-5)ã§ãã
ããã§æ°å€ãæå®ããå ŽåãLearning rateã®å€ããããã¡ããåªå
ãããŸãã
##### Unet learning rate
U-Netã«å¯ŸããåŠç¿çãèšå®ããŸããU-Netã®äžã«ããåAttentionãããã¯(èšå®ã«ãã£ãŠã¯ä»ã®ãããã¯ã)ã«è¿œå åŠç¿ãè¡ããšãã®åŠç¿çã§ãã
ããã©ã«ãå€ã¯0.0001ã§ãã
ããã§æ°å€ãæå®ããå ŽåãLearning rateã®å€ããããã¡ããåªå
ãããŸãã
##### Network Rank(Dimension)
èšäºã®äžã®æ¹ã§èª¬æãããè¿œå ããå°ããª[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãã®äžéå±€ã®[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ã®æ°ãæå®ããŸã(詳现ã¯äžã®å³ãèŠãŠãã ãã)ã
[ãã¥ãŒãã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25ED%25A5%25F3)ã®æ°ãå€ãã»ã©åŠç¿æ
å ±ãå€ãä¿æã§ããŸãããåŠç¿å¯Ÿè±¡ä»¥å€ã®äœèšãªæ
å ±ãŸã§åŠç¿ããŠããŸãå¯èœæ§ãé«ããªããLoRAã®ãã¡ã€ã«ãµã€ãºã倧ãããªããŸãã
äžè¬çã«æ倧128çšåºŠã§èšå®ããããšãå€ãã§ããã32ã§ååãšããå ±åããããŸãã
è©Šéšçã«LoRAãäœãå Žåã¯2ïœ8ãããããå§ããã®ããããããããŸããã
ããã©ã«ãã¯8ã§ãã
##### Network alpha:
ããã¯ãLoRAä¿åæã«ãŠã§ã€ãã0ã«äžžã蟌ãŸããŠããŸãã®ãé²ãããã®äŸ¿å®äžã®åŠçœ®ãšããŠå°å
¥ããããã®ã§ãã
LoRAã¯ãã®æ§é äžã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãŠã§ã€ãå€ãå°ãããªããã¡ã§ãå°ãããªãããããšãŒã(ã€ãŸããªã«ãåŠç¿ããŠããªãã®ãšåã)ãšèŠåããã€ããªããªã£ãŠããŸãæãããããŸããããã§ãå®éã®(ä¿åããã)ãŠã§ã€ãå€ã¯å€§ããä¿ã¡ã€ã€ãåŠç¿æã«ã¯åžžã«ãŠã§ã€ããäžå®ã®å²åã§åŒ±ããŠãŠã§ã€ãå€ãå°ããèŠããããããšãããã¯ããã¯ãææ¡ãããŸããããã®ããŠã§ã€ãã匱ããå²åãã決ããã®ãNetwork
alphaã§ãã
**Network
alphaå€ãå°ãããã°å°ããã»ã©ãä¿åãããLoRAã®[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãŠã§ã€ãå€ã倧ãããªããŸãã**
䜿çšæã«ãŠã§ã€ããã©ãã ã匱ãŸãã(䜿çšåŒ·åºŠ)ã¯ãNetwork_Alpha/Network_Rankãã§èšç®ãã(ã»ãŒ0ïœ1ã®å€)ãNetwork
Rankæ°ãšæ·±ãé¢ä¿ããŠããŸãã
åŠç¿åŸã®LoRAã®ç²ŸåºŠãããŸãã¡ãªå ŽåããŠã§ã€ãããŒã¿ãå°ããããŠ0ã«æœ°ããŠããŸã£ãŠããå¯èœæ§ããããŸãããããªæã¯Network
Alphaå€ãäžããŠã¿ã(=ä¿åãŠã§ã€ãå€ã倧ãããã)ãšããã§ãããã
ããã©ã«ãã¯1(ã€ãŸãä¿åãŠã§ã€ãå€ããªãã¹ãæ倧ã«ãã)ã§ãã
Network AlphaãšNetwork Rankãåãå€ã®å Žåãå¹æã¯ãªãã«ãªããŸãã
â»Network Alphaå€ãNetwork Rankå€ãè¶
ããŠã¯ãããŸãããè¶
ããæ°åãæå®ããããšã¯å¯èœã§ãããé«ç¢ºçã§æå³ããªãLoRAã«ãªããŸãã
ãŸããNetwork Alphaãèšå®ãããšãã¯ãåŠç¿çãžã®åœ±é¿ãèããå¿
èŠããããŸãã
äŸãã°Alphaã16ãRankã32ã®å ŽåããŠã§ã€ãã®äœ¿çšåŒ·åºŠã¯16/32 = 0.5ã«ãªããã€ãŸãåŠç¿çããLearning
Rateãèšå®å€ã®ããã«ååã®å¹åããæããªãããšã«ãªããŸãã
AlphaãšRankãåãæ°åã§ããã°äœ¿çšåŒ·åºŠã¯1ã«ãªããåŠç¿çã«äœã®åœ±é¿ãäžããŸããã
##### Max resolution
åŠç¿ç»åã®æ倧解å床ããå¹
ãé«ããã®é ã§æå®ããŸããããåŠç¿ç»åãããã§æå®ãã解å床ãè¶
ããå Žåããã®è§£å床ãŸã§çž®å°ãããŸãã
ããã©ã«ãã¯ã512,512ãã§ããå€ãã®ã¢ãã«ããã®ãµã€ãºã®ç»åã䜿ã£ãŠããã®ã§ãLoRAåŠç¿ã®æããã®ãµã€ãºã®ç»åã䜿ãã®ãç¡é£ã§ãã
##### Stop text encoder training
ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã®åŠç¿ã¯éäžã§ã¹ãããããããšãã§ããŸããäžã§æžããéããããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã®ã¢ããããŒãã¯å
šäœã«å€§ããªåœ±é¿ãåãŒãã®ã§[éåŠç¿](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25B2%25E1%25B3%25D8%25BD%25AC)(åŠç¿ç»åã«ãã¥ãŒãã³ã°ããããŠä»ã®ç»åãæããªããªã)ã«é¥ãããããã»ã©ã»ã©ã®ãšããã§åŠç¿ãã¹ããããããã®ã[éåŠç¿](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25B2%25E1%25B3%25D8%25BD%25AC)ãé²ãäžã€ã®æã§ãã
ããã§æå®ããæ°å€ã¯å
šåŠç¿ã¹ãããã®ããŒã»ã³ãã§ããåŠç¿ããã®ããŒã»ã³ãã«éããããããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã¯åŠç¿ãã¹ãããããŸãã
äŸãã°ãç·ã¹ãããæ°ã1000ã ã£ãå Žåãããã§80ãšæå®ããããåŠç¿é²è¡åºŠã80%ã®æãã€ãŸã1000x0.8=800ã¹ãããã®æç¹ã§ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã®åŠç¿ãçµäºããŸãã
U-Netã®åŠç¿ã¯æ®ã200ã¹ãããã§åŒãç¶ãè¡ãããŸãã
ããã0ã®å Žåãããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã®åŠç¿ã¯æåŸãŸã§ã¹ãããããŸããã
##### Enable buckets
ã[bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/bucket)ããšã¯ãã®åã®éãããã±ãã(å
¥ãç©)ã§ããLoRAã§äœ¿ãåŠç¿ç»åã¯ãµã€ãºãçµ±äžãããŠããªããŠãããŸããªãã®ã§ãããéããµã€ãºã®ç»åãåæã«åŠç¿ããããšã¯ã§ããŸããããã®ãããåŠç¿åã«ç»åããµã€ãºã«å¿ããŠããã±ããã«æ¯ãåããå¿
èŠããããŸãã䌌ããµã€ãºã®ç»åã¯åããã±ãã«å
¥ããéããµã€ãºã®ç»åã¯å¥ã®ãã±ãã«å
¥ããŠãããŸãã
ããã©ã«ãã¯ãªã³ã§ãã
ããåŠç¿ç»åã®ãµã€ãºããã¹ãŠåããªããã®ãªãã·ã§ã³ã¯ãªãã«ããŠæ§ããŸãããããªã³ã®ãŸãŸã§ã圱é¿ã¯ãããŸããã
â»ããåŠç¿ç»åã®ãµã€ãºãçµ±äžãããŠããªãæã«Enable bucketsããªãã«ãããšãåŠç¿ç»åã¯æ¡å€§ãçž®å°ãããŠãµã€ãºãåã倧ããã«æããããŸãã
æ¡å€§ãçž®å°ã¯ç»åã®[ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)ãä¿ã£ããŸãŸè¡ãããŸãã[ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)ãåºæºãµã€ãºãšåãã§ãªãå Žåãæ¡å€§çž®å°åŸã®ç»åã®ã¿ãããšã³ãåºæºãµã€ãºããã¯ã¿åºãããšããããŸããäŸãã°ãåºæºãµã€ãºã512x512([ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)1)ã§ãç»åãµã€ãºã1536x1024([ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)1.5)ã®å Žåãç»åã¯çž®å°ãããŠ768x512([ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)1.5ã®ãŸãŸ)ã«ãªããŸãã
#### Advanced Configuration
ããããåŸã¯ããAdvanced Configurationãã»ã¯ã·ã§ã³ã«ãããªãã·ã§ã³ã§ãã
##### WeightsãBlocksãConv
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230519/20230519233453.png)
ãããã¯U-Netå
ã®åãããã¯ã®ãåŠç¿ã®éã¿ä»ãããšãã©ã³ã¯ãã®èšå®ã§ããããããã®ã¿ããéžæãããšã察å¿ããèšå®ç»é¢ã衚瀺ãããŸãã
â»ãããã®èšå®ã¯äžçŽè
åãã§ãããã ããããªããªããã¹ãŠç©ºæ¬ã®ãŸãŸã§æ§ããŸããã
##### Weights: Down LR weights/Mid LR weights/Up LR weights
U-Netã®æ§é å³ãããããéããU-Netã¯12åã®INãããã¯ã1åã®MIDãããã¯ã12åã®OUTãããã¯ã®èš25åã®ãããã¯ããã§ããŠããŸãã
ããããã®ãããã¯ã®åŠç¿çã®ãŠã§ã€ã(éã¿)ãå€ãããå Žåãããã§åå¥ã«èšå®ããããšãã§ããŸãã
ããã§ãããŠã§ã€ããšã¯0ïœ1ã®æ°å€ã§è¡šããããåŠç¿ã®åŒ·ããã§ã0ã®å Žåã¯ããŸã£ããåŠç¿ããªããã1ã®å Žåã¯ãLearning
rateã§èšå®ããåŠç¿çã§åŠç¿ããšããæãã§åŠç¿ã®åŒ·ããå€ããããšãã§ããŸãã
ãŠã§ã€ãã0.5ã«ããå ŽåãLearning rateã®ååã®åŠç¿çã«ãªããŸãã
ãDown LR weightsãã¯12åã®INãããã¯ã®ããããã®ãŠã§ã€ããæå®ããŸãã
ãMid LR weightsãã¯MIDãããã¯ã®ãŠã§ã€ããæå®ããŸãã
ãUp LR weightsãã¯12åã®OUTãããã¯ã®ããããã®ãŠã§ã€ããæå®ããŸãã
##### Weights: Blocks LR zero threshold
ãLoRAã¯[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããããšèª¬æããŸãããããŠã§ã€ããå°ãããã(ã€ãŸãã»ãšãã©åŠç¿ããŠããªã)[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã¯è¿œå ããŠãæå³ããããŸãããããã§ãããŠã§ã€ããå°ãããããããã¯ã«ã¯[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ããªãããšããèšå®ãã§ããŸãã
ããã§èšå®ãããŠã§ã€ãå€ãè¶
ããªããããã¯ã§ã¯ã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ãããŸãããäŸãã°ããã«0.1ãšæå®ããå ŽåããŠã§ã€ãã0.1以äžã«èšå®ãããããã¯ã«ã¯[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãè¿œå ãããŸãã(æé€å¯Ÿè±¡ãæå®å€ãå«ãã§ããããšã«æ³šæããŠãã ããïŒ)ã
ããã©ã«ãã¯ç©ºæ¬ã§ã空æ¬ã®å Žåã¯0(äœãããªã)ã§ãã
##### Blocks: Block dims, Block alphas
ããã§ãIN0ïœ11ãMIDãOUT0ïœ11ã®25åã®åãããã¯ã«å¯Ÿãããããéãã©ã³ã¯(dim)å€ãšã¢ã«ãã¡å€ãèšå®ããããšãã§ããŸãã
ã©ã³ã¯å€ãšã¢ã«ãã¡å€ã«ã€ããŠã¯Network RankãNetwork alphaã®èª¬æãèŠãŠãã ããã
ã©ã³ã¯ã®å€§ãããããã¯ã¯ããå€ãã®æ
å ±ãä¿æã§ããããšãæåŸ
ãããŸãã
ãã®ãã©ã¡ãŒã¿å€ã¯åžžã«25åã®æ°åãæå®ããªããã°ãããŸããããLoRAã¯Attentionãããã¯ãåŠç¿å¯Ÿè±¡ãšããŠããã®ã§ãAttentionãããã¯ã®ååšããªãIN0ãIN3ãIN6ãIN9ãIN10ãIN11ãOUT0ãIN1ãIN2ã«å¯Ÿããèšå®(1ã4ã7ã11ã12ã14ã15ã16çªç®ã®æ°å)ã¯åŠç¿æã¯ç¡èŠãããŸãã
â»äžçŽè
åãèšå®ã§ãããã ããããªããªã空æ¬ã®ãŸãŸã§æ§ããŸããããããæå®ããªãå Žåã¯ãNetwork Rank(Dimention)ãå€ãšãNetwork
Alphaãå€ããã¹ãŠã®ãããã¯ã«é©å¿ãããŸãã
##### Conv: Conv dims, Conv, alphas
LoRAãåŠç¿å¯Ÿè±¡ãšããŠããAttentionãããã¯ã«ã¯ãConvããšãã[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ãããããããè¿œå åŠç¿ã«ããã¢ããããŒããããŸã(èšäºäžéšã®Attentionå±€ã®æ§é ã®å³ãèŠãŠãã ãã)ãããã¯ãç³ã¿èŸŒã¿ããšèšãããåŠçã§ãããã§äœ¿ãããŠããããã£ã«ã¿ãŒãã®å€§ããã¯1x1ãã¹ã§ãã
ç³ã¿èŸŒã¿ã«ã€ããŠã¯[ãã®èšäº](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://github.com/kohya-ss/sd-scripts/pull/121)ãèªãã§ãã ããã
äžæ¹ãAttention以å€ã®ãããã¯(ResãDownãããã¯)ãOUTã«ããAttentionãããã¯ã®äžéšã«ã¯ã[3x3](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/3x3)ãã¹ã®ãã£ã«ã¿ãŒã䜿ã£ãç³ã¿èŸŒã¿ãè¡ã£ãŠããéšåããããŸããæ¬æ¥ããã¯LoRAã®åŠç¿å¯Ÿè±¡ã§ã¯ãããŸãããããã®ãã©ã¡ãŒã¿ã§æå®ããããšã§Resãããã¯ã®[3x3](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/3x3)ã®ç³ã¿èŸŒã¿ãåŠç¿å¯Ÿè±¡ã«ããããšãã§ããŸãã
åŠç¿å¯Ÿè±¡ãå¢ããã®ã§ããã粟å¯ãªLoRAåŠç¿ãè¡ããå¯èœæ§ããããŸãã
èšå®æ¹æ³ã¯ãBlocks: Blocks dims, Blocks alphasããšåãã§ãã
[3x3](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/3x3)ã®Convã¯25å±€ãã¹ãŠã«ååšããŸãã
â»äžçŽè
åãèšå®ã§ãããã ããããªããªã空æ¬ã®ãŸãŸã§æ§ããŸããã
##### No token padding
åŠç¿ç»åã«ã€ãããã£ãã·ã§ã³ã¯ã75[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ããšã«åŠçãããŸã(ã[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ãã¯åºæ¬çã«ãåèªããšæããŠåé¡ãããŸãã)ã
ãã£ãã·ã§ã³ã®é·ãã75[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³æªæºã®å Žåããã£ãã·ã§ã³ã®åŸã«çµç«¯èšå·ãå¿
èŠãªã ãè¿œå ããã75[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ã«æããããŸããããããããã£ã³ã°ããšèšããŸãã
ããã§ã¯ã[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ã®ããã£ã³ã°ãè¡ããªãããã«ããæå®ãã§ããŸãã
ããã©ã«ãã¯ãªãã§ããåºæ¬çã«ãªãã®ãŸãŸã§æ§ããŸããã
##### Gradient accumulation steps
ãŠã§ã€ãã®å€æŽ(ã€ãŸããåŠç¿ã)ã¯éåžžã¯1ãããèªã¿èŸŒãããšã«è¡ããŸãããåŠç¿ãè€æ°ããããŸãšããŠãã£ãºãã«è¡ãããšãã§ããŸããäœããããŸãšããŠãã£ãºãã«åŠç¿ããããæå®ããã®ããã®ãªãã·ã§ã³ã§ãã
ããã¯ãããæ°ãäžããåããšäŒŒãå¹æ(ãåãå¹æãã§ã¯ãããŸããïŒ)ããããŸãã
äŸãã°ãããããµã€ãºã4ã®å Žåã1ãããã§åæã«èªã¿èŸŒãŸããç»åæ°ã¯4æã§ããã€ãŸã4æèªã¿èŸŒãããšã«1ååŠç¿ãè¡ãããŸããããã§Gradient
accumulation
stepsã2ã«ãããšã2ãããããšã«1ååŠç¿ãè¡ãããã®ã§ãçµæçã«8æèªã¿èŸŒãããšã«1ååŠç¿ãè¡ãããããšã«ãªããŸããããã¯ãããæ°8ãšäŒŒãåã(åãã§ã¯ãããŸããïŒ)ã§ãã
ãã®æ°å€ãäžãããšåŠç¿åæ°ãæžãã®ã§åŠçãéããªããŸããã¡ã¢ãªãå€ãæ¶è²»ããŸãã
ããã©ã«ãã¯1ã§ãã
##### Weighted captions
çŸåšäžçªäººæ°ã®Stable Diffusionå©çšç°å¢ã¯ãStable Diffusion
WebUIãã§ãããããã«ã¯ç¬ç¹ã®ããã³ããèšè¿°æ³ããããŸããäŸãã°ããã³ããã«ã[black
cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat)ããšæå®ããæã«ãBlackãããã®ããã匷調ãããå Žåãã(black:1.2)
catããšãã颚ã«åŒ·èª¿ãããã¯ãŒãããã£ãã§å²ã¿ãã¯ãŒãã®åŸã«ã:æ°åããšå
¥ãããšããã®æ°åã®åæ°ã ãã¯ãŒãã匷調ãããŸãã
ãã®èšè¿°æ³ãåŠç¿ç»åã®ãã£ãã·ã§ã³ã§ã䜿ããããã«ããã®ããã®ãªãã·ã§ã³ã§ãã
è€éãªãã£ãã·ã§ã³ãæžãããå Žåã¯è©ŠããŠã¿ãã®ãããã§ãããã
ããã©ã«ãã¯ãªãã§ãã
##### Prior loss weight
åŠç¿æã«ã[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åã(詳ããã¯äžã®Regularisation
folderã®èª¬æãèŠãŠãã ãã)ãã©ãã ãéèŠèŠãããã決ããã®ãPrior loss weightã§ãã
ãã®å€ãäœããšã[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åã¯ããã»ã©éèŠã§ãªããšå€æãããããåŠç¿ç»åã®ç¹åŸŽã匷ãçŸããLoRAãçæãããŸãã
[æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åã䜿ããªãå Žåã¯ãã®èšå®ã¯æå³ããããŸããã
ããã¯0ïœ1ã®å€ã§ãããã©ã«ãã¯1([æ£åå](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25C0%25B5%25C2%25A7%25B2%25BD)ç»åãéèŠ)ã§ãã
##### LR number of cycles
ã¹ã±ãžã¥ãŒã©ãŒã«ã[Cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Cosine) with
restartããŸãã¯ãPolynomialããéžãã å ŽåãåŠç¿äžã«ã¹ã±ãžã¥ãŒã©ãŒäœãµã€ã¯ã«å®è¡ããããæå®ãããªãã·ã§ã³ã§ãã
ãã®ãªãã·ã§ã³ã®æ°å€ã2以äžã®å Žåã1åã®åŠç¿äžã«ã¹ã±ãžã¥ãŒã©ãŒãè€æ°åå®è¡ãããŸãã
[Cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Cosine) with
restartãPolynomialããåŠç¿ãé²ãã«ã€ããŠåŠç¿çã0ãŸã§ã ãã ãäžãã£ãŠãããŸããããµã€ã¯ã«æ°ãïŒä»¥äžã®å ŽåãåŠç¿çãïŒã«éãããåŠç¿çããªã»ããããŠåã¹ã¿ãŒãããŸãã
äžã®å³[(åŒçšå
)](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://github.com/kohya-ss/sd-
scripts/pull/121)ã¯[Cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Cosine) with
restart(玫)ãšPolynomial(èç·)ã®åŠç¿çã®å€åã®äŸã§ãã
玫ã®äŸã§ã¯ãµã€ã¯ã«æ°ã4ã«èšå®ãããŠããŸããèç·ã®äŸã§ã¯ãµã€ã¯ã«æ°ã¯1ã§ãã
æå®ããããµã€ã¯ã«æ°ã決ããããåŠç¿ã¹ãããå
ã§å®è¡ããã®ã§ããµã€ã¯ã«æ°ãå¢ããã°å¢ããã»ã©ãåŠç¿çã®å€åãæ¿ãããªããŸãã
ããã©ã«ãã¯ç©ºæ¬ã§ã空æ¬ã®å Žåã¯1ã«ãªããŸãã
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230525/20230525001355.png)
åŠç¿çã®åãã®äŸ
[Cosine](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Cosine) with restartã§ãLR
number of cycle = 4ã (玫)
Polynomialã§ãLR power = 2ã (èç·)
##### LR power
ããã¯ã¹ã±ãžã¥ãŒã©ãŒã«Polynomialãèšå®ããå Žåã®ãªãã·ã§ã³ã§ããã®æ°ã倧ãããã°å€§ããã»ã©æåã®åŠç¿çã®äžããæ¹ãæ¥æ¿ã«ãªããŸãã(äžã®å³ã®èç·ã®ç·ã®ã¹ããŒããæ¥æ¿ã«ãªããŸã)ã
powerã1ã®æã¯linearã¹ã±ãžã¥ãŒã©ãŒãšåã圢ã«ãªããŸãã
ããŸãæ°ã倧ãããããããšåŠç¿çã0ã¡ããã«åŒµãä»ããŠããŸã£ãŠåŠç¿äžè¶³ã«é¥ãã®ã§æ°ãã€ããŸãããã
ããã©ã«ãã¯ç©ºæ¬ã§ã空æ¬ã®å Žåã¯1(ã€ãŸãlinearã¹ã±ãžã¥ãŒã©ãŒãšåã)ã«ãªããŸãã
##### Additional parameters
kohya_ssã®[GUI](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/GUI)ã«è¡šç€ºãããŠããªãåŠç¿èšå®ãã©ã¡ãŒã¿ããããããå Žåãããã§ã³ãã³ããšããŠå
¥åããŸãã
éåžžã¯ç©ºæ¬ã®ãŸãŸã§æ§ããŸããã
##### Save every N steps
ããã§æå®ããã¹ãããæ°ã®åŠç¿ãçµäºããããšã«ãLoRAãã¡ã€ã«ãäœæãããä¿åãããŸãã
äŸãã°ç·åŠç¿ã¹ãããæ°ã1000ã®æãããã§200ãšæå®ãããšã200ã400ã600ã800ã¹ãããçµäºæã«LoRAãã¡ã€ã«ãä¿åãããŸãã
éäžçµéã®LoRAä¿åã«ã€ããŠã¯ãSave every N epochsããåç
§ããŠãã ããã
ããã©ã«ãã¯0(éäžçµéLoRAãä¿åããªã)ã§ãã
##### Save last N steps
åŠç¿éäžã®LoRAãä¿åããããSave every N stepsã§æå®ããå Žåã®ãªãã·ã§ã³ã§ãã
ããæè¿ã®LoRAãã¡ã€ã«ã®ã¿ä¿æããŠå€ãLoRAãã¡ã€ã«ã¯ç Žæ£ãããå Žåãããã§ãæè¿äœã¹ãããåã®LoRAãã¡ã€ã«ãä¿æããŠãããããèšå®ã§ããŸãã
äŸãã°ç·åŠç¿ã¹ãããã600ã®æãSave every N
stepsãªãã·ã§ã³ã§100ã¹ãããããšã«ä¿åããããæå®ãããšããŸãããããš100ã200ã300ã400ã500ã¹ãããç®ã«LoRAãã¡ã€ã«ãä¿åãããŸãããSave
every N
stepsã300ãšæå®ããå Žåãæè¿300ã¹ãããåã®LoRAãã¡ã€ã«ã®ã¿ä¿æãããŸããã€ãŸã500ã¹ãããç®ã«ã¯200(=500-300)ã¹ãããç®ããå€ãLoRA(ã€ãŸã100ã¹ãããç®ã®LoRA)ã¯æ¶å»ãããŸãã
ããã©ã«ãã¯0ã§ãã
##### Keep n tokens
åŠç¿ç»åã«ãã£ãã·ã§ã³ãã€ããŠããå Žåããã®ãã£ãã·ã§ã³å
ã®ã³ã³ãã§åºåãããåèªãã©ã³ãã ã«å
¥ãæ¿ããããšãã§ããŸã(詳ããã¯Shuffle
captionãªãã·ã§ã³ãèŠãŠãã ãã)ããããããã£ãšå
é ã«çœ®ããŠããããåèªãããå Žåã¯ããã®ãªãã·ã§ã³ã§ãæåã®ãåèªã¯å
é ã«åºå®ããŠãããŠããšæå®ã§ããŸãã
ããã§æå®ããæ°ã®æåã®åèªã¯ããã€ãå
é ã«åºå®ãããŸãã
ããã©ã«ãã¯0ã§ããShuffle captionãªãã·ã§ã³ããªãã®å Žåã¯ãã®ãªãã·ã§ã³ã¯äœãããŸããã
â»ããã§ãããåèªããšã¯ãã³ã³ãã§åºåãããããã¹ãã®ããšã§ããåºåãããããã¹ããããã€åèªãå«ãã§ããããšãããã¯ã1åèªããšããŠã«ãŠã³ããããŸãã
ã[black cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat), eating,
sittingãã®å Žåãã[black
cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat)ãã§1åèªã§ãã
##### Clip skip
ããã¹ã[ãšã³ã³ãŒããŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A8%25A5%25F3%25A5%25B3%25A1%25BC%25A5%25C0%25A1%25BC)ã«ã¯ãCLIPããšããä»çµã¿ã䜿ãããŠããŸãããããã¯12å±€ã®äŒŒããããªã¬ã€ã€ãŒããã§ããŠããŸãã
ããã¹ã([ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³)ã¯æ¬æ¥ããã®12å±€ã®ã¬ã€ã€ãŒãéã£ãŠæ°åã®å(ãã¯ãã«)ã«å€æãããæåŸã®ã¬ã€ã€ãŒããåºãŠãããã¯ãã«ãU-
Netã®Attentionãããã¯ã«éãããŸãã
ãããããNovel AIããšãããµãŒãã¹ãç¬èªã«éçºããã¢ãã«ãé称ãNovel
AIã¢ãã«ãã¯ãæåŸã®ã¬ã€ã€ãŒã§ãªãæåŸãã2çªç®ã®ã¬ã€ã€ãŒãåºåãããã¯ãã«ã䜿ãããšããç¬èªä»æ§ãæ¡çšããŸãããNovel
AIã¢ãã«ãã掟çããã¢ãã«ãåæ§ã§ãããã®ããããåŠç¿ã«äœ¿ãããŒã¹ã¢ãã«ãCLIPã®ã©ã®ã¬ã€ã€ãŒããåºãŠãããã¯ãã«ã䜿ã£ãŠãããããšããæå®ãå¿
èŠã«ãªããŸãã
ãã®ãæåŸãããçªç®ãã®ã¬ã€ã€ãŒçªå·ãæå®ããã®ããClip skipãã§ãã
ããã2ã«ãããšãæåŸãã2çªç®ã®ã¬ã€ã€ãŒã®åºåãã¯ãã«ãAttentionãããã¯ã«éãããŸãã1ã®å Žåã¯ãæåŸã®ã¬ã€ã€ãŒã®åºåãã¯ãã«ã䜿ãããŸãã
ããŒã¹ã¢ãã«ã«Novel AIã¢ãã«(ãŸãã¯ãã®ããã¯ã¹ã¢ãã«)ã䜿ãããŠããå Žåã¯ã2ã«ããæ¹ãããã§ãããããã®ã»ãã®å Žåã¯1ã§æ§ããŸããã
##### Max Token Length
![](https://cdn-ak.f.st-
hatena.com/images/fotolife/h/hoshikat/20230520/20230520021639.png)
ãã£ãã·ã§ã³ã«å«ãŸããæ倧ã®[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ã®é·ããæå®ããŸãã
ããã§ããã[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ãã¯åèªæ°ã§ã¯ãªãã[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³æ°ã¯åèªæ°ãšã ãããåãïœ1.5åãããã®æ°ã«ãªããŸããã³ã³ãã1[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ãšã«ãŠã³ããããããšã«æ³šæããŠãã ããã
75[ããŒã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C8%25A1%25BC%25A5%25AF)ã³ãè¶
ãããã£ãã·ã§ã³ã䜿ãããšã¯ãã£ãã«ãªãã§ãããããããã£ãã·ã§ã³ã®æãé·ããªããšæã£ããšãã¯ãããã§ãã倧ããªæ°åãæå®ããŠãã ããã
##### Full fp16 training (experimental)
äžã§èª¬æãããªãã·ã§ã³ãMixed
precisionãããªã³(fp16ãŸãã¯bf16)ã«ãããšãåŠç¿æã«32ããããš16ãããã®ããŒã¿ãæ··åããŠäœ¿çšãããŸããããã®ãªãã·ã§ã³ããªã³ã«ãããšãã¹ãŠã®ãŠã§ã€ãããŒã¿ã16ããã(fp16圢åŒ)ã«æããããŸããã¡ã¢ãªã®ç¯çŽã«ã¯ãªããŸãããäžéšããŒã¿ç²ŸåºŠãååã«ãªãã®ã§åŠç¿ç²ŸåºŠãèœã¡ãå¯èœæ§ããããŸãã
ããã©ã«ãã¯ãªãã§ãããã£ãœã©ã¡ã¢ãªãç¯çŽããããšã以å€ã¯ãªãã®ãŸãŸã§ããã§ãããã
##### Gradient checkpointing
éåžžã®å ŽåãåŠç¿äžã¯ãç»åãèªã¿èŸŒãŸããããšã«èšå€§ãªæ°ã®[ãã¥ãŒã©ã«ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25CB%25A5%25E5%25A1%25BC%25A5%25E9%25A5%25EB%25A5%25CD%25A5%25C3%25A5%25C8)ã®ãŠã§ã€ããäžæã«ä¿®æ£ãã¢ããããŒãããŸããããããäžæãã§ãªããå°ããã€ãä¿®æ£ããããšã§ãèšç®åŠçãæžãããŠã¡ã¢ãªãç¯çŽã§ããŸãã
ãã®ãªãã·ã§ã³ã¯ãŠã§ã€ãèšç®ãå°ããã€è¡ãããã«æå®ããŸããããããªã³ã«ããŠããªãã«ããŠãLoRAã®åŠç¿çµæã«åœ±é¿ã¯ãããŸããã
ããã©ã«ãã¯ãªãã§ãã
##### Shuffle caption
åŠç¿ç»åã«ãã£ãã·ã§ã³ãã€ããŠããå Žåããã£ãã·ã§ã³ã®å€ãã¯ã[black
cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat), eating,
sittingããšãã£ãå
·åã«ã³ã³ãã§åºåãããåèªã䞊ãã 圢åŒã§æžãããŠããããšãå€ãã§ãããããã®ã³ã³ãã§åºåãããŠããåèªã®é çªãæ¯åã©ã³ãã ã«å
¥ãæ¿ããã®ãShuffle
captionãªãã·ã§ã³ã§ãã
äžè¬çã«ãã£ãã·ã§ã³å
ã®åèªã¯å
é ã«è¿ãã»ã©éèŠãããŸãããã®ãããåèªã®é çªãåºå®ãããŠãããšåŸæ¹ã®åèªãããŸãåŠç¿ãããªãã£ãããåæ¹ã®åèªãåŠç¿ç»åãšæå³ããªãçµã³ã€ããããå¯èœæ§ããããŸããç»åãèªã¿èŸŒãããšã«æ¯ååèªã®é çªãå
¥ãæ¿ããããšã§ããã®ãããããä¿®æ£ã§ããããšãæåŸ
ãããŸãã
ãã£ãã·ã§ã³ãã³ã³ãåºåãã§ãªãæç« ã«ãªã£ãŠããå Žåã¯ãã®ãªãã·ã§ã³ã¯æå³ããããŸããã
ããã©ã«ãã¯ãªãã§ãã
â»ããã§ãããåèªããšã¯ãã³ã³ãã§åºåãããããã¹ãã®ããšã§ããåºåãããããã¹ããããã€åèªãå«ãã§ããããšãããã¯ã1åèªããšããŠã«ãŠã³ããããŸãã
ã[black cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat), eating,
sittingãã®å Žåãã[black
cat](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/black%2520cat)ãã§1åèªã§ãã
##### Persistent data loader
åŠç¿ã«å¿
èŠãªããŒã¿ã¯1ã€ã®ãšããã¯ãçµããããšã«ç Žæ£ãããåèªã¿èŸŒã¿ãããŸãããããç Žæ£ããã«ä¿æããŠããããã®ãªãã·ã§ã³ã§ãããã®ãªãã·ã§ã³ããªã³ã«ãããšæ°ãããšããã¯ã®åŠç¿ãå§ãŸãé床ãäžãããŸãããããŒã¿ãä¿æããåã¡ã¢ãªãæ¶è²»ããŸãã
ããã©ã«ãã¯ãªãã§ãã
##### Memory efficient attention
ããã«ãã§ãã¯ãå
¥ãããšVRAMã®äœ¿çšãæããŠAttentionãããã¯ã®åŠçãè¡ããŸãã次ã®ãªãã·ã§ã³ã®ãxformersãã«æ¯ã¹ãŠã¹ããŒãã¯é
ããªããŸããVRAMã®å®¹éãå°ãªãå Žåã¯ãªã³ã«ããŸãããã
ããã©ã«ãã¯ãªãã§ãã
##### Use xformers
ãxformersããšãã[Python](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Python)ã©ã€ãã©ãªã䜿çšãããšãè¥å¹²ã®ã¹ããŒãäœäžãšåŒãæãã«VRAMã®äœ¿çšãæããŠAttentionãããã¯åŠçãè¡ããŸããVRAMã®å®¹éãå°ãªãå Žåã¯ãªã³ã«ããŸãããã
ããã©ã«ãã¯ãªã³ã§ãã
##### Color augmentation
ãaugmentationããšã¯ãç»åã®æ°Žå¢ãããæå³ããŸããåŠç¿ç»åãæ¯åå°ãå å·¥ããããšã«ãããåŠç¿ç»åã®çš®é¡ãç䌌çã«å¢ãããŸãã
Color
augmentationããªã³ã«ãããšãç»åã®è²çž(Hue)ãæ¯åã©ã³ãã ã«å°ãå€åãããŸããããã«ãã£ãŠåŠç¿ããLoRAã¯è²èª¿ã«è¥å¹²ã®å¹
ãåºãããšãæåŸ
ãããŸãã
Cache latentsãªãã·ã§ã³ããªã³ã®å Žåã¯äœ¿çšã§ããŸããã
ããã©ã«ãã¯ãªãã§ãã
##### Flip augmentation
ãã®ãªãã·ã§ã³ããªã³ã«ãããšãã©ã³ãã ã«ç»åãå·Šå³å転ããŸããå·Šå³ã®ã¢ã³ã°ã«ãåŠç¿ã§ããã®ã§ã **å·Šå³å¯Ÿç§°**
ã®äººç©ãç©äœãåŠç¿ããããšãã¯æçã§ãããã
ããã©ã«ãã¯ãªãã§ãã
##### Min [SNR](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/SNR) gamma
LoRAåŠç¿ã§ã¯åŠç¿ç»åã«ãããããªåŒ·ãã®ãã€ãºãä¹ããŠåŠç¿ããŸã(ãã®ãããã®è©³çŽ°ã¯çç¥)ããä¹ã£ãŠãããã€ãºã®åŒ·ãã®éãã«ãã£ãŠåŠç¿ç®æšã«è¿å¯ã£ããé¢ãããããŠåŠç¿ãå®å®ããªãããšããããMin
[SNR](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/SNR)
gammaã¯ãããè£æ£ããããã«å°å
¥ãããŸãããç¹ã«ãã€ãºãããŸãä¹ã£ãŠããªãç»åãåŠç¿ãããšãã¯ç®æšãã倧ããé¢ãããããã®ã§ããã®ãžã£ã³ããæããããã«ããŸãã
詳现ã¯ãããããã®ã§çç¥ããŸããããã®å€ã¯0ïœ20ã§èšå®ã§ããããã©ã«ãã¯0ã§ãã
ãã®æ¹æ³ãæå±ããè«æã«ãããšæé©å€ã¯5ã ããã§ãã
ã©ãã»ã©å¹æçãªã®ãã¯äžæã§ãããåŠç¿çµæã«äžæºãããæã¯ãããããªå€ãè©ŠããŠã¿ããšããã§ãããã
##### Don't upscale
[bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/bucket) resolution
[Bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Bucket)(ãã±ã)ã®ãµã€ãºã¯ããã©ã«ãã§ã¯256ïœ1024[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)(ãŸãã¯Max
resolutionãªãã·ã§ã³ã§æ倧解å床ãæå®ããŠããå Žåã¯ãã¡ããåªå
ãããŸã)ã«èšå®ãããŠããŸããã¿ãããšã³ã®ã©ã¡ããäžæ¹ã§ããã®ãµã€ãºç¯å²ããå€ããç»åã¯ãæå®ç¯å²å
ã®ãµã€ãºã«ãªãããã«([ã¢ã¹ãã¯ãæ¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25A2%25A5%25B9%25A5%25DA%25A5%25AF%25A5%25C8%25C8%25E6)ãä¿ã£ããŸãŸ)æ¡å€§ãŸãã¯çž®å°ãããŸãã
ãããããã®ãªãã·ã§ã³ããªã³ã«ãããšãã±ããµã€ãºã®ç¯å²èšå®ã¯ç¡èŠãããåŠç¿ç»åã®ãµã€ãºã«å¿ããŠèªåçã«ãã±ããçšæãããã®ã§ããã¹ãŠã®åŠç¿ç»åãæ¡å€§çž®å°ãããã«èªã¿èŸŒãŸããããã«ãªããŸãããã ããã®æã[Bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Bucket) resolution
steps(åŸè¿°)ã«ãµã€ãºãåãããããç»åã®äžéšãåãåãããå¯èœæ§ã¯ãããŸãã
ããã©ã«ãã¯ãªã³ã§ãã
##### [Bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Bucket) resolution steps
[Bucket](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Bucket)(ãã±ã)ã䜿çšããå Žåãåãã±ãã®è§£å床ééãããã§æå®ããŸãã
äŸãã°ããã§64ãæå®ããå Žåãããããã®åŠç¿ç»åããµã€ãºã«å¿ããŠ64[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ããšã«å¥ã®ãã±ãã«æ¯ãåããŸãããã®æ¯ãåãã¯ã¿ããšã³ããããã«å¯ŸããŠè¡ãããŸãã
ããç»åãµã€ãºããã±ãã®æå®ãããµã€ãºããã¿ãªã§ãªãå Žåãã¯ã¿åºããéšåã¯åãåãããŸãã
äŸãã°ãæ倧解å床ã512[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ã§ãã±ãã®ã¹ããããµã€ãºã64[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ããšã®å Žåããã±ãã¯512ã448ã384âŠãšãªããŸããã500[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ã®ç»åã¯448[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ã®ãã±ãã«å
¥ãããããµã€ãºãåãããããäœåãª52[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ãåãåãããŸãã
ããã©ã«ãã¯64[ãã¯ã»ã«](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D4%25A5%25AF%25A5%25BB%25A5%25EB)ã§ãã
â»ãã®æ°å€ãããŸãå°ãããããããšãã±ãã®æ¯ãåãã现ãããªããããŠããŸããææªãç»å1æããšã«1ã€ã®ãã±ããã®ãããªç¶æ
ã«ãªã£ãŠããŸããŸãã
1ãããã«ã€ãå¿
ãåããã±ãããç»åãèªã¿èŸŒãã®ã§ããã±ãã®äžã®ç»åãå°ãªããããšãããæ°ãæå³ããå°ãªããªã£ãŠããŸãããšã«æ³šæããŠãã ããã
##### Random crop instead of center crop
äžèšã®ããã«ãäžéå端ãªãµã€ãºã®ç»åã¯ãã±ãã«æ¯ãåããåŸã«äžéšãåãåãããŠãµã€ãºãæããããŸãããéåžžã¯ç»åã®äžå¿ãä¿ã€ããã«åãåãããŸãã
ãã®ãªãã·ã§ã³ããªã³ã«ãããšãçµµã®ã©ã®éšåãåãåãããããã©ã³ãã ã«æ±ºãŸããŸããåŠç¿ã®ç¯å²ãç»åã®äžå¿ä»¥å€ã«åºããããšãã¯ãã®ãªãã·ã§ã³ããªã³ã«ããŸãã
â»cache latentsãªãã·ã§ã³ããªã³ã«ããŠãããšãã¯ãã®ãªãã·ã§ã³ã¯äœ¿ããŸããã
##### Noise offset type
åŠç¿ç»åã«è¿œå ãã€ãºãä¹ãããšãã«ãã©ã®ææ³ã§ä¹ããã®ããæå®ãããªãã·ã§ã³ã§ããåŠç¿æã«ã¯å¿
ãç»åã«ãã€ãºãä¹ãã(ãã®èŸºã®è©³çŽ°ã¯çç¥ããŸã)ã®ã§ããããã®ãã€ãºã¯ãäºæž¬ãã¥ããããã€ãºã§ããæ¹ããã奜ãŸãããããããã«å€ãã®ãã€ãºãä¹ããããšã§ãããäºæž¬ãã¥ããããã€ãºã«ããŸãã
ããã©ã«ãã¯Originalã§ããMultiresã¯ããå°ãè€éãªæ¹æ³ã§ãã€ãºãè¿œå ããŸãã
##### Noise offset
Noise offset
typeã«ãOriginalããéžæãããšãã®ãªãã·ã§ã³ã§ããããã§0ãã倧ããªå€ãå
¥ãããšè¿œå ãã€ãºãä¹ããŸããå€ã¯0ïœ1ã§ã0ã®å Žåã¯ãŸã£ãããã€ãºãè¿œå ããŸããã1ã®å Žåã¯åŒ·ããã€ãºãè¿œå ããŸãã
0.1çšåºŠã®ãã€ãºãè¿œå ãããšLoRAã®è²åããé®®ããã«ãªã(ææãã¯ã£ãããã)ãšããå ±åããããŸããããã©ã«ãã¯0ã§ãã
##### Adaptive noise scale
Noise offsetãªãã·ã§ã³ãšãã¢ã§äœ¿ããŸããããã«æ°å€ãæå®ãããšãNoise
offsetã§æå®ããè¿œå ãã€ãºéãããã«èª¿æŽããå¢å¹
ãããã¯æžè¡°ããŸããå¢å¹
(ãŸãã¯æžè¡°)ããéã¯ããç»åã«çŸåšã©ã®ããããã€ãºãä¹ã£ãŠããããã«ãã£ãŠèªåçã«èª¿æŽãããŸããå€ã¯-1ïœ1ã§ããã©ã¹ãæå®ãããšè¿œå ãã€ãºéãå¢ãããã€ãã¹ãæå®ããå Žåã¯è¿œå ãã€ãºéãæžããŸãã
ããã©ã«ãã¯0ã§ãã
##### Multires noise iterations
Noise offset typeã«ãMultiresããéžæãããšãã®ãªãã·ã§ã³ã§ããããã§0ãã倧ããªå€ãå
¥ãããšè¿œå ãã€ãºãä¹ããŸãã
Multiresã§ã¯ãæ§ã
ãªè§£å床ã®ãã€ãºãäœã£ãŠãããã足ãããšã§æçµçãªè¿œå ãã€ãºãäœæããŸããããã§ã¯ãæ§ã
ãªè§£å床ããããã€äœãããæå®ããŸãã
ããã©ã«ãã¯0ã§ã0ã®æã¯è¿œå ãã€ãºã¯ä¹ããŸããã䜿çšãããå Žåã¯6ã«èšå®ããããšããæšå¥šãããŠããŸãã
##### Multires noise discount
Multires noise
iterationsãªãã·ã§ã³ãšãã¢ã§äœ¿ããŸããå解å床ã®ãã€ãºéãããçšåºŠåŒ±ããããã®æ°å€ã§ãã0ïœ1ã®å€ã§ãæ°åãå°ããã»ã©ãã€ãºããã匱ãŸããŸããã¡ãªã¿ã«åŒ±ããéã¯è§£å床ã«ãã£ãŠéãã解å床ã®äœããã€ãºã¯ãããã匱ããŸãã
ããã©ã«ãã¯0ã§ã0ã®å Žåã¯äœ¿çšæã«0.3ã«èšå®ãããŸããéåžžã¯0.8ãæšå¥šãããŠããŸããåŠç¿ç»åãæ¯èŒçå°ãªãå Žåã¯0.3çšåºŠã«äžãããšè¯ãããã§ãã
##### Dropout caption every n epochs
éåžžãç»åãšãã£ãã·ã§ã³ã¯ãã¢ã§åŠç¿ãããŸãããç¹å®ã®ãšããã¯ããšã«ãã£ãã·ã§ã³ã䜿ããããã£ãã·ã§ã³ãªãã®ç»åãã®ã¿åŠç¿ãããããšãã§ããŸãã
ãã®ãªãã·ã§ã³ã¯ãããšããã¯ããšã«ãã£ãã·ã§ã³ã䜿ããªã([ããããã¢ãŠã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C9%25A5%25ED%25A5%25C3%25A5%25D7%25A5%25A2%25A5%25A6%25A5%25C8))ããšããæå®ãè¡ããŸãã
äŸãã°ããã§2ãæå®ãããšã2ãšããã¯ããšã«(2ãšããã¯ç®ã4ãšããã¯ç®ã6ãšããã¯ç®âŠ)ãã£ãã·ã§ã³ã䜿ããªãç»ååŠç¿ãè¡ããŸãã
ãã£ãã·ã§ã³ã®ãªãç»åãåŠç¿ãããšããã®LoRAã¯ããå
æ¬çãªç»åã®ç¹åŸŽãåŠç¿ããããšãæåŸ
ãããŸãããŸããç¹å®ã®åèªã«ç»åã®ç¹åŸŽãçµã³ä»ããããªãããã«ããå¹æãæåŸ
ã§ããŸãããã ãããŸããã£ãã·ã§ã³ã䜿ããªããããšããã®LoRAã¯ããã³ããã®å¹ããªãLoRAã«ãªã£ãŠããŸãå¯èœæ§ãããã®ã§æ°ãã€ããŸãããã
ããã©ã«ãã¯0ã§ã0ã®å Žåã¯ãã£ãã·ã§ã³ã®[ããããã¢ãŠã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25C9%25A5%25ED%25A5%25C3%25A5%25D7%25A5%25A2%25A5%25A6%25A5%25C8)ãè¡ããŸããã
##### Rate of caption dropout
äžèšã®Dropout caption every n
epochsãšäŒŒãŠããŸãããåŠç¿ã®å
šå·¥çšã®ãã¡ãããäžå®ã®å²åã ããã£ãã·ã§ã³ã䜿ããããã£ãã·ã§ã³ãªãã®ç»åããšããŠåŠç¿ãããããšãã§ããŸãã
ããã§ãã£ãã·ã§ã³ãªãç»åã®å²åãèšå®ã§ããŸãã0ã¯ãåŠç¿äžå¿
ããã£ãã·ã§ã³ã䜿ããèšå®ã1ã¯ãåŠç¿äžãã£ãã·ã§ã³ãå
šã䜿ããªããèšå®ã§ãã
ã©ã®ç»åãããã£ãã·ã§ã³ãªãç»åããšããŠåŠç¿ããããã¯ã©ã³ãã ã«æ±ºãŸããŸãã
äŸãã°ãç»å20æããããã50åèªã¿èŸŒãLoRAåŠç¿ã1ãšããã¯ã ãè¡ãå Žåãç»ååŠç¿ã®ç·æ°ã¯20æx50åx1ãšããã¯=1000åã§ãããã®æRate
of caption dropoutã0.1ã«èšå®ãããšã1000åx0.1=100åã¯ããã£ãã·ã§ã³ãªãã®ç»åããšããŠåŠç¿ãè¡ããŸãã
ããã©ã«ãã¯0ã§ããã¹ãŠã®ç»åããã£ãã·ã§ã³ä»ãã§åŠç¿ããŸãã
##### VAE batch size
Cache
latentsãªãã·ã§ã³ããªã³ã«ãããšãå§çž®ãããç¶æ
ã®ç»åããŒã¿ãã¡ã€ã³ã¡ã¢ãªã«ä¿æããŠããããšãã§ããŸããããã®ãå§çž®ãç»åãäœæäžçµã§ä¿æããããèšå®ããã®ãVAE
batch sizeã§ããããããµã€ãº(Batch size)ã§æå®ããç»åææ°ãäžåºŠã«åŠç¿ããã®ã§ãVAE batch
sizeãããã«åãããã®ãæ®éã§ãã
ããã©ã«ãã¯0ã§ããã®å ŽåBatch sizeãšåãæ°å€ã«èšå®ãããŸãã
##### Save training state
åŠç¿ç»åãç¹°ãè¿ãæ°ããšããã¯æ°ãå€ããšLoRAã®åŠç¿ã«é·ãæéãããããŸãã
ãã®ãªãã·ã§ã³ããªã³ã«ãããšãåŠç¿ãéäžã§äžæããŠåŸæ¥ç¶ãããåŠç¿ãåéããããšãã§ããŸãã
åŠç¿ã®éäžçµéããŒã¿ã¯ãlast-stateããšãããã©ã«ãã«ä¿åãããŸãã
##### Resume from saved training state
äžæããåŠç¿ãåéãããå Žåãããã«ãlast-stateããã©ã«ãã®å Žæãæå®ããŸãã
åŠç¿ãåéããã«ã¯ãåŠç¿ã®éäžçµéããŒã¿ãä¿åãããŠããå¿
èŠããããŸãã
##### Max train epoch
åŠç¿ã®ããã®æ倧ãšããã¯æ°ãæå®ããŸããEpochãªãã·ã§ã³ã§ãšããã¯æ°ãæå®ããã®ãåºæ¬ã§ãããããã§æå®ãããšããã¯æ°ã«éãããšå¿
ãåŠç¿ãçµäºããŸãã
ããã©ã«ãã¯ç©ºæ¬ã§ãã空æ¬ã®ãŸãŸã§æ§ããŸããã
##### Max num workers for DataLoader
åŠç¿ã®ããã®ããŒã¿ãèªã¿èŸŒãæã«äœ¿çšããCPUããã»ã¹æ°ãæå®ãããªãã·ã§ã³ã§ãããã®æ°å€ãäžããããšã«ãµãããã»ã¹ãæå¹ã«ãªãããŒã¿ã®èªã¿èŸŒã¿ã¹ããŒããäžãããŸãããæ°åãäžãããããšããã£ãŠéå¹çã«ãªãå ŽåããããŸãã
ãªããã©ãã ã倧ããæ°åãæå®ããŠãã䜿çšCPUã®åæå®è¡ã¹ã¬ããæ°ä»¥äžã«ã¯ãªããŸããã
ããã©ã«ãã¯0ã§ãCPUã®ã¡ã€ã³ããã»ã¹ã§ã®ã¿ããŒã¿èªã¿èŸŒã¿ãè¡ããŸãã
##### WANDB [API](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/API) Key
ã[WandB](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://wandb.ai/site)ã(Weights&Biases)ãšãã[æ©æ¢°åŠç¿](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25B5%25A1%25B3%25A3%25B3%25D8%25BD%25AC)ãµãŒãã¹ããããŸããããã¯æé©ãªèšå®ãèŠã€ããããã«åŠç¿ã®é²è¡ç¶æ³ãã°ã©ãã§è¡šç€ºãããåŠç¿ãã°ãªã©ããªã³ã©ã€ã³ã§èšé²ãå
±æãããµãŒãã¹ã§ãããkohya_ssã§ããã®ãµãŒãã¹ã䜿çšã§ããããã«ãªããŸããã
ãã ããã®ãµãŒãã¹ã®ã¢ã«ãŠã³ããå¿
èŠã§ããã¢ã«ãŠã³ããäœæããåŸã[https://app.wandb.ai/authorize](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://app.wandb.ai/authorize)ããã[API](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/API)
keyããååŸã§ããŸããååŸãã[API](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/API)ããŒãããã«å
¥åããŠãããšãåŠç¿æã«èªåçã«ãã°ã€ã³ããWandBã®ãµãŒãã¹ãšé£åã§ããããã«ãªããŸãã
WandBã«é¢ãã詳现ã¯çããŸããããLoRAè·äººããç®æã人ã¯è©ŠããŠã¿ãŸãããã
##### WANDB Logging
åŠç¿ç¶æ³ã®ãã°ãWandBãµãŒãã¹ã䜿ã£ãŠèšé²ãããã©ãããããã§æå®ã§ããŸãã
ããã©ã«ãã¯ãªãã§ããªãã®å Žåã¯ãtensorboardããšããããŒã«ã®åœ¢åŒã§ãã°ãèšé²ããŸãã
#### Sample images config
LoRAã䜿ã£ãç»åçæãã©ããªæãã«ãªãã®ãåŠç¿éäžã§ãã§ãã¯ãããå Žåãããã§ç»åçæããã³ãããå
¥åããŸãã
ãã ãLoRAã¯æ¯èŒçåŠç¿æéãçãã®ã§ãç»åçæãã¹ãã®å¿
èŠã¯ããŸããªããããããŸããã
##### Sample every n steps
åŠç¿äžãäœã¹ãããç®ã«ç»åãçæãããã®ããæå®ããŸããäŸãã°100ãšæå®ãããšã100ã¹ãããããšã«ç»åãçæããŸãã
ããã©ã«ãã¯0ã§ã0ã®å Žåã¯ç»åãçæããŸããã
##### Sample every n epochs
åŠç¿äžãäœãšããã¯ç®ã«ç»åãçæãããã®ããæå®ããŸããäŸãã°2ãšæå®ãããšã2ãšããã¯ããšã«ç»åãçæããŸãã
ããã©ã«ãã¯0ã§ã0ã®å Žåã¯ç»åãçæããŸããã
##### Sample sampler
ç»åçæã«äœ¿ã[ãµã³ãã©ãŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25B5%25A5%25F3%25A5%25D7%25A5%25E9%25A1%25BC)ãæå®ããŸããããã§æå®ãã[ãµã³ãã©ãŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25B5%25A5%25F3%25A5%25D7%25A5%25E9%25A1%25BC)ã®å€ãã¯Stable
Diffusion Web
UIã§çšæãããŠãã[ãµã³ãã©ãŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25B5%25A5%25F3%25A5%25D7%25A5%25E9%25A1%25BC)ãšåããªã®ã§ã詳现ã¯Web
UIã®èª¬æãµã€ããåç
§ããŠãã ããã
ããã©ã«ãã¯euler_aã§ãã
##### Sample prompts
ããã§ããã³ãããå
¥åããŸãã
ãã ãããã«ã¯ããã³ããã ãã§ãªãä»ã®èšå®ãå
¥åã§ããŸããã»ãã®èšå®ãå
¥åããå Žåã¯ã--nãã®ããã«ãã€ãã¹2ã€ãšã¢ã«ãã¡ããããçµã¿åãããŠèšå®ãæå®ããŸããäŸãã°ãã¬ãã£[ãããã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D6%25A5%25D7%25A5%25ED%25A5%25F3)ããã«ãwhite,
dogããšå
¥ãããå Žåãã--n white, dogããšæžããŸãã
ãã䜿ããããªèšå®ã®æå®ã¯ä»¥äžã®éãã§ãã
\--nïŒãã¬ãã£[ãããã³](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25A5%25D6%25A5%25D7%25A5%25ED%25A5%25F3)ãã
\--wïŒç»åã®å¹
\--hïŒç»åã®é«ã
\--dïŒSeed
\--lïŒCFG Scale
\--sïŒã¹ãããæ°
ããã©ã«ãã¯ç©ºæ¬ã§ãã空æ¬ã®æã«èšè¿°äŸãèã衚瀺ãããŠããã®ã§ããããåèã«ããŠãã ããã
### ãŸãšã
Stable Diffusionã®è¿œå åŠç¿ã®ã²ãšã€ã§ããLoRAã®ããã¿ãšãLoRAåŠç¿ãè¡ãããŒã«ã§ããkohya_ssã®åèšå®ã«ã€ããŠè§£èª¬ããŸããã
èšå®ããé
ç®ãéåžžã«å€ãã®ã§æ··ä¹±ãããã§ããããŸãã¯æšå¥šèšå®ã§è»œãåŠç¿ããŠãåŠç¿çµæã«å¿ããŠå°ããã€èšå®ãå€ããŠããããã«ããŸãããã
ããã§ã®è§£èª¬ãåèã«ããŠãããã«é«ã粟床ã®LoRAäœæãç®æããŠã¿ãŠãã ããã
[ Stable Diffusion ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/Stable%2520Diffusion?from%3Dhatenablog%26utm_source%3Dhoshikat.hatenablog.com%26utm_medium%3Dhatenablog%26utm_campaign%3Dblogtag%26utm_term%3DStable%2BDiffusion%26utm_content%3D%252Fentry%252F2023%252F05%252F26%252F223229)
[ ãçµµæãAI ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/%25E3%2581%258A%25E7%25B5%25B5%25E6%258F%258F%25E3%2581%258DAI?from%3Dhatenablog%26utm_source%3Dhoshikat.hatenablog.com%26utm_medium%3Dhatenablog%26utm_campaign%3Dblogtag%26utm_term%3D%25E3%2581%258A%25E7%25B5%25B5%25E6%258F%258F%25E3%2581%258DAI%26utm_content%3D%252Fentry%252F2023%252F05%252F26%252F223229)
[ LoRA ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/LoRA?from%3Dhatenablog%26utm_source%3Dhoshikat.hatenablog.com%26utm_medium%3Dhatenablog%26utm_campaign%3Dblogtag%26utm_term%3DLoRA%26utm_content%3D%252Fentry%252F2023%252F05%252F26%252F223229)
[ kohya_ss ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://d.hatena.ne.jp/keyword/kohya_ss?from%3Dhatenablog%26utm_source%3Dhoshikat.hatenablog.com%26utm_medium%3Dhatenablog%26utm_campaign%3Dblogtag%26utm_term%3Dkohya_ss%26utm_content%3D%252Fentry%252F2023%252F05%252F26%252F223229)
hoshikat [2023-05-26 22:32](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[![ãã®èšäºãã¯ãŠãªããã¯ããŒã¯ã«è¿œå ](https://b.st-hatena.com/images/entry-button/button-
only.gif)](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://b.hatena.ne.jp/entry/s/hoshikat.hatenablog.com/entry/2023/05/26/223229
"ãã®èšäºãã¯ãŠãªããã¯ããŒã¯ã«è¿œå ")
[Tweet](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://twitter.com/share)
[åºåãé衚瀺ã«ãã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=http://blog.hatena.ne.jp/guide/pro)
é¢é£èšäº
* [ ![誰ã§ããããStable Diffusionãããã¹ããšã³ã³ãŒããŒïŒCLIPã®ããã¿](https://cdn.image.st-hatena.com/image/square/a696ceac28eea86b473941ea554a68a3c78c1db1/backend=imagemagick;height=100;version=1;width=100/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fh%2Fhoshikat%2F20230612%2F20230612183245.png) ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/13/002443?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[ 2023-06-13 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/06/13?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[誰ã§ããããStable Diffusion ããã¹ããšã³ã³ãŒããŒïŒCLIPã®ããã¿](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/06/13/002443?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
以åã®èšäºã§Stable Diffusionãã©ã®ããã«çµµãæããŠãããé âŠ
* [ ![誰ã§ããããStable DiffusionãLoRAãäœã£ãŠã¿ãã\(å®è·µç·š\)](https://cdn.image.st-hatena.com/image/square/cb2cf5ca3ba98667012ef742fc824762a25929ff/backend=imagemagick;height=100;version=1;width=100/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fh%2Fhoshikat%2F20230607%2F20230607174810.png) ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/07/215433?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[ 2023-06-07 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/06/07?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[誰ã§ããããStable Diffusion LoRAãäœã£ãŠã¿ãã(å®è·µç·š)](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/06/07/215433?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
以åã®èšäºã§LoRAãäœãããã®Kohya_sså°å
¥ã®è§£èª¬ãæžããŸãã*âŠ
* [ ![誰ã§ããããStable DiffusionãLoRAãäœã£ãŠã¿ãã\(å°å
¥ç·š\)](https://cdn.image.st-hatena.com/image/square/39f7b31bec380175103c47de79c62e9e283be887/backend=imagemagick;height=100;version=1;width=100/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fh%2Fhoshikat%2F20230505%2F20230505010543.png) ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/05/05/013600?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[ 2023-05-05 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/05/05?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[誰ã§ããããStable Diffusion LoRAãäœã£ãŠã¿ãã(å°å
¥ç·š)](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/05/05/013600?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
Stable Diffusionã¯ãã®ãŸãŸã§ãååããããªç»åãæããŠããâŠ
* [ ![誰ã§ããããStable Diffusionããã®6ïŒU-Net\(IN1ãResãããã¯\)](https://cdn.image.st-hatena.com/image/square/1d0b73be31a163a61a8b16a29af99ac4f17a735d/backend=imagemagick;height=100;version=1;width=100/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fh%2Fhoshikat%2F20230331%2F20230331015314.png) ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/04/12/003127?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[ 2023-04-12 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/04/12?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[誰ã§ããããStable Diffusion ãã®6ïŒU-Net(IN1ãResãããã¯)](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/04/12/003127?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
Stable Diffusionã®U-Net解説ã®3åç®ã§ãã ä»åã¯IN1ãããã¯âŠ
* [ ![誰ã§ããããStable diffusionããã®5ïŒU-Net\(IN0ãããã¯ãšç³ã¿èŸŒã¿\)](https://cdn.image.st-hatena.com/image/square/1d0b73be31a163a61a8b16a29af99ac4f17a735d/backend=imagemagick;height=100;version=1;width=100/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fh%2Fhoshikat%2F20230331%2F20230331015314.png) ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/04/03/215537?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[ 2023-04-03 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023/04/03?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[誰ã§ããããStable diffusion ãã®5ïŒU-Net(IN0ãããã¯ãšç³ã¿èŸŒã¿)](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/04/03/215537?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
Stable Diffusionã§äœ¿ãããU-Netã®æåã®ãããã¯ãIN0å±€ã«ã€âŠ
* ãã£ãšèªã
ã³ã¡ã³ããæžã
[ « 誰ã§ããããStable Diffusion LoRAãäœâŠ ](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/06/07/215433?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp) [ AIãçµµæãããããåé¡ ãããŸã§ãšãã⊠» ](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/05/17/183410?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
ãããã£ãŒã«
[ ![id:hoshikat](https://cdn.profile-image.st-
hatena.com/users/hoshikat/profile.png) ](https://hoshikat-hatenablog-
com.translate.goog/about?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp) [id:hoshikat](https://hoshikat-hatenablog-
com.translate.goog/about?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
[ èªè
ã§ã èªè
ãããã èªè
ã«ãªã èªè
ã«ãªã ](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp#)
____
[ãã®ããã°ã«ã€ããŠ](https://hoshikat-hatenablog-
com.translate.goog/about?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
æ€çŽ¢
ãªã³ã¯
* [ã¯ãŠãªããã°](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://hatenablog.com/)
* [ããã°ãã¯ããã](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://hatenablog.com/guide?via%3D200109)
* [é±åã¯ãŠãªããã°](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=http://blog.hatenablog.com)
* [ã¯ãŠãªããã°Pro](https://translate.google.com/website?sl=auto&tl=en&hl=en-US&client=webapp&u=https://hatenablog.com/guide/pro)
[ ææ°èšäº ](https://hoshikat-hatenablog-
com.translate.goog/archive?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
* [誰ã§ããããStable Diffusion ãªãŒãžã§ãã«ããã³ãã](https://hoshikat-hatenablog-com.translate.goog/entry/2023/07/11/004307?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [誰ã§ããããStable Diffusion ã¹ã±ãžã¥ãŒã©ãŒ](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/30/212231?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [誰ã§ããããStable Diffusion CFGã¹ã±ãŒã«ã®ããã¿](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/17/021610?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [誰ã§ããããStable Diffusion ããã¹ããšã³ã³ãŒããŒïŒCLIPã®ããã¿](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/13/002443?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [誰ã§ããããStable Diffusion LoRAãäœã£ãŠã¿ãã(å®è·µç·š)](https://hoshikat-hatenablog-com.translate.goog/entry/2023/06/07/215433?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
[æå¥ã¢ãŒã«ã€ã](https://hoshikat-hatenablog-
com.translate.goog/archive?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
* ⌠â¶
[ 2023 ](https://hoshikat-hatenablog-
com.translate.goog/archive/2023?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp)
* [ 2023 / 7 ](https://hoshikat-hatenablog-com.translate.goog/archive/2023/7?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [ 2023 / 6 ](https://hoshikat-hatenablog-com.translate.goog/archive/2023/6?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [ 2023 / 5 ](https://hoshikat-hatenablog-com.translate.goog/archive/2023/5?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [ 2023 / 4 ](https://hoshikat-hatenablog-com.translate.goog/archive/2023/4?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
* [ 2023 / 3 ](https://hoshikat-hatenablog-com.translate.goog/archive/2023/3?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
![](https://www14.a8.net/0.gif?a8mat=3T8SCR+DG1FLE+2HOM+BS629)
### ã¯ãŠãªããã°ãã¯ããããïŒ
hoshikatããã¯ãã¯ãŠãªããã°ã䜿ã£ãŠããŸããããªããã¯ãŠãªããã°ãã¯ãããŠã¿ãŸãããïŒ
[ã¯ãŠãªããã°ãã¯ãããïŒç¡æïŒ](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://blog.hatena.ne.jp/register?via%3D200227)
[ã¯ãŠãªããã°ãšã¯](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://hatenablog.com/guide)
[ ![人工ç¥èœãšèŠªãããªãããã°](https://cdn.image.st-
hatena.com/image/square/956bbfe235ea19a9079dd050f7013fea30fe3aa5/backend=imagemagick;height=128;version=1;width=128/https%3A%2F%2Fcdn.user.blog.st-
hatena.com%2Fblog_custom_icon%2F159049220%2F1684744907210605) 人工ç¥èœãšèŠªãããªãããã°
](https://hoshikat-hatenablog-
com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
Powered by [Hatena
Blog](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://hatenablog.com/) |
[ããã°ãå ±åãã](https://translate.google.com/website?sl=auto&tl=en&hl=en-
US&client=webapp&u=https://blog.hatena.ne.jp/-/abuse_report?target_url%3Dhttps%253A%252F%252Fhoshikat.hatenablog.com%252Fentry%252F2023%252F05%252F26%252F223229)
__
__
åŒçšãã¹ããã¯ããŸãã
ã¹ããã¯äžèŠ§ãèŠã éãã
åŒçšããã«ã¯ãŸããã°ã€ã³ããŠãã ãã
ãã°ã€ã³ éãã
åŒçšãã¹ããã¯ã§ããŸããã§ãããå床ãè©Šããã ãã
éãã
éå®å
¬éèšäºã®ããåŒçšã§ããŸããã
[ èªè
ã§ã èªè
ãããã èªè
ã«ãªã èªè
ã«ãªã ](https://hoshikat-hatenablog-
com.translate.goog/entry/2023/05/26/223229?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-
US&_x_tr_pto=wapp#)
____
|