Compare commits
687 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab6ec3a9b7 | |||
e252c9ac05 | |||
a212fb35c1 | |||
e59fbac761 | |||
745ea5fb05 | |||
fa16ca4eec | |||
d7757b8b03 | |||
98aefad249 | |||
c17222dbe4 | |||
abd8c69395 | |||
a7fde73df4 | |||
d1c9db874f | |||
82fda5cb03 | |||
65587536ab | |||
ad31be8344 | |||
25815c81bf | |||
852a22f86d | |||
e22b171b7b | |||
842e7e559e | |||
a62ee7850b | |||
d3a90ccc0d | |||
46b13ee664 | |||
cfa6dc7836 | |||
f969bfa7be | |||
e86a883d0a | |||
82d764000a | |||
63dcb8cfe1 | |||
ea7006eec4 | |||
053bce7a8e | |||
2f208832a9 | |||
f08a875cd2 | |||
d492d3f738 | |||
33e25d9241 | |||
fc11018158 | |||
450fb2553c | |||
0b678b1f16 | |||
79b5e85b15 | |||
9f90749f99 | |||
1257e34487 | |||
a45743f443 | |||
cf313939aa | |||
873d4bd3f2 | |||
f43f3fc84b | |||
0e1fed86ba | |||
5c1bbc08ca | |||
6ba32b95f3 | |||
6d43e0951c | |||
1dc2c6f183 | |||
984b8f7e6f | |||
0f8448b2c0 | |||
088c546bee | |||
20fff378f0 | |||
4994a7ac85 | |||
a959c69d32 | |||
39244568be | |||
c8fc0bb4f5 | |||
654ad5c71f | |||
7b9d18caea | |||
8d347efec2 | |||
85de6dd52e | |||
c024b39c8b | |||
1f0db48487 | |||
2bc5f475f4 | |||
5abf4c99de | |||
137e519b66 | |||
dcb27e7de8 | |||
d4d5b5a75c | |||
a83b3f8408 | |||
da9af8673f | |||
1b4ba3b396 | |||
eb2f1cbc9e | |||
28f58f72dd | |||
81389401df | |||
c618c5c5f0 | |||
0eaff4c626 | |||
9783c1052d | |||
f732fa9736 | |||
0c2d227da1 | |||
a281efef04 | |||
538dcec348 | |||
0d38c8ae8f | |||
967c1a2da9 | |||
f3da326b77 | |||
153a6e2cb0 | |||
95f37b9d36 | |||
60c37a1fc7 | |||
615c61e230 | |||
dd7cb74edc | |||
4eed2c7582 | |||
100e830e04 | |||
af28d82ebc | |||
6285980f98 | |||
a5d19cd31f | |||
9c9998b468 | |||
011eb55a53 | |||
d178f3d1b9 | |||
6e9d73ec64 | |||
8d1adf4f80 | |||
d0b7f58e7c | |||
19d24e5644 | |||
461f618b8a | |||
5ff14d1fed | |||
80c9c1bb05 | |||
a111d9b18a | |||
df14913c67 | |||
b6c6fef770 | |||
1a2f37b0ec | |||
6f3c662783 | |||
3772137c8f | |||
1ec95d42ba | |||
338c2243e3 | |||
e8d61225f5 | |||
cc356ce67d | |||
5ee05e3aaa | |||
5568a09f49 | |||
1199c431ff | |||
305f2fa448 | |||
b051685727 | |||
7580bb21c3 | |||
62102236a2 | |||
32d7835119 | |||
726abf6e65 | |||
c154a4bdc8 | |||
5453925e26 | |||
537e314b49 | |||
1696a5c8e1 | |||
816cf8f702 | |||
e8167541af | |||
329360aa5b | |||
eb1a276e60 | |||
a53bac1a94 | |||
93bf93d3a1 | |||
4174c8c25c | |||
48a88a8624 | |||
d17e216f91 | |||
9a71e9ba86 | |||
ef478a4a9e | |||
1bd7d40716 | |||
807e9573fb | |||
3fe2545228 | |||
090dfff730 | |||
f94e9449d5 | |||
d8753adc4e | |||
2e17ea99e2 | |||
c4daf8524e | |||
9d16898926 | |||
f4bcc1f2e5 | |||
63e8614ace | |||
5d686b146d | |||
e85758dc5f | |||
d08f090800 | |||
8554473c21 | |||
01fb1bde8b | |||
29e32ffc42 | |||
88bd60a083 | |||
48b7b725b0 | |||
8d8c932d8c | |||
253d355bd2 | |||
e287df1320 | |||
bae0bec1cc | |||
602686a5d2 | |||
af05d94198 | |||
5fa3a7ca44 | |||
9609350789 | |||
9c1e73ffff | |||
50741c70c0 | |||
083f9dd29b | |||
7d5fabbd25 | |||
105f071847 | |||
48222ce44c | |||
0922ba938c | |||
44191cd908 | |||
b5f6e9d01b | |||
0922349344 | |||
d2d9c2dd0f | |||
4241fb9386 | |||
946dfdf7b8 | |||
4da9843479 | |||
eccb3c643d | |||
bfa5a51ce8 | |||
9066ad6cdf | |||
f7b513dff2 | |||
3de5f10d52 | |||
07429a862c | |||
2f2bddf020 | |||
ad03adaebf | |||
ac7a5488ee | |||
6de93d4fbb | |||
8a312f76c5 | |||
4a956b5a55 | |||
83d6c3ba88 | |||
52daf6b864 | |||
c8420e152f | |||
1dff19af26 | |||
a1e2eca802 | |||
48b63a26c8 | |||
b23bc4a5b6 | |||
b6ef18b0d8 | |||
372484f976 | |||
086cf67e93 | |||
efffca83fe | |||
d2215c2ba9 | |||
89b1b6e242 | |||
e476d68848 | |||
da8835bc77 | |||
f170c2611c | |||
351b17d1d9 | |||
14e88706df | |||
926e3e2712 | |||
c39043fb9d | |||
5b0b582039 | |||
ffe40fa3a3 | |||
03bd9a5731 | |||
cb82170187 | |||
5b9e16af83 | |||
7b1b2a4bef | |||
1f1a0b7b53 | |||
320acfae89 | |||
1c171d0f12 | |||
22bf3618ea | |||
5f1593f4d0 | |||
9af75bf9b2 | |||
344fa729a5 | |||
33d3d90a93 | |||
24dfc09f35 | |||
e533bc0847 | |||
306333ceba | |||
e96312b470 | |||
fb60b4bca7 | |||
0612e4429d | |||
ee80aa26db | |||
a45e667e9c | |||
1b4a2369bb | |||
224483f6ac | |||
c61574b782 | |||
6c71d95932 | |||
e859f5c7a1 | |||
dc402f5f0e | |||
188894c837 | |||
70f99a70a5 | |||
fb4fbd23d8 | |||
f58b2383b9 | |||
05caf1fe28 | |||
704486abc2 | |||
1ec023b435 | |||
fd21eeb477 | |||
edf2b2df6f | |||
9ce338622c | |||
2b35529cbd | |||
2edc06c662 | |||
cb4d66d6fe | |||
f80602b51a | |||
58d8a5ce46 | |||
72a65218be | |||
1b0d5b710e | |||
2a25ac0847 | |||
9aefdf35a1 | |||
231961c017 | |||
ee621fa091 | |||
a69a04cfb6 | |||
b1aed344c7 | |||
3e08d665c7 | |||
4a94c86433 | |||
d4878f6ed3 | |||
d94719ea02 | |||
982b5221b1 | |||
cbdf03450d | |||
7625e591fe | |||
8fdb1e7ec9 | |||
d3b28c42e6 | |||
1b32423881 | |||
7de699c7fa | |||
e9f9670eb5 | |||
3d4e961320 | |||
db2fb33d53 | |||
ff3db04ab7 | |||
c7f6763c48 | |||
b1dd4069db | |||
58c647d433 | |||
333ea4aa53 | |||
3ad59da2a9 | |||
2d9b211eeb | |||
4f5a352985 | |||
6ae3b77c2f | |||
4a7260b1be | |||
f91c77bdc6 | |||
476e938d23 | |||
1ec9d986bb | |||
4b88cfa51a | |||
bc56226a28 | |||
a6e5474fdb | |||
8c7ca2c34d | |||
91fccc6691 | |||
93d1737357 | |||
5ba1ae9ae4 | |||
8cb408bc6e | |||
197a89a37a | |||
d336ead3b1 | |||
662644663e | |||
4c7819effb | |||
8b5b9ee8f1 | |||
89b911a9dc | |||
b673e216b6 | |||
a1b2f0ccf1 | |||
f269facf9d | |||
5a36d280d7 | |||
c39563b123 | |||
548149de8e | |||
d6d4ce0ac4 | |||
83b0239791 | |||
d1fa13d67a | |||
3abd570678 | |||
b0b0781bd7 | |||
1aa28ddee1 | |||
09b50badb1 | |||
7060108a8b | |||
e6f0d5bf44 | |||
399642f958 | |||
781effc34e | |||
324c8f8146 | |||
27e372e38f | |||
87122ce211 | |||
c0c6675423 | |||
fa4aeb5261 | |||
4e51eeb998 | |||
a27c3f09b3 | |||
3e5f117066 | |||
3753fb3ea4 | |||
d3e49cf1e9 | |||
ffcf46a371 | |||
fc5eedbef5 | |||
d78b6c4445 | |||
6e056bb337 | |||
b5c2c1009c | |||
b54029a04a | |||
e30aca7531 | |||
866722b68f | |||
d93f3468d3 | |||
83032e858a | |||
6855e314b3 | |||
2c4a8619a8 | |||
3247d83252 | |||
109ff2d8a5 | |||
48797d12eb | |||
abe66d8af0 | |||
58c9b70b26 | |||
996643bde8 | |||
68dd9a29e8 | |||
68c4b55945 | |||
bab86c9ce2 | |||
5f24e4d705 | |||
66c7b3fcb2 | |||
1ffe29c657 | |||
6b7d4877e6 | |||
80826eb500 | |||
11962facde | |||
c7eccfd804 | |||
ad617e0deb | |||
7ae70d5a4d | |||
62d1a0291e | |||
883dc72fc6 | |||
65b2e9633c | |||
3b923e0d37 | |||
4938cb9bbc | |||
a208564f06 | |||
6c6ca4daf4 | |||
1024da601d | |||
55d05ee590 | |||
66f39e070b | |||
252681001e | |||
a39014b3b1 | |||
10bcfdd6b2 | |||
41ea9814e8 | |||
bccf7e3f69 | |||
06c8a004d8 | |||
4ab90fb14d | |||
54d8feeaf0 | |||
23d20c918f | |||
10012d7125 | |||
d70ea854b1 | |||
8c576ece28 | |||
e0c0935d3a | |||
ab987e73c6 | |||
cec203a6db | |||
cf8bb9efb0 | |||
201a053025 | |||
703f987825 | |||
4e3d677d8e | |||
aab90130d2 | |||
9321dfdd89 | |||
2607ef5fe0 | |||
84b291a57a | |||
3271c5a60b | |||
79bb66f535 | |||
1616885e7f | |||
85045c3e9c | |||
4a85296e23 | |||
4710d18e33 | |||
3da75494b0 | |||
ac021f38da | |||
d0a2c36f6c | |||
9facc9379f | |||
a0f4e2659b | |||
4dfa3d8372 | |||
30563ee04c | |||
3fa7594fcc | |||
deac32d843 | |||
ccfa32ce93 | |||
f05d114f05 | |||
fcb41e30dc | |||
1cdb456216 | |||
5ed6bba412 | |||
50e929eb0c | |||
129839ce21 | |||
fd2961ecb9 | |||
e506d988e2 | |||
196649c0e9 | |||
12182ee04f | |||
5db64526cc | |||
5c2ec70eb4 | |||
24a2c6251f | |||
0d035d9ae9 | |||
a28f1294e2 | |||
a3b0cde59d | |||
c2dec9eac4 | |||
0fdb49f168 | |||
e86d02765f | |||
6e877aea02 | |||
330f1577fd | |||
ff980591c3 | |||
60992ae492 | |||
1b439c15f6 | |||
f58c16ab03 | |||
b560d2953f | |||
2c52c8efb7 | |||
5375166f04 | |||
5e85cae9ce | |||
0ae449fd44 | |||
4f5b4f387a | |||
fcd3c39656 | |||
b4c68a8ae5 | |||
a8d3d613b0 | |||
c680fbe834 | |||
34023f66f0 | |||
2696da7337 | |||
4edbd8719c | |||
ed6c59b58a | |||
553525a0fb | |||
38ebb95e63 | |||
17d92d8b79 | |||
4c08c692ea | |||
286c77778f | |||
10c4bee1e5 | |||
f26b8ee224 | |||
1961567ebd | |||
094687717d | |||
e5844c926b | |||
96ad8c823a | |||
de2977284c | |||
32bafd8b01 | |||
c1dea44fa6 | |||
edb4b9a82e | |||
008b4228d2 | |||
5a105eb2b3 | |||
faf455a37c | |||
7a076f7304 | |||
828a7aabd7 | |||
acbf2a8ab0 | |||
05a4701d98 | |||
6a19b333b7 | |||
864fc84899 | |||
cddd62c284 | |||
30c46c0858 | |||
396e54bad0 | |||
a2b9ee5988 | |||
fac8e8aa8b | |||
a821b309f7 | |||
bd2b627113 | |||
3c3711b933 | |||
926ffefac8 | |||
986b303f2f | |||
afd8717c21 | |||
6effd783c0 | |||
b8f47545ed | |||
a10c4f7a34 | |||
939dd0b207 | |||
defabf4324 | |||
a6394b2dce | |||
5ba802dc68 | |||
b652d0fc65 | |||
e67843638f | |||
ca704e1d51 | |||
04eb356c89 | |||
300159c03b | |||
f083b816a9 | |||
2a46f6b225 | |||
b3e9b266fa | |||
76c72c1a7f | |||
1c1cf58409 | |||
8155e3ef7a | |||
d9fa2c4a62 | |||
547e640b57 | |||
e107037011 | |||
62048c68f0 | |||
489aae7a46 | |||
1bcb6738bb | |||
d14a13fcaf | |||
5facba4419 | |||
f32df2ac9c | |||
22a0b3be45 | |||
b4282a03ca | |||
3490d0d743 | |||
688659b815 | |||
37cf9eb587 | |||
65b2da4db5 | |||
2cecb11847 | |||
fbe829def7 | |||
a39e0a19cd | |||
50d805abbc | |||
b7467b466f | |||
3048a26e6f | |||
0175d7658e | |||
5eee528d6b | |||
4a431ddc7c | |||
ebda485bcb | |||
f9bb55bc5c | |||
5d207f36e6 | |||
6fc9098035 | |||
215c3d82e2 | |||
86d0feed32 | |||
53674b03fc | |||
102e454902 | |||
88d59eb7fa | |||
53ebd583cf | |||
a1914f5079 | |||
5231eb62e1 | |||
661cf440f3 | |||
3822058daf | |||
011f283067 | |||
4f58a485a6 | |||
0c96510128 | |||
ecf7860847 | |||
161eea3e9e | |||
27e2699fa1 | |||
d243bf069e | |||
dde3d5c35b | |||
d1e792686e | |||
62fe380520 | |||
319f08c4c9 | |||
657129e4a7 | |||
5bbef09f85 | |||
342f5e5e41 | |||
8d21ee23f4 | |||
5e7c376950 | |||
7617d56276 | |||
80e4b33047 | |||
4f6287c163 | |||
84ee1a2d25 | |||
67252e0c6b | |||
4264c2e266 | |||
0efa4ffb23 | |||
0d13fe67b0 | |||
af3de448bd | |||
fcb2f1b555 | |||
c1bcf9fa8a | |||
5ddfe7a184 | |||
a0c6e9e490 | |||
56960d6da9 | |||
7ee00230fd | |||
bc8c7285da | |||
12e6baa925 | |||
2590dc690e | |||
e2545b3d34 | |||
bf4d920fb4 | |||
d84fb244d3 | |||
f04b5244fa | |||
6f3829fa91 | |||
a5ae3545d5 | |||
63b658ac50 | |||
e8544be30a | |||
39090451f0 | |||
12fc6e6354 | |||
154326061d | |||
0bbfd574b3 | |||
eff3887f35 | |||
34cb532e6b | |||
cf1d1a97f3 | |||
e0a4f0bc4c | |||
1ac8eba1b8 | |||
82f8c31b81 | |||
9f2ae75fa2 | |||
9d220c482d | |||
c4718bd302 | |||
e1e2a90498 | |||
40a48954c3 | |||
e81068f528 | |||
0591487cfd | |||
737ed7ba5d | |||
27fd1f39f0 | |||
1210313e7f | |||
4733c8fb75 | |||
8777e65996 | |||
330fa10935 | |||
1bd4a0f4ee | |||
bea8ae55de | |||
b99cd49091 | |||
35f3b70968 | |||
e33f3231d0 | |||
b6cf6ee94a | |||
6118518b1b | |||
f77d5ebfd2 | |||
fcf5c41709 | |||
7f3279f20f | |||
c23de50f3e | |||
51f1759323 | |||
cedc634933 | |||
c7b89a1126 | |||
bad015de9a | |||
21057759de | |||
d027352d79 | |||
fd8c568d75 | |||
85292ca1b4 | |||
1ab90e76d1 | |||
1e9e9daeb3 | |||
65682a8130 | |||
bca225e692 | |||
4fbc46b3b3 | |||
4b3806fb9a | |||
5abbec94c4 | |||
346d1dddba | |||
8b48ad77e8 | |||
64d97a3232 | |||
94a208bd91 | |||
b15ac8b13e | |||
0ddff9d551 | |||
7c31dbb3d6 | |||
6ee995afaa | |||
691acb647e | |||
80d9d88de1 | |||
cf12abfc7f | |||
b21ec7a302 | |||
972473f1af | |||
ee8e0b46a2 | |||
1c3d270402 | |||
9d09d2042a | |||
b8823ade29 | |||
0e5b01f897 | |||
87f221290f | |||
fd3b0c20b6 | |||
93e71027fd | |||
c6852c70fd | |||
953773aaa8 | |||
e0a139d083 | |||
867140df30 | |||
8a354e6187 | |||
5337153761 | |||
6afd4b0dc7 | |||
e2517ef50e | |||
ad6798eaad | |||
2a5fcc0846 | |||
37592a876e | |||
4979e176c7 | |||
f3fdac2762 | |||
9a67617cef | |||
96e43cbb65 | |||
458dc5b232 | |||
28a7c6d3aa | |||
d3c241d283 | |||
445959abbd | |||
62842968cb | |||
2dda683aa6 | |||
616167e08c | |||
acd74c60c8 | |||
c1c4a2933e | |||
8158ead1a2 | |||
fcc196f452 | |||
d55e2492d4 | |||
45e05b0891 | |||
eb53739c95 | |||
4a35059711 | |||
a1ad1147e6 | |||
eefa7d53c5 | |||
716491a68e | |||
29e5263fcc | |||
4df61d7efc | |||
34aa60d47b | |||
704d545159 |
@ -13,12 +13,11 @@ If you would like to contribute to this project, there is a discord for dicussio
|
|||||||
This is in-flux, but one way to get a development environment running for editing the UI of this project is:
|
This is in-flux, but one way to get a development environment running for editing the UI of this project is:
|
||||||
(swap `.sh` or `.bat` in instructions depending on your environment, and be sure to adjust any paths to match where you're working)
|
(swap `.sh` or `.bat` in instructions depending on your environment, and be sure to adjust any paths to match where you're working)
|
||||||
|
|
||||||
1) `git clone` the repository, e.g. to `/projects/stable-diffusion-ui-repo`
|
1) Install the project to a new location using the [usual installation process](https://github.com/cmdr2/stable-diffusion-ui#installation), e.g. to `/projects/stable-diffusion-ui-archive`
|
||||||
2) Download the pre-built end user archive from the link on github, and extract it, e.g. to `/projects/stable-diffusion-ui-archive`
|
2) Start the newly installed project, and check that you can view and generate images on `localhost:9000`
|
||||||
3) `cd /projects/stable-diffusion-ui-archive` and run the script to set up and start the project, e.g. `start.sh`
|
3) Next, please clone the project repository using `git clone` (e.g. to `/projects/stable-diffusion-ui-repo`)
|
||||||
4) Check you can view and generate images on `localhost:9000`
|
4) Close the server (started in step 2), and edit `/projects/stable-diffusion-ui-archive/scripts/on_env_start.sh` (or `on_env_start.bat`)
|
||||||
5) Close the server, and edit `/projects/stable-diffusion-ui-archive/scripts/on_env_start.sh`
|
5) Comment out the lines near the bottom that copies the `files/ui` folder, e.g:
|
||||||
6) Comment out the lines near the bottom that copies the `files/ui` folder, e.g:
|
|
||||||
|
|
||||||
for `.sh`
|
for `.sh`
|
||||||
```
|
```
|
||||||
@ -33,13 +32,13 @@ REM @xcopy sd-ui-files\ui ui /s /i /Y
|
|||||||
REM @copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y
|
REM @copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y
|
||||||
REM @copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y
|
REM @copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y
|
||||||
```
|
```
|
||||||
7) Comment out the line at the top of `/projects/stable-diffusion-ui-archive/scripts/on_sd_start.sh` that copies `on_env_start`. For e.g. `@copy sd-ui-files\scripts\on_env_start.bat scripts\ /Y`
|
6) Next, comment out the line at the top of `/projects/stable-diffusion-ui-archive/scripts/on_sd_start.sh` (or `on_sd_start.bat`) that copies `on_env_start`. For e.g. `@rem @copy sd-ui-files\scripts\on_env_start.bat scripts\ /Y`
|
||||||
8) Delete the current `ui` folder at `/projects/stable-diffusion-ui-archive/ui`
|
8) Delete the current `ui` folder at `/projects/stable-diffusion-ui-archive/ui`
|
||||||
9) Now make a symlink between the repository clone (where you will be making changes) and this archive (where you will be running stable diffusion):
|
9) Now make a symlink between the repository clone (where you will be making changes) and this archive (where you will be running stable diffusion):
|
||||||
`ln -s /projects/stable-diffusion-ui-repo/ui /projects/stable-diffusion-ui-archive/ui`
|
`ln -s /projects/stable-diffusion-ui-repo/ui /projects/stable-diffusion-ui-archive/ui`
|
||||||
or for Windows
|
or for Windows
|
||||||
`mklink /D \projects\stable-diffusion-ui-archive\ui \projects\stable-diffusion-ui-repo\ui` (link name first, source repo dir second)
|
`mklink /J \projects\stable-diffusion-ui-archive\ui \projects\stable-diffusion-ui-repo\ui` (link name first, source repo dir second)
|
||||||
9) Run the archive again `start.sh` and ensure you can still use the UI.
|
9) Run the project again (like in step 2) and ensure you can still use the UI.
|
||||||
10) Congrats, now any changes you make in your repo `ui` folder are linked to this running archive of the app and can be previewed in the browser.
|
10) Congrats, now any changes you make in your repo `ui` folder are linked to this running archive of the app and can be previewed in the browser.
|
||||||
|
|
||||||
Check the `ui/frontend/build/README.md` for instructions on running and building the React code.
|
Check the `ui/frontend/build/README.md` for instructions on running and building the React code.
|
||||||
@ -47,9 +46,5 @@ Check the `ui/frontend/build/README.md` for instructions on running and building
|
|||||||
## Development environment for Installer changes
|
## Development environment for Installer changes
|
||||||
Build the Windows installer using Windows, and the Linux installer using Linux. Don't mix the two, and don't use WSL. An Ubuntu VM is fine for building the Linux installer on a Windows host.
|
Build the Windows installer using Windows, and the Linux installer using Linux. Don't mix the two, and don't use WSL. An Ubuntu VM is fine for building the Linux installer on a Windows host.
|
||||||
|
|
||||||
1. Install Miniconda 3 or Anaconda.
|
1. Run `build.bat` or `./build.sh` depending on whether you're in Windows or Linux.
|
||||||
2. Install `conda install -c conda-forge -y conda-pack`
|
2. Make a new GitHub release and upload the Windows and Linux installer builds created inside the `dist` folder.
|
||||||
3. Open the Anaconda Prompt. Do not use WSL if you're building for Windows.
|
|
||||||
4. Run `build.bat` or `./build.sh` depending on whether you're in Windows or Linux.
|
|
||||||
5. Compress the `stable-diffusion-ui` folder created inside the `dist` folder. Make a `zip` for Windows, and `tar.xz` for Linux (smaller files, and Linux users already have tar).
|
|
||||||
6. Make a new GitHub release and upload the Windows and Linux installer builds.
|
|
||||||
|
114
README.md
@ -1,41 +1,77 @@
|
|||||||
# Stable Diffusion UI v2
|
# Stable Diffusion UI
|
||||||
### A simple 1-click way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. No dependencies or technical knowledge required.
|
### Easiest way to install and use [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on your own computer. No dependencies or technical knowledge required. 1-click install, powerful features.
|
||||||
|
|
||||||
|
[](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md)
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
## Step 1: Download the installer
|
||||||
|
|
||||||
<p float="left">
|
<p float="left">
|
||||||
<a href="#installation"><img src="https://github.com/cmdr2/stable-diffusion-ui/raw/develop/media/download-win.png" width="200" /></a>
|
<a href="#installation"><img src="https://github.com/cmdr2/stable-diffusion-ui/raw/develop/media/download-win.png" width="200" /></a>
|
||||||
<a href="#installation"><img src="https://github.com/cmdr2/stable-diffusion-ui/raw/develop/media/download-linux.png" width="200" /></a>
|
<a href="#installation"><img src="https://github.com/cmdr2/stable-diffusion-ui/raw/develop/media/download-linux.png" width="200" /></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md)
|
## Step 2: Run the program
|
||||||
|
- On Windows: Double-click `Start Stable Diffusion UI.cmd`
|
||||||
|
- On Linux: Run `./start.sh` in a terminal
|
||||||
|
|
||||||
️🔥🎉 **New!** Live Preview, More Samplers, In-Painting, Face Correction (GFPGAN) and Upscaling (RealESRGAN) have been added!
|
## Step 3: There is no step 3!
|
||||||
|
It's simple to get started. You don't need to install or struggle with Python, Anaconda, Docker etc.
|
||||||
|
|
||||||
This distribution currently uses Stable Diffusion 1.4. Once the model for 1.5 becomes publicly available, the model in this distribution will be updated.
|
The installer will take care of whatever is needed. A friendly [Discord community](https://discord.com/invite/u9yhsFmEkB) will help you if you face any problems.
|
||||||
|
|
||||||
# Features in the new v2 Version:
|
----
|
||||||
|
|
||||||
|
# Easy for new users, powerful features for advanced users
|
||||||
|
### Features:
|
||||||
- **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run!
|
- **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run!
|
||||||
- **Face Correction (GFPGAN) and Upscaling (RealESRGAN)**
|
- **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features
|
||||||
- **In-Painting**
|
|
||||||
- **Live Preview**: See the image as the AI is drawing it
|
|
||||||
- **Lots of Samplers**
|
|
||||||
- **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly.
|
|
||||||
- **New UI**: with cleaner design
|
|
||||||
- Supports "*Text to Image*" and "*Image to Image*"
|
- Supports "*Text to Image*" and "*Image to Image*"
|
||||||
|
- **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder!
|
||||||
|
- **Live Preview**: See the image as the AI is drawing it
|
||||||
|
- **Task Queue**: Queue up all your ideas, without waiting for the current task to finish
|
||||||
|
- **In-Painting**: Specify areas of your image to paint into
|
||||||
|
- **Face Correction (GFPGAN) and Upscaling (RealESRGAN)**
|
||||||
|
- **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly.
|
||||||
|
- **Loopback**: Use the output image as the input image for the next img2img task
|
||||||
|
- **Negative Prompt**: Specify aspects of the image to *remove*.
|
||||||
|
- **Attention/Emphasis:** () in the prompt increases the model's attention to enclosed words, and [] decreases it
|
||||||
|
- **Weighted Prompts:** Use weights for specific words in your prompt to change their importance, e.g. `red:2.4 dragon:1.2`
|
||||||
|
- **Prompt Matrix:** (in beta) Quickly create multiple variations of your prompt, e.g. `a photograph of an astronaut riding a horse | illustration | cinematic lighting`
|
||||||
|
- **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms
|
||||||
|
- **Multiple Prompts File:** Queue multiple prompts by entering one prompt per line, or by running a text file
|
||||||
- **NSFW Setting**: A setting in the UI to control *NSFW content*
|
- **NSFW Setting**: A setting in the UI to control *NSFW content*
|
||||||
|
- **JPEG/PNG output**
|
||||||
|
- **Save generated images to disk**
|
||||||
- **Use CPU setting**: If you don't have a compatible graphics card, but still want to run it on your CPU.
|
- **Use CPU setting**: If you don't have a compatible graphics card, but still want to run it on your CPU.
|
||||||
- **Auto-updater**: Gets you the latest improvements and bug-fixes to a rapidly evolving project.
|
- **Auto-updater**: Gets you the latest improvements and bug-fixes to a rapidly evolving project.
|
||||||
- **Low Memory Usage**: Creates 512x512 images with less than 4GB of VRAM!
|
- **Low Memory Usage**: Creates 512x512 images with less than 4GB of VRAM!
|
||||||
|
- **Developer Console**: A developer-mode for those who want to modify their Stable Diffusion code, and edit the conda environment.
|
||||||
|
|
||||||

|
### Easy for new users:
|
||||||
|

|
||||||
|
|
||||||
|
### Powerful features for advanced users:
|
||||||
|

|
||||||
|
|
||||||
|
### Live Preview
|
||||||
|
Useful for judging (and stopping) an image quickly, without waiting for it to finish rendering.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Task Queue
|
||||||
|

|
||||||
|
|
||||||
# System Requirements
|
# System Requirements
|
||||||
1. Windows 10/11, or Linux. Experimental support for Mac is coming soon.
|
1. Windows 10/11, or Linux. Experimental support for Mac is coming soon.
|
||||||
2. An NVIDIA graphics card, preferably with 6GB or more of VRAM. But if you don't have a compatible graphics card, you can still use it with a "Use CPU" setting. It'll be very slow, but it should still work.
|
2. An NVIDIA graphics card, preferably with 4GB or more of VRAM. If you don't have a compatible graphics card, it'll automatically run in the slower "CPU Mode".
|
||||||
|
3. Minimum 8 GB of RAM and 25GB of disk space.
|
||||||
|
|
||||||
You do not need anything else. You do not need WSL, Docker or Conda. The installer will take care of it.
|
You don't need to install or struggle with Python, Anaconda, Docker etc. The installer will take care of whatever is needed.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
1. **Download** [for Windows](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.05/stable-diffusion-ui-win64.zip) or [for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.05/stable-diffusion-ui-linux.tar.xz).
|
1. **Download** [for Windows](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.3.5/stable-diffusion-ui-windows.zip) or [for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.3.5/stable-diffusion-ui-linux.zip).
|
||||||
|
|
||||||
2. **Extract**:
|
2. **Extract**:
|
||||||
- For Windows: After unzipping the file, please move the `stable-diffusion-ui` folder to your `C:` (or any drive like D:, at the top root level), e.g. `C:\stable-diffusion-ui`. This will avoid a common problem with Windows (file path length limits).
|
- For Windows: After unzipping the file, please move the `stable-diffusion-ui` folder to your `C:` (or any drive like D:, at the top root level), e.g. `C:\stable-diffusion-ui`. This will avoid a common problem with Windows (file path length limits).
|
||||||
@ -49,47 +85,19 @@ This will automatically install Stable Diffusion, set it up, and start the inter
|
|||||||
|
|
||||||
**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages.
|
**To Uninstall:** Just delete the `stable-diffusion-ui` folder to uninstall all the downloaded packages.
|
||||||
|
|
||||||
|
# How to use?
|
||||||
# Usage
|
Please use our [guide](https://github.com/cmdr2/stable-diffusion-ui/wiki/How-to-Use) to understand how to use the features in this UI.
|
||||||
Open http://localhost:9000 in your browser (after running step 3 previously). It may take a few moments for the back-end to be ready.
|
|
||||||
|
|
||||||
## With a text description
|
|
||||||
1. Enter a text prompt, like `a photograph of an astronaut riding a horse` in the textbox.
|
|
||||||
2. Press `Make Image`. This will take some time, depending on your system's processing power.
|
|
||||||
3. See the image generated using your prompt.
|
|
||||||
|
|
||||||
## With an image
|
|
||||||
1. Click `Browse..` next to `Initial Image`. Select your desired image.
|
|
||||||
2. An optional text prompt can help you further describe the kind of image you want to generate.
|
|
||||||
3. Press `Make Image`. See the image generated using your prompt.
|
|
||||||
|
|
||||||
You can use Face Correction or Upscaling to improve the image further.
|
|
||||||
|
|
||||||
**Pro tip:** You can also click `Use as Input` on a generated image, to use it as the input image for your next generation. This can be useful for sequentially refining the generated image with a single click.
|
|
||||||
|
|
||||||
**Another tip:** Images with the same aspect ratio of your generated image work best. E.g. 1:1 if you're generating images sized 512x512.
|
|
||||||
|
|
||||||
## Problems? Troubleshooting
|
|
||||||
Please try the common [troubleshooting](Troubleshooting.md) steps. If that doesn't fix it, please ask on the [discord server](https://discord.com/invite/u9yhsFmEkB), or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues).
|
|
||||||
|
|
||||||
# Advanced Settings
|
|
||||||
You can also set the configuration like `seed`, `width`, `height`, `num_outputs`, `num_inference_steps` and `guidance_scale` using the 'show' button next to 'Advanced settings'.
|
|
||||||
|
|
||||||
Use the same `seed` number to get the same image for a certain prompt. This is useful for refining a prompt without losing the basic image design. Enable the `random images` checkbox to get random images.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# What is this? Why no Docker?
|
|
||||||
This version is a 1-click installer. You don't need WSL or Docker or anything beyond a working NVIDIA GPU with an updated driver. You don't need to use the command-line at all. Even if you don't have a compatible GPU, you can run it on your CPU (albeit very slowly).
|
|
||||||
|
|
||||||
It'll download the necessary files from the original [Stable Diffusion](https://github.com/CompVis/stable-diffusion) git repository, and set it up. It'll then start the browser-based interface like before.
|
|
||||||
|
|
||||||
The NSFW option is currently off (temporarily), so it'll allow NSFW images, for those people who are unable to run their prompts without hitting the NSFW filter incorrectly.
|
|
||||||
|
|
||||||
# Bugs reports and code contributions welcome
|
# Bugs reports and code contributions welcome
|
||||||
If there are any problems or suggestions, please feel free to ask on the [discord server](https://discord.com/invite/u9yhsFmEkB) or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues).
|
If there are any problems or suggestions, please feel free to ask on the [discord server](https://discord.com/invite/u9yhsFmEkB) or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues).
|
||||||
|
|
||||||
Also, please feel free to submit a pull request, if you have any code contributions in mind. Join the [discord server](https://discord.com/invite/u9yhsFmEkB) for development-related discussions, and for helping other users.
|
We could really use help on these aspects (click to view tasks that need your help):
|
||||||
|
* [User Interface](https://github.com/users/cmdr2/projects/1/views/1)
|
||||||
|
* [Engine](https://github.com/users/cmdr2/projects/3/views/1)
|
||||||
|
* [Installer](https://github.com/users/cmdr2/projects/4/views/1)
|
||||||
|
* [Documentation](https://github.com/users/cmdr2/projects/5/views/1)
|
||||||
|
|
||||||
|
If you have any code contributions in mind, please feel free to say Hi to us on the [discord server](https://discord.com/invite/u9yhsFmEkB). We use the Discord server for development-related discussions, and for helping users.
|
||||||
|
|
||||||
# Disclaimer
|
# Disclaimer
|
||||||
The authors of this project are not responsible for any content generated using this interface.
|
The authors of this project are not responsible for any content generated using this interface.
|
||||||
|
@ -1,46 +1 @@
|
|||||||
Common issues and their solutions. If these solutions don't work, please feel free to ask at the [discord server](https://discord.com/invite/u9yhsFmEkB) or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues).
|
Moved to https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting
|
||||||
|
|
||||||
## RuntimeError: CUDA out of memory
|
|
||||||
This can happen if your PC has less than 6GB of VRAM.
|
|
||||||
|
|
||||||
Try disabling the "Turbo mode" setting under "Advanced Settings", since that takes an additional 1 GB of VRAM (to increase the speed).
|
|
||||||
|
|
||||||
Additionally, a common reason for this error is that you're using an initial image larger than 768x768 pixels. Try using a smaller initial image.
|
|
||||||
|
|
||||||
Also try generating smaller sized images.
|
|
||||||
|
|
||||||
## No ldm found, or antlr4 or any other missing module, or ClobberError: This transaction has incompatible packages due to a shared path
|
|
||||||
On Windows, please ensure that you had placed the `stable-diffusion-ui` folder after unzipping to the root of C: or D: (or any drive). For e.g. `C:\stable-diffusion-ui`. **Note:** This has to be done **before** you start the installation process. If you have already installed (and are facing this error), please delete the installed folder, and start fresh by unzipping and placing the folder at the top of your drive.
|
|
||||||
|
|
||||||
This error can also be caused if you already have conda/miniconda/anaconda installed, due to package conflicts. Please open your Anaconda Prompt, and run `conda clean --all` to clean up unused packages.
|
|
||||||
|
|
||||||
If nothing works, this could be due to a corrupted installation. Please try reinstalling this, by deleting the installed folder, and unzipping from the downloaded zip file.
|
|
||||||
|
|
||||||
## Killed uvicorn server:app --app-dir ... --port 9000 --host 0.0.0.0
|
|
||||||
This happens if your PC ran out of RAM. Stable Diffusion requires a lot of RAM, and requires atleast 10 GB of RAM to work well. You can also try closing all other applications before running Stable Diffusion UI.
|
|
||||||
|
|
||||||
## Green image generated
|
|
||||||
This usually happens if you're running NVIDIA 1650 or 1660 Super. To solve this, please close and run the Stable Diffusion command on your computer. If you're using the older Docker-based solution (v1), please upgrade to v2: https://github.com/cmdr2/stable-diffusion-ui/tree/v2#installation
|
|
||||||
|
|
||||||
If you're still seeing this error, please try enabling "Full Precision" under "Advanced Settings" in the Stable Diffusion UI.
|
|
||||||
|
|
||||||
## './docker-compose.yml' is invalid:
|
|
||||||
> ERROR: The Compose file './docker-compose.yml' is invalid because:
|
|
||||||
> services.stability-ai.deploy.resources.reservations value Additional properties are not allowed ('devices' was unexpected)
|
|
||||||
|
|
||||||
Please ensure you have `docker-compose` version 1.29 or higher. Check `docker-compose --version`, and if required [update it to 1.29](https://docs.docker.com/compose/install/). (Thanks [HVRyan](https://github.com/HVRyan))
|
|
||||||
|
|
||||||
## RuntimeError: Found no NVIDIA driver on your system:
|
|
||||||
If you have an NVIDIA GPU and the latest [NVIDIA driver](http://www.nvidia.com/Download/index.aspx), please ensure that you've installed [nvidia-container-toolkit](https://stackoverflow.com/a/58432877). (Thanks [u/exintrovert420](https://www.reddit.com/user/exintrovert420/))
|
|
||||||
|
|
||||||
## Some other process is already running at port 9000 / port 9000 could not be bound
|
|
||||||
You can override the port used. Please change `docker-compose.yml` inside the project directory, and update the line `9000:9000` to `1337:9000` (where 1337 is whichever port number you want).
|
|
||||||
|
|
||||||
After doing this, please restart your server, by running `./server restart`.
|
|
||||||
|
|
||||||
After this, you can access the server at `http://localhost:1337` (where 1337 is the new port you specified earlier).
|
|
||||||
|
|
||||||
## RuntimeError: CUDA error: unknown error
|
|
||||||
Please ensure that you have an NVIDIA GPU and the latest [NVIDIA driver](http://www.nvidia.com/Download/index.aspx), and that you've installed [nvidia-container-toolkit](https://stackoverflow.com/a/58432877).
|
|
||||||
|
|
||||||
Also, if you are using WSL (Windows), please ensure you have the latest WSL kernel by running `wsl --shutdown` and then `wsl --update`. (Thanks [AndrWeisR](https://github.com/AndrWeisR))
|
|
||||||
|
58
build.bat
@ -8,42 +8,40 @@
|
|||||||
set /p answer=Are you a developer of this project (Y/N)?
|
set /p answer=Are you a developer of this project (Y/N)?
|
||||||
if /i "%answer:~,1%" NEQ "Y" exit /b
|
if /i "%answer:~,1%" NEQ "Y" exit /b
|
||||||
|
|
||||||
@mkdir dist\stable-diffusion-ui
|
mkdir dist\win\stable-diffusion-ui\scripts
|
||||||
|
@REM mkdir dist\linux-mac\stable-diffusion-ui\scripts
|
||||||
|
|
||||||
@echo "Downloading components for the installer.."
|
@rem copy the installer files for Windows
|
||||||
|
|
||||||
@call conda env create --prefix installer -f environment.yaml
|
copy scripts\on_env_start.bat dist\win\stable-diffusion-ui\scripts\
|
||||||
@call conda activate .\installer
|
copy scripts\bootstrap.bat dist\win\stable-diffusion-ui\scripts\
|
||||||
|
copy "scripts\Start Stable Diffusion UI.cmd" dist\win\stable-diffusion-ui\
|
||||||
|
copy LICENSE dist\win\stable-diffusion-ui\
|
||||||
|
copy "CreativeML Open RAIL-M License" dist\win\stable-diffusion-ui\
|
||||||
|
copy "How to install and run.txt" dist\win\stable-diffusion-ui\
|
||||||
|
echo. > dist\win\stable-diffusion-ui\scripts\install_status.txt
|
||||||
|
|
||||||
@echo "Setting up startup scripts.."
|
@rem copy the installer files for Linux and Mac
|
||||||
|
|
||||||
@mkdir installer\etc\conda\activate.d
|
@REM copy scripts\on_env_start.sh dist\linux-mac\stable-diffusion-ui\scripts\
|
||||||
@copy scripts\post_activate.bat installer\etc\conda\activate.d\
|
@REM copy scripts\bootstrap.sh dist\linux-mac\stable-diffusion-ui\scripts\
|
||||||
|
@REM copy scripts\start.sh dist\linux-mac\stable-diffusion-ui\
|
||||||
|
@REM copy LICENSE dist\linux-mac\stable-diffusion-ui\
|
||||||
|
@REM copy "CreativeML Open RAIL-M License" dist\linux-mac\stable-diffusion-ui\
|
||||||
|
@REM copy "How to install and run.txt" dist\linux-mac\stable-diffusion-ui\
|
||||||
|
@REM echo. > dist\linux-mac\stable-diffusion-ui\scripts\install_status.txt
|
||||||
|
|
||||||
@echo "Creating a distributable package.."
|
@rem make the zip
|
||||||
|
|
||||||
@call conda install -c conda-forge -y conda-pack
|
cd dist\win
|
||||||
@call conda pack --n-threads -1 --prefix installer --format tar
|
call powershell Compress-Archive -Path stable-diffusion-ui -DestinationPath ..\stable-diffusion-ui-windows.zip
|
||||||
|
cd ..\..
|
||||||
|
|
||||||
@cd dist\stable-diffusion-ui
|
@REM cd dist\linux-mac
|
||||||
@mkdir installer
|
@REM call powershell Compress-Archive -Path stable-diffusion-ui -DestinationPath ..\stable-diffusion-ui-linux.zip
|
||||||
|
@REM call powershell Compress-Archive -Path stable-diffusion-ui -DestinationPath ..\stable-diffusion-ui-mac.zip
|
||||||
|
@REM cd ..\..
|
||||||
|
|
||||||
@call tar -xf ..\..\installer.tar -C installer
|
echo "Build ready. Upload the zip files inside the 'dist' folder."
|
||||||
|
|
||||||
@mkdir scripts
|
pause
|
||||||
|
|
||||||
@copy ..\..\scripts\on_env_start.bat scripts\
|
|
||||||
@copy "..\..\scripts\Start Stable Diffusion UI.cmd" .
|
|
||||||
@copy ..\..\LICENSE .
|
|
||||||
@copy "..\..\CreativeML Open RAIL-M License" .
|
|
||||||
@copy "..\..\How to install and run.txt" .
|
|
||||||
|
|
||||||
@echo "Build ready. Zip the 'dist\stable-diffusion-ui' folder."
|
|
||||||
|
|
||||||
@echo "Cleaning up.."
|
|
||||||
|
|
||||||
@cd ..\..
|
|
||||||
|
|
||||||
@rmdir /s /q installer
|
|
||||||
|
|
||||||
@del installer.tar
|
|
||||||
|
57
build.sh
@ -11,42 +11,39 @@ case $yn in
|
|||||||
* ) exit;;
|
* ) exit;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
mkdir -p dist/stable-diffusion-ui
|
# mkdir -p dist/win/stable-diffusion-ui/scripts
|
||||||
|
mkdir -p dist/linux-mac/stable-diffusion-ui/scripts
|
||||||
|
|
||||||
echo "Downloading components for the installer.."
|
# copy the installer files for Windows
|
||||||
|
|
||||||
source ~/miniconda3/etc/profile.d/conda.sh
|
# cp scripts/on_env_start.bat dist/win/stable-diffusion-ui/scripts/
|
||||||
|
# cp scripts/bootstrap.bat dist/win/stable-diffusion-ui/scripts/
|
||||||
|
# cp "scripts/Start Stable Diffusion UI.cmd" dist/win/stable-diffusion-ui/
|
||||||
|
# cp LICENSE dist/win/stable-diffusion-ui/
|
||||||
|
# cp "CreativeML Open RAIL-M License" dist/win/stable-diffusion-ui/
|
||||||
|
# cp "How to install and run.txt" dist/win/stable-diffusion-ui/
|
||||||
|
# echo "" > dist/win/stable-diffusion-ui/scripts/install_status.txt
|
||||||
|
|
||||||
conda install -c conda-forge -y conda-pack
|
# copy the installer files for Linux and Mac
|
||||||
|
|
||||||
conda env create --prefix installer -f environment.yaml
|
cp scripts/on_env_start.sh dist/linux-mac/stable-diffusion-ui/scripts/
|
||||||
conda activate ./installer
|
cp scripts/bootstrap.sh dist/linux-mac/stable-diffusion-ui/scripts/
|
||||||
|
cp scripts/functions.sh dist/linux-mac/stable-diffusion-ui/scripts/
|
||||||
|
cp scripts/start.sh dist/linux-mac/stable-diffusion-ui/
|
||||||
|
cp LICENSE dist/linux-mac/stable-diffusion-ui/
|
||||||
|
cp "CreativeML Open RAIL-M License" dist/linux-mac/stable-diffusion-ui/
|
||||||
|
cp "How to install and run.txt" dist/linux-mac/stable-diffusion-ui/
|
||||||
|
echo "" > dist/linux-mac/stable-diffusion-ui/scripts/install_status.txt
|
||||||
|
|
||||||
echo "Creating a distributable package.."
|
# make the zip
|
||||||
|
|
||||||
conda pack --n-threads -1 --prefix installer --format tar
|
# cd dist/win
|
||||||
|
# zip -r ../stable-diffusion-ui-windows.zip stable-diffusion-ui
|
||||||
cd dist/stable-diffusion-ui
|
# cd ../..
|
||||||
mkdir installer
|
|
||||||
|
|
||||||
tar -xf ../../installer.tar -C installer
|
|
||||||
|
|
||||||
mkdir scripts
|
|
||||||
|
|
||||||
cp ../../scripts/on_env_start.sh scripts/
|
|
||||||
cp ../../scripts/start.sh .
|
|
||||||
cp ../../LICENSE .
|
|
||||||
cp "../../CreativeML Open RAIL-M License" .
|
|
||||||
cp "../../How to install and run.txt" .
|
|
||||||
|
|
||||||
chmod u+x start.sh
|
|
||||||
|
|
||||||
echo "Build ready. Zip the 'dist/stable-diffusion-ui' folder."
|
|
||||||
|
|
||||||
echo "Cleaning up.."
|
|
||||||
|
|
||||||
|
cd dist/linux-mac
|
||||||
|
zip -r ../stable-diffusion-ui-linux.zip stable-diffusion-ui
|
||||||
|
zip -r ../stable-diffusion-ui-mac.zip stable-diffusion-ui
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
rm -rf installer
|
echo "Build ready. Upload the zip files inside the 'dist' folder."
|
||||||
|
|
||||||
rm installer.tar
|
|
||||||
|
BIN
media/config-v6.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
media/config-v7.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
media/modifiers-v1.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
media/shot-v10-simple.jpg
Normal file
After Width: | Height: | Size: 139 KiB |
BIN
media/shot-v10.jpg
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
media/shot-v9.jpg
Normal file
After Width: | Height: | Size: 199 KiB |
BIN
media/system-settings-v2.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
media/task-queue-v1.jpg
Normal file
After Width: | Height: | Size: 155 KiB |
34
scripts/Developer Console.cmd
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
echo "Opening Stable Diffusion UI - Developer Console.." & echo.
|
||||||
|
|
||||||
|
set PATH=C:\Windows\System32;%PATH%
|
||||||
|
|
||||||
|
@rem set legacy and new installer's PATH, if they exist
|
||||||
|
if exist "installer" set PATH=%cd%\installer;%cd%\installer\Library\bin;%cd%\installer\Scripts;%cd%\installer\Library\usr\bin;%PATH%
|
||||||
|
if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_files\env\Library\bin;%cd%\installer_files\env\Scripts;%cd%\installer_files\Library\usr\bin;%PATH%
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%\installer;%cd%\installer_files\env
|
||||||
|
|
||||||
|
@rem activate the installer env
|
||||||
|
call conda activate
|
||||||
|
|
||||||
|
@rem Test the environment
|
||||||
|
echo "Environment Info:"
|
||||||
|
call where git
|
||||||
|
call git --version
|
||||||
|
|
||||||
|
call where conda
|
||||||
|
call conda --version
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
|
@rem activate the environment
|
||||||
|
call conda activate .\stable-diffusion\env
|
||||||
|
|
||||||
|
call where python
|
||||||
|
call python --version
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cmd /k
|
@ -1 +1,27 @@
|
|||||||
installer\Scripts\activate.bat
|
@echo off
|
||||||
|
|
||||||
|
cd /d %~dp0
|
||||||
|
set PATH=C:\Windows\System32;%PATH%
|
||||||
|
|
||||||
|
@rem set legacy installer's PATH, if it exists
|
||||||
|
if exist "installer" set PATH=%cd%\installer;%cd%\installer\Library\bin;%cd%\installer\Scripts;%cd%\installer\Library\usr\bin;%PATH%
|
||||||
|
|
||||||
|
@rem Setup the packages required for the installer
|
||||||
|
call scripts\bootstrap.bat
|
||||||
|
|
||||||
|
@rem set new installer's PATH, if it downloaded any packages
|
||||||
|
if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_files\env\Library\bin;%cd%\installer_files\env\Scripts;%cd%\installer_files\Library\usr\bin;%PATH%
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%\installer;%cd%\installer_files\env
|
||||||
|
|
||||||
|
@rem Test the bootstrap
|
||||||
|
call where git
|
||||||
|
call git --version
|
||||||
|
|
||||||
|
call where conda
|
||||||
|
call conda --version
|
||||||
|
|
||||||
|
@rem Download the rest of the installer and UI
|
||||||
|
call scripts\on_env_start.bat
|
||||||
|
|
||||||
|
@pause
|
||||||
|
77
scripts/bootstrap.bat
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
@rem This script will install git and conda (if not found on the PATH variable)
|
||||||
|
@rem using micromamba (an 8mb static-linked single-file binary, conda replacement).
|
||||||
|
@rem For users who already have git and conda, this step will be skipped.
|
||||||
|
|
||||||
|
@rem This enables a user to install this project without manually installing conda and git.
|
||||||
|
|
||||||
|
@rem config
|
||||||
|
set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba
|
||||||
|
set INSTALL_ENV_DIR=%cd%\installer_files\env
|
||||||
|
set LEGACY_INSTALL_ENV_DIR=%cd%\installer
|
||||||
|
set MICROMAMBA_DOWNLOAD_URL=https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe
|
||||||
|
set umamba_exists=F
|
||||||
|
|
||||||
|
set OLD_APPDATA=%APPDATA%
|
||||||
|
set OLD_USERPROFILE=%USERPROFILE%
|
||||||
|
set APPDATA=%cd%\installer_files\appdata
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
|
||||||
|
@rem figure out whether git and conda needs to be installed
|
||||||
|
if exist "%INSTALL_ENV_DIR%" set PATH=%INSTALL_ENV_DIR%;%INSTALL_ENV_DIR%\Library\bin;%INSTALL_ENV_DIR%\Scripts;%INSTALL_ENV_DIR%\Library\usr\bin;%PATH%
|
||||||
|
|
||||||
|
set PACKAGES_TO_INSTALL=
|
||||||
|
|
||||||
|
if not exist "%LEGACY_INSTALL_ENV_DIR%\etc\profile.d\conda.sh" (
|
||||||
|
if not exist "%INSTALL_ENV_DIR%\etc\profile.d\conda.sh" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% conda
|
||||||
|
)
|
||||||
|
|
||||||
|
call git --version >.tmp1 2>.tmp2
|
||||||
|
if "%ERRORLEVEL%" NEQ "0" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% git
|
||||||
|
|
||||||
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version >.tmp1 2>.tmp2
|
||||||
|
if "%ERRORLEVEL%" EQU "0" set umamba_exists=T
|
||||||
|
|
||||||
|
@rem (if necessary) install git and conda into a contained environment
|
||||||
|
if "%PACKAGES_TO_INSTALL%" NEQ "" (
|
||||||
|
@rem download micromamba
|
||||||
|
if "%umamba_exists%" == "F" (
|
||||||
|
echo "Downloading micromamba from %MICROMAMBA_DOWNLOAD_URL% to %MAMBA_ROOT_PREFIX%\micromamba.exe"
|
||||||
|
|
||||||
|
mkdir "%MAMBA_ROOT_PREFIX%"
|
||||||
|
call curl -Lk "%MICROMAMBA_DOWNLOAD_URL%" > "%MAMBA_ROOT_PREFIX%\micromamba.exe"
|
||||||
|
|
||||||
|
@REM if "%ERRORLEVEL%" NEQ "0" (
|
||||||
|
@REM echo "There was a problem downloading micromamba. Cannot continue."
|
||||||
|
@REM pause
|
||||||
|
@REM exit /b
|
||||||
|
@REM )
|
||||||
|
|
||||||
|
mkdir "%APPDATA%"
|
||||||
|
mkdir "%USERPROFILE%"
|
||||||
|
|
||||||
|
@rem test the mamba binary
|
||||||
|
echo Micromamba version:
|
||||||
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version
|
||||||
|
)
|
||||||
|
|
||||||
|
@rem create the installer env
|
||||||
|
if not exist "%INSTALL_ENV_DIR%" (
|
||||||
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" create -y --prefix "%INSTALL_ENV_DIR%"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Packages to install:%PACKAGES_TO_INSTALL%"
|
||||||
|
|
||||||
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" install -y --prefix "%INSTALL_ENV_DIR%" -c conda-forge %PACKAGES_TO_INSTALL%
|
||||||
|
|
||||||
|
if not exist "%INSTALL_ENV_DIR%" (
|
||||||
|
echo "There was a problem while installing%PACKAGES_TO_INSTALL% using micromamba. Cannot continue."
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
@rem revert to the old APPDATA. only needed it for bypassing a bug in micromamba (with special characters)
|
||||||
|
set APPDATA=%OLD_APPDATA%
|
||||||
|
set USERPROFILE=%OLD_USERPROFILE%
|
86
scripts/bootstrap.sh
Executable file
@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script will install git and conda (if not found on the PATH variable)
|
||||||
|
# using micromamba (an 8mb static-linked single-file binary, conda replacement).
|
||||||
|
# For users who already have git and conda, this step will be skipped.
|
||||||
|
|
||||||
|
# This enables a user to install this project without manually installing conda and git.
|
||||||
|
|
||||||
|
source ./scripts/functions.sh
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
OS_NAME=$(uname -s)
|
||||||
|
case "${OS_NAME}" in
|
||||||
|
Linux*) OS_NAME="linux";;
|
||||||
|
Darwin*) OS_NAME="osx";;
|
||||||
|
*) echo "Unknown OS: $OS_NAME! This script runs only on Linux or Mac" && exit
|
||||||
|
esac
|
||||||
|
|
||||||
|
OS_ARCH=$(uname -m)
|
||||||
|
case "${OS_ARCH}" in
|
||||||
|
x86_64*) OS_ARCH="64";;
|
||||||
|
arm64*) OS_ARCH="arm64";;
|
||||||
|
*) echo "Unknown system architecture: $OS_ARCH! This script runs only on x86_64 or arm64" && exit
|
||||||
|
esac
|
||||||
|
|
||||||
|
# https://mamba.readthedocs.io/en/latest/installation.html
|
||||||
|
if [ "$OS_NAME" == "linux" ] && [ "$OS_ARCH" == "arm64" ]; then OS_ARCH="aarch64"; fi
|
||||||
|
|
||||||
|
# config
|
||||||
|
export MAMBA_ROOT_PREFIX="$(pwd)/installer_files/mamba"
|
||||||
|
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
|
||||||
|
LEGACY_INSTALL_ENV_DIR="$(pwd)/installer"
|
||||||
|
MICROMAMBA_DOWNLOAD_URL="https://micro.mamba.pm/api/micromamba/${OS_NAME}-${OS_ARCH}/latest"
|
||||||
|
umamba_exists="F"
|
||||||
|
|
||||||
|
# figure out whether git and conda needs to be installed
|
||||||
|
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
|
||||||
|
|
||||||
|
PACKAGES_TO_INSTALL=""
|
||||||
|
|
||||||
|
if [ ! -e "$LEGACY_INSTALL_ENV_DIR/etc/profile.d/conda.sh" ] && [ ! -e "$INSTALL_ENV_DIR/etc/profile.d/conda.sh" ]; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL conda"; fi
|
||||||
|
if ! hash "git" &>/dev/null; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL git"; fi
|
||||||
|
|
||||||
|
if "$MAMBA_ROOT_PREFIX/micromamba" --version &>/dev/null; then umamba_exists="T"; fi
|
||||||
|
|
||||||
|
# (if necessary) install git and conda into a contained environment
|
||||||
|
if [ "$PACKAGES_TO_INSTALL" != "" ]; then
|
||||||
|
# download micromamba
|
||||||
|
if [ "$umamba_exists" == "F" ]; then
|
||||||
|
echo "Downloading micromamba from $MICROMAMBA_DOWNLOAD_URL to $MAMBA_ROOT_PREFIX/micromamba"
|
||||||
|
|
||||||
|
mkdir -p "$MAMBA_ROOT_PREFIX"
|
||||||
|
curl -L "$MICROMAMBA_DOWNLOAD_URL" | tar -xvj bin/micromamba -O > "$MAMBA_ROOT_PREFIX/micromamba"
|
||||||
|
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
echo
|
||||||
|
echo "EE micromamba download failed"
|
||||||
|
echo "EE If the lines above contain 'bzip2: Cannot exec', your system doesn't have bzip2 installed"
|
||||||
|
echo "EE If there are network errors, please check your internet setup"
|
||||||
|
fail "micromamba download failed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod u+x "$MAMBA_ROOT_PREFIX/micromamba"
|
||||||
|
|
||||||
|
# test the mamba binary
|
||||||
|
echo "Micromamba version:"
|
||||||
|
"$MAMBA_ROOT_PREFIX/micromamba" --version
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create the installer env
|
||||||
|
if [ ! -e "$INSTALL_ENV_DIR" ]; then
|
||||||
|
"$MAMBA_ROOT_PREFIX/micromamba" create -y --prefix "$INSTALL_ENV_DIR" || fail "unable to create the install environment"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$INSTALL_ENV_DIR" ]; then
|
||||||
|
fail "There was a problem while installing$PACKAGES_TO_INSTALL using micromamba. Cannot continue."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Packages to install:$PACKAGES_TO_INSTALL"
|
||||||
|
|
||||||
|
"$MAMBA_ROOT_PREFIX/micromamba" install -y --prefix "$INSTALL_ENV_DIR" -c conda-forge $PACKAGES_TO_INSTALL
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
fail "Installation of the packages '$PACKAGES_TO_INSTALL' failed."
|
||||||
|
fi
|
||||||
|
fi
|
42
scripts/developer_console.sh
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
if [ "$0" == "bash" ]; then
|
||||||
|
echo "Opening Stable Diffusion UI - Developer Console.."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# set legacy and new installer's PATH, if they exist
|
||||||
|
if [ -e "installer" ]; then export PATH="$(pwd)/installer/bin:$PATH"; fi
|
||||||
|
if [ -e "installer_files/env" ]; then export PATH="$(pwd)/installer_files/env/bin:$PATH"; fi
|
||||||
|
|
||||||
|
# activate the installer env
|
||||||
|
CONDA_BASEPATH=$(conda info --base)
|
||||||
|
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error
|
||||||
|
|
||||||
|
conda activate
|
||||||
|
|
||||||
|
# test the environment
|
||||||
|
echo "Environment Info:"
|
||||||
|
which git
|
||||||
|
git --version
|
||||||
|
|
||||||
|
which conda
|
||||||
|
conda --version
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# activate the environment
|
||||||
|
CONDA_BASEPATH=$(conda info --base)
|
||||||
|
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains about 'shell not initialized' (needed when running in a script)
|
||||||
|
|
||||||
|
conda activate ./stable-diffusion/env
|
||||||
|
|
||||||
|
which python
|
||||||
|
python --version
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
file_name=$(basename "${BASH_SOURCE[0]}")
|
||||||
|
bash --init-file "$file_name"
|
||||||
|
fi
|
32
scripts/functions.sh
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# utility functions for all scripts
|
||||||
|
#
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
echo
|
||||||
|
echo "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
|
||||||
|
echo
|
||||||
|
if [ "$1" != "" ]; then
|
||||||
|
echo ERROR: $1
|
||||||
|
else
|
||||||
|
echo An error occurred.
|
||||||
|
fi
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Error downloading Stable Diffusion UI. Sorry about that, please try to:
|
||||||
|
1. Run this installer again.
|
||||||
|
2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting
|
||||||
|
3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB
|
||||||
|
4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues
|
||||||
|
|
||||||
|
Thanks!
|
||||||
|
|
||||||
|
|
||||||
|
EOF
|
||||||
|
read -p "Press any key to continue"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
set PATH=C:\Windows\System32;%PATH%
|
set PATH=C:\Windows\System32;%PATH%
|
||||||
|
|
||||||
@cd ..
|
|
||||||
|
|
||||||
if exist "scripts\config.bat" (
|
if exist "scripts\config.bat" (
|
||||||
@call scripts\config.bat
|
@call scripts\config.bat
|
||||||
)
|
)
|
||||||
@ -14,7 +12,7 @@ if "%update_branch%"=="" (
|
|||||||
set update_branch=main
|
set update_branch=main
|
||||||
)
|
)
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_ui_deps_installed" scripts\install_status.txt
|
@>nul findstr /m "conda_sd_ui_deps_installed" scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" NEQ "0" (
|
@if "%ERRORLEVEL%" NEQ "0" (
|
||||||
for /f "tokens=*" %%a in ('python -c "import os; parts = os.getcwd().split(os.path.sep); print(len(parts))"') do if "%%a" NEQ "2" (
|
for /f "tokens=*" %%a in ('python -c "import os; parts = os.getcwd().split(os.path.sep); print(len(parts))"') do if "%%a" NEQ "2" (
|
||||||
echo. & echo "!!!! WARNING !!!!" & echo.
|
echo. & echo "!!!! WARNING !!!!" & echo.
|
||||||
@ -28,14 +26,14 @@ if "%update_branch%"=="" (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@>nul grep -c "sd_ui_git_cloned" scripts\install_status.txt
|
@>nul findstr /m "sd_ui_git_cloned" scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
@echo "Stable Diffusion UI's git repository was already installed. Updating from %update_branch%.."
|
@echo "Stable Diffusion UI's git repository was already installed. Updating from %update_branch%.."
|
||||||
|
|
||||||
@cd sd-ui-files
|
@cd sd-ui-files
|
||||||
|
|
||||||
@call git reset --hard
|
@call git reset --hard
|
||||||
@call git checkout "%update_branch%"
|
@call git -c advice.detachedHead=false checkout "%update_branch%"
|
||||||
@call git pull
|
@call git pull
|
||||||
|
|
||||||
@cd ..
|
@cd ..
|
||||||
@ -46,7 +44,7 @@ if "%update_branch%"=="" (
|
|||||||
@call git clone -b "%update_branch%" https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files && (
|
@call git clone -b "%update_branch%" https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files && (
|
||||||
@echo sd_ui_git_cloned >> scripts\install_status.txt
|
@echo sd_ui_git_cloned >> scripts\install_status.txt
|
||||||
) || (
|
) || (
|
||||||
@echo "Error downloading Stable Diffusion UI. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
@echo "Error downloading Stable Diffusion UI. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
||||||
pause
|
pause
|
||||||
@exit /b
|
@exit /b
|
||||||
)
|
)
|
||||||
@ -54,8 +52,10 @@ if "%update_branch%"=="" (
|
|||||||
|
|
||||||
@xcopy sd-ui-files\ui ui /s /i /Y
|
@xcopy sd-ui-files\ui ui /s /i /Y
|
||||||
@copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y
|
@copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y
|
||||||
|
@copy sd-ui-files\scripts\bootstrap.bat scripts\ /Y
|
||||||
@copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y
|
@copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y
|
||||||
|
@copy "sd-ui-files\scripts\Developer Console.cmd" . /Y
|
||||||
|
|
||||||
@call scripts\on_sd_start.bat
|
@call scripts\on_sd_start.bat
|
||||||
|
|
||||||
@pause
|
@pause
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./scripts/functions.sh
|
||||||
|
|
||||||
printf "\n\nStable Diffusion UI\n\n"
|
printf "\n\nStable Diffusion UI\n\n"
|
||||||
|
|
||||||
if [ -f "scripts/config.sh" ]; then
|
if [ -f "scripts/config.sh" ]; then
|
||||||
@ -16,7 +18,7 @@ if [ -f "scripts/install_status.txt" ] && [ `grep -c sd_ui_git_cloned scripts/in
|
|||||||
cd sd-ui-files
|
cd sd-ui-files
|
||||||
|
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git checkout "$update_branch"
|
git -c advice.detachedHead=false checkout "$update_branch"
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
@ -27,16 +29,16 @@ else
|
|||||||
if git clone -b "$update_branch" https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files ; then
|
if git clone -b "$update_branch" https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files ; then
|
||||||
echo sd_ui_git_cloned >> scripts/install_status.txt
|
echo sd_ui_git_cloned >> scripts/install_status.txt
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading Stable Diffusion UI. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "git clone failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf ui
|
rm -rf ui
|
||||||
cp -Rf sd-ui-files/ui .
|
cp -Rf sd-ui-files/ui .
|
||||||
cp sd-ui-files/scripts/on_sd_start.sh scripts/
|
cp sd-ui-files/scripts/on_sd_start.sh scripts/
|
||||||
|
cp sd-ui-files/scripts/bootstrap.sh scripts/
|
||||||
cp sd-ui-files/scripts/start.sh .
|
cp sd-ui-files/scripts/start.sh .
|
||||||
|
cp sd-ui-files/scripts/developer_console.sh .
|
||||||
|
|
||||||
./scripts/on_sd_start.sh
|
./scripts/on_sd_start.sh
|
||||||
|
|
||||||
|
@ -1,13 +1,24 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
@copy sd-ui-files\scripts\on_env_start.bat scripts\ /Y
|
@copy sd-ui-files\scripts\on_env_start.bat scripts\ /Y
|
||||||
|
@copy sd-ui-files\scripts\bootstrap.bat scripts\ /Y
|
||||||
|
|
||||||
|
if exist "%cd%\profile" (
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
)
|
||||||
|
|
||||||
|
@rem activate the installer env
|
||||||
|
call conda activate
|
||||||
|
|
||||||
@REM Caution, this file will make your eyes and brain bleed. It's such an unholy mess.
|
@REM Caution, this file will make your eyes and brain bleed. It's such an unholy mess.
|
||||||
@REM Note to self: Please rewrite this in Python. For the sake of your own sanity.
|
@REM Note to self: Please rewrite this in Python. For the sake of your own sanity.
|
||||||
|
|
||||||
|
@REM remove the old version of the dev console script, if it's still present
|
||||||
|
if exist "Open Developer Console.cmd" del "Open Developer Console.cmd"
|
||||||
|
|
||||||
@call python -c "import os; import shutil; frm = 'sd-ui-files\\ui\\hotfix\\9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'; dst = os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'transformers', '9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'); shutil.copyfile(frm, dst) if os.path.exists(dst) else print(''); print('Hotfixed broken JSON file from OpenAI');"
|
@call python -c "import os; import shutil; frm = 'sd-ui-files\\ui\\hotfix\\9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'; dst = os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'transformers', '9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'); shutil.copyfile(frm, dst) if os.path.exists(dst) else print(''); print('Hotfixed broken JSON file from OpenAI');"
|
||||||
|
|
||||||
@>nul grep -c "sd_git_cloned" scripts\install_status.txt
|
@>nul findstr /m "sd_git_cloned" scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
@echo "Stable Diffusion's git repository was already installed. Updating.."
|
@echo "Stable Diffusion's git repository was already installed. Updating.."
|
||||||
|
|
||||||
@ -15,7 +26,7 @@
|
|||||||
|
|
||||||
@call git reset --hard
|
@call git reset --hard
|
||||||
@call git pull
|
@call git pull
|
||||||
@call git checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
@call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
||||||
|
|
||||||
@call git apply ..\ui\sd_internal\ddim_callback.patch
|
@call git apply ..\ui\sd_internal\ddim_callback.patch
|
||||||
@call git apply ..\ui\sd_internal\env_yaml.patch
|
@call git apply ..\ui\sd_internal\env_yaml.patch
|
||||||
@ -27,13 +38,13 @@
|
|||||||
@call git clone https://github.com/basujindal/stable-diffusion.git && (
|
@call git clone https://github.com/basujindal/stable-diffusion.git && (
|
||||||
@echo sd_git_cloned >> scripts\install_status.txt
|
@echo sd_git_cloned >> scripts\install_status.txt
|
||||||
) || (
|
) || (
|
||||||
@echo "Error downloading Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
@echo "Error downloading Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
||||||
pause
|
pause
|
||||||
@exit /b
|
@exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
@cd stable-diffusion
|
@cd stable-diffusion
|
||||||
@call git checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
@call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
||||||
|
|
||||||
@call git apply ..\ui\sd_internal\ddim_callback.patch
|
@call git apply ..\ui\sd_internal\ddim_callback.patch
|
||||||
@call git apply ..\ui\sd_internal\env_yaml.patch
|
@call git apply ..\ui\sd_internal\env_yaml.patch
|
||||||
@ -43,7 +54,7 @@
|
|||||||
|
|
||||||
@cd stable-diffusion
|
@cd stable-diffusion
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_env_created" ..\scripts\install_status.txt
|
@>nul findstr /m "conda_sd_env_created" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
@echo "Packages necessary for Stable Diffusion were already installed"
|
@echo "Packages necessary for Stable Diffusion were already installed"
|
||||||
|
|
||||||
@ -56,8 +67,14 @@
|
|||||||
@REM prevent conda from using packages from the user's home directory, to avoid conflicts
|
@REM prevent conda from using packages from the user's home directory, to avoid conflicts
|
||||||
@set PYTHONNOUSERSITE=1
|
@set PYTHONNOUSERSITE=1
|
||||||
|
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
set TMP=%cd%\tmp
|
||||||
|
set TEMP=%cd%\tmp
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%;%cd%\env\lib\site-packages
|
||||||
|
|
||||||
@call conda env create --prefix env -f environment.yaml || (
|
@call conda env create --prefix env -f environment.yaml || (
|
||||||
@echo. & echo "Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -65,13 +82,13 @@
|
|||||||
@call conda activate .\env
|
@call conda activate .\env
|
||||||
|
|
||||||
@call conda install -c conda-forge -y --prefix env antlr4-python3-runtime=4.8 || (
|
@call conda install -c conda-forge -y --prefix env antlr4-python3-runtime=4.8 || (
|
||||||
@echo. & echo "Error installing antlr4-python3-runtime for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error installing antlr4-python3-runtime for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
for /f "tokens=*" %%a in ('python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"') do if "%%a" NEQ "42" (
|
for /f "tokens=*" %%a in ('python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"') do if "%%a" NEQ "42" (
|
||||||
@echo. & echo "Dependency test failed! Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Dependency test failed! Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -81,7 +98,7 @@
|
|||||||
|
|
||||||
set PATH=C:\Windows\System32;%PATH%
|
set PATH=C:\Windows\System32;%PATH%
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_gfpgan_deps_installed" ..\scripts\install_status.txt
|
@>nul findstr /m "conda_sd_gfpgan_deps_installed" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
@echo "Packages necessary for GFPGAN (Face Correction) were already installed"
|
@echo "Packages necessary for GFPGAN (Face Correction) were already installed"
|
||||||
) else (
|
) else (
|
||||||
@ -89,20 +106,26 @@ set PATH=C:\Windows\System32;%PATH%
|
|||||||
|
|
||||||
@set PYTHONNOUSERSITE=1
|
@set PYTHONNOUSERSITE=1
|
||||||
|
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
set TMP=%cd%\tmp
|
||||||
|
set TEMP=%cd%\tmp
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%;%cd%\env\lib\site-packages
|
||||||
|
|
||||||
@call pip install -e git+https://github.com/TencentARC/GFPGAN#egg=GFPGAN || (
|
@call pip install -e git+https://github.com/TencentARC/GFPGAN#egg=GFPGAN || (
|
||||||
@echo. & echo "Error installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
@call pip install basicsr==1.4.2 || (
|
@call pip install basicsr==1.4.2 || (
|
||||||
@echo. & echo "Error installing the basicsr package necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error installing the basicsr package necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
for /f "tokens=*" %%a in ('python -c "from gfpgan import GFPGANer; print(42)"') do if "%%a" NEQ "42" (
|
for /f "tokens=*" %%a in ('python -c "from gfpgan import GFPGANer; print(42)"') do if "%%a" NEQ "42" (
|
||||||
@echo. & echo "Dependency test failed! Error installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Dependency test failed! Error installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -110,7 +133,7 @@ set PATH=C:\Windows\System32;%PATH%
|
|||||||
@echo conda_sd_gfpgan_deps_installed >> ..\scripts\install_status.txt
|
@echo conda_sd_gfpgan_deps_installed >> ..\scripts\install_status.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_esrgan_deps_installed" ..\scripts\install_status.txt
|
@>nul findstr /m "conda_sd_esrgan_deps_installed" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
@echo "Packages necessary for ESRGAN (Resolution Upscaling) were already installed"
|
@echo "Packages necessary for ESRGAN (Resolution Upscaling) were already installed"
|
||||||
) else (
|
) else (
|
||||||
@ -118,14 +141,20 @@ set PATH=C:\Windows\System32;%PATH%
|
|||||||
|
|
||||||
@set PYTHONNOUSERSITE=1
|
@set PYTHONNOUSERSITE=1
|
||||||
|
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
set TMP=%cd%\tmp
|
||||||
|
set TEMP=%cd%\tmp
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%;%cd%\env\lib\site-packages
|
||||||
|
|
||||||
@call pip install -e git+https://github.com/xinntao/Real-ESRGAN#egg=realesrgan || (
|
@call pip install -e git+https://github.com/xinntao/Real-ESRGAN#egg=realesrgan || (
|
||||||
@echo. & echo "Error installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
for /f "tokens=*" %%a in ('python -c "from basicsr.archs.rrdbnet_arch import RRDBNet; from realesrgan import RealESRGANer; print(42)"') do if "%%a" NEQ "42" (
|
for /f "tokens=*" %%a in ('python -c "from basicsr.archs.rrdbnet_arch import RRDBNet; from realesrgan import RealESRGANer; print(42)"') do if "%%a" NEQ "42" (
|
||||||
@echo. & echo "Dependency test failed! Error installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Dependency test failed! Error installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -133,7 +162,7 @@ set PATH=C:\Windows\System32;%PATH%
|
|||||||
@echo conda_sd_esrgan_deps_installed >> ..\scripts\install_status.txt
|
@echo conda_sd_esrgan_deps_installed >> ..\scripts\install_status.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_ui_deps_installed" ..\scripts\install_status.txt
|
@>nul findstr /m "conda_sd_ui_deps_installed" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" EQU "0" (
|
@if "%ERRORLEVEL%" EQU "0" (
|
||||||
echo "Packages necessary for Stable Diffusion UI were already installed"
|
echo "Packages necessary for Stable Diffusion UI were already installed"
|
||||||
) else (
|
) else (
|
||||||
@ -141,37 +170,46 @@ set PATH=C:\Windows\System32;%PATH%
|
|||||||
|
|
||||||
@set PYTHONNOUSERSITE=1
|
@set PYTHONNOUSERSITE=1
|
||||||
|
|
||||||
|
set USERPROFILE=%cd%\profile
|
||||||
|
set TMP=%cd%\tmp
|
||||||
|
set TEMP=%cd%\tmp
|
||||||
|
|
||||||
|
set PYTHONPATH=%cd%;%cd%\env\lib\site-packages
|
||||||
|
|
||||||
@call conda install -c conda-forge -y --prefix env uvicorn fastapi || (
|
@call conda install -c conda-forge -y --prefix env uvicorn fastapi || (
|
||||||
echo "Error installing the packages necessary for Stable Diffusion UI. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
echo "Error installing the packages necessary for Stable Diffusion UI. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!"
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
call WHERE uvicorn > .tmp
|
call WHERE uvicorn > .tmp
|
||||||
@>nul grep -c "uvicorn" .tmp
|
@>nul findstr /m "uvicorn" .tmp
|
||||||
@if "%ERRORLEVEL%" NEQ "0" (
|
@if "%ERRORLEVEL%" NEQ "0" (
|
||||||
@echo. & echo "UI packages not found! Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "UI packages not found! Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
@>nul grep -c "conda_sd_ui_deps_installed" ..\scripts\install_status.txt
|
@>nul findstr /m "conda_sd_ui_deps_installed" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" NEQ "0" (
|
@if "%ERRORLEVEL%" NEQ "0" (
|
||||||
@echo conda_sd_ui_deps_installed >> ..\scripts\install_status.txt
|
@echo conda_sd_ui_deps_installed >> ..\scripts\install_status.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if not exist "..\models\stable-diffusion" mkdir "..\models\stable-diffusion"
|
||||||
|
echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt"
|
||||||
|
|
||||||
@if exist "sd-v1-4.ckpt" (
|
@if exist "sd-v1-4.ckpt" (
|
||||||
for %%I in ("sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" (
|
for %%I in ("sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" (
|
||||||
echo "Data files (weights) necessary for Stable Diffusion were already downloaded"
|
echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the HuggingFace 4 GB Model."
|
||||||
) else (
|
) else (
|
||||||
for %%J in ("sd-v1-4.ckpt") do if "%%~zJ" EQU "7703807346" (
|
for %%J in ("sd-v1-4.ckpt") do if "%%~zJ" EQU "7703807346" (
|
||||||
echo "Data files (weights) necessary for Stable Diffusion were already downloaded"
|
echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the HuggingFace 7 GB Model."
|
||||||
) else (
|
) else (
|
||||||
for %%K in ("sd-v1-4.ckpt") do if "%%~zK" EQU "7703810927" (
|
for %%K in ("sd-v1-4.ckpt") do if "%%~zK" EQU "7703810927" (
|
||||||
echo "Data files (weights) necessary for Stable Diffusion were already downloaded"
|
echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the Waifu Model."
|
||||||
) else (
|
) else (
|
||||||
echo. & echo "The model file present at %cd%\sd-v1-4.ckpt is invalid. It is only %%~zK bytes in size. Re-downloading.." & echo.
|
echo. & echo "The model file present at %cd%\sd-v1-4.ckpt is invalid. It is only %%~zK bytes in size. Re-downloading.." & echo.
|
||||||
del "sd-v1-4.ckpt"
|
del "sd-v1-4.ckpt"
|
||||||
@ -188,12 +226,12 @@ call WHERE uvicorn > .tmp
|
|||||||
@if exist "sd-v1-4.ckpt" (
|
@if exist "sd-v1-4.ckpt" (
|
||||||
for %%I in ("sd-v1-4.ckpt") do if "%%~zI" NEQ "4265380512" (
|
for %%I in ("sd-v1-4.ckpt") do if "%%~zI" NEQ "4265380512" (
|
||||||
echo. & echo "Error: The downloaded model file was invalid! Bytes downloaded: %%~zI" & echo.
|
echo. & echo "Error: The downloaded model file was invalid! Bytes downloaded: %%~zI" & echo.
|
||||||
echo. & echo "Error downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
echo. & echo "Error downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
@echo. & echo "Error downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -218,12 +256,12 @@ call WHERE uvicorn > .tmp
|
|||||||
@if exist "GFPGANv1.3.pth" (
|
@if exist "GFPGANv1.3.pth" (
|
||||||
for %%I in ("GFPGANv1.3.pth") do if "%%~zI" NEQ "348632874" (
|
for %%I in ("GFPGANv1.3.pth") do if "%%~zI" NEQ "348632874" (
|
||||||
echo. & echo "Error: The downloaded GFPGAN model file was invalid! Bytes downloaded: %%~zI" & echo.
|
echo. & echo "Error: The downloaded GFPGAN model file was invalid! Bytes downloaded: %%~zI" & echo.
|
||||||
echo. & echo "Error downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
echo. & echo "Error downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
@echo. & echo "Error downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -248,12 +286,12 @@ call WHERE uvicorn > .tmp
|
|||||||
@if exist "RealESRGAN_x4plus.pth" (
|
@if exist "RealESRGAN_x4plus.pth" (
|
||||||
for %%I in ("RealESRGAN_x4plus.pth") do if "%%~zI" NEQ "67040989" (
|
for %%I in ("RealESRGAN_x4plus.pth") do if "%%~zI" NEQ "67040989" (
|
||||||
echo. & echo "Error: The downloaded ESRGAN x4plus model file was invalid! Bytes downloaded: %%~zI" & echo.
|
echo. & echo "Error: The downloaded ESRGAN x4plus model file was invalid! Bytes downloaded: %%~zI" & echo.
|
||||||
echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
@echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -278,12 +316,12 @@ call WHERE uvicorn > .tmp
|
|||||||
@if exist "RealESRGAN_x4plus_anime_6B.pth" (
|
@if exist "RealESRGAN_x4plus_anime_6B.pth" (
|
||||||
for %%I in ("RealESRGAN_x4plus_anime_6B.pth") do if "%%~zI" NEQ "17938799" (
|
for %%I in ("RealESRGAN_x4plus_anime_6B.pth") do if "%%~zI" NEQ "17938799" (
|
||||||
echo. & echo "Error: The downloaded ESRGAN x4plus_anime model file was invalid! Bytes downloaded: %%~zI" & echo.
|
echo. & echo "Error: The downloaded ESRGAN x4plus_anime model file was invalid! Bytes downloaded: %%~zI" & echo.
|
||||||
echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
@echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
@echo. & echo "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -291,7 +329,7 @@ call WHERE uvicorn > .tmp
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@>nul grep -c "sd_install_complete" ..\scripts\install_status.txt
|
@>nul findstr /m "sd_install_complete" ..\scripts\install_status.txt
|
||||||
@if "%ERRORLEVEL%" NEQ "0" (
|
@if "%ERRORLEVEL%" NEQ "0" (
|
||||||
@echo sd_weights_downloaded >> ..\scripts\install_status.txt
|
@echo sd_weights_downloaded >> ..\scripts\install_status.txt
|
||||||
@echo sd_install_complete >> ..\scripts\install_status.txt
|
@echo sd_install_complete >> ..\scripts\install_status.txt
|
||||||
@ -306,12 +344,16 @@ call WHERE uvicorn > .tmp
|
|||||||
@cd ..\..\..
|
@cd ..\..\..
|
||||||
@echo PYTHONPATH=%PYTHONPATH%
|
@echo PYTHONPATH=%PYTHONPATH%
|
||||||
|
|
||||||
|
call where python
|
||||||
|
call python --version
|
||||||
|
|
||||||
@cd ..
|
@cd ..
|
||||||
@set SD_UI_PATH=%cd%\ui
|
@set SD_UI_PATH=%cd%\ui
|
||||||
@cd stable-diffusion
|
@cd stable-diffusion
|
||||||
|
|
||||||
@call python --version
|
@if NOT DEFINED SD_UI_BIND_PORT set SD_UI_BIND_PORT=9000
|
||||||
|
@if NOT DEFINED SD_UI_BIND_IP set SD_UI_BIND_IP=0.0.0.0
|
||||||
|
@uvicorn server:app --app-dir "%SD_UI_PATH%" --port %SD_UI_BIND_PORT% --host %SD_UI_BIND_IP%
|
||||||
|
|
||||||
@uvicorn server:app --app-dir "%SD_UI_PATH%" --port 9000 --host 0.0.0.0
|
|
||||||
|
|
||||||
@pause
|
@pause
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./scripts/functions.sh
|
||||||
|
|
||||||
cp sd-ui-files/scripts/on_env_start.sh scripts/
|
cp sd-ui-files/scripts/on_env_start.sh scripts/
|
||||||
|
cp sd-ui-files/scripts/bootstrap.sh scripts/
|
||||||
|
|
||||||
source installer/etc/profile.d/conda.sh
|
# activate the installer env
|
||||||
|
CONDA_BASEPATH=$(conda info --base)
|
||||||
|
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error
|
||||||
|
|
||||||
python -c "import os; import shutil; frm = 'sd-ui-files/ui/hotfix/9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'; dst = os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'transformers', '9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'); shutil.copyfile(frm, dst) if os.path.exists(dst) else print(''); print('Hotfixed broken JSON file from OpenAI');"
|
conda activate || fail "Failed to activate conda"
|
||||||
|
|
||||||
|
# remove the old version of the dev console script, if it's still present
|
||||||
|
if [ -e "open_dev_console.sh" ]; then
|
||||||
|
rm "open_dev_console.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
python -c "import os; import shutil; frm = 'sd-ui-files/ui/hotfix/9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'; dst = os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'transformers', '9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'); shutil.copyfile(frm, dst) if os.path.exists(dst) else print(''); print('Hotfixed broken JSON file from OpenAI');"
|
||||||
|
|
||||||
# Caution, this file will make your eyes and brain bleed. It's such an unholy mess.
|
# Caution, this file will make your eyes and brain bleed. It's such an unholy mess.
|
||||||
# Note to self: Please rewrite this in Python. For the sake of your own sanity.
|
# Note to self: Please rewrite this in Python. For the sake of your own sanity.
|
||||||
@ -16,10 +28,10 @@ if [ -e "scripts/install_status.txt" ] && [ `grep -c sd_git_cloned scripts/insta
|
|||||||
|
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull
|
git pull
|
||||||
git checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
||||||
|
|
||||||
git apply ../ui/sd_internal/ddim_callback.patch
|
git apply ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed"
|
||||||
git apply ../ui/sd_internal/env_yaml.patch
|
git apply ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed"
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
else
|
else
|
||||||
@ -28,16 +40,14 @@ else
|
|||||||
if git clone https://github.com/basujindal/stable-diffusion.git ; then
|
if git clone https://github.com/basujindal/stable-diffusion.git ; then
|
||||||
echo sd_git_cloned >> scripts/install_status.txt
|
echo sd_git_cloned >> scripts/install_status.txt
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "git clone of basujindal/stable-diffusion.git failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd stable-diffusion
|
cd stable-diffusion
|
||||||
git checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c
|
||||||
|
|
||||||
git apply ../ui/sd_internal/ddim_callback.patch
|
git apply ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed"
|
||||||
git apply ../ui/sd_internal/env_yaml.patch
|
git apply ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed"
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
@ -47,37 +57,32 @@ cd stable-diffusion
|
|||||||
if [ `grep -c conda_sd_env_created ../scripts/install_status.txt` -gt "0" ]; then
|
if [ `grep -c conda_sd_env_created ../scripts/install_status.txt` -gt "0" ]; then
|
||||||
echo "Packages necessary for Stable Diffusion were already installed"
|
echo "Packages necessary for Stable Diffusion were already installed"
|
||||||
|
|
||||||
conda activate ./env
|
conda activate ./env || fail "conda activate failed"
|
||||||
else
|
else
|
||||||
printf "\n\nDownloading packages necessary for Stable Diffusion..\n"
|
printf "\n\nDownloading packages necessary for Stable Diffusion..\n"
|
||||||
printf "\n\n***** This will take some time (depending on the speed of the Internet connection) and may appear to be stuck, but please be patient ***** ..\n\n"
|
printf "\n\n***** This will take some time (depending on the speed of the Internet connection) and may appear to be stuck, but please be patient ***** ..\n\n"
|
||||||
|
|
||||||
# prevent conda from using packages from the user's home directory, to avoid conflicts
|
# prevent conda from using packages from the user's home directory, to avoid conflicts
|
||||||
export PYTHONNOUSERSITE=1
|
export PYTHONNOUSERSITE=1
|
||||||
|
export PYTHONPATH="$(pwd):$(pwd)/env/lib/site-packages"
|
||||||
|
|
||||||
if conda env create --prefix env --force -f environment.yaml ; then
|
if conda env create --prefix env --force -f environment.yaml ; then
|
||||||
echo "Installed. Testing.."
|
echo "Installed. Testing.."
|
||||||
else
|
else
|
||||||
printf "\n\nError installing the packages necessary for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "'conda env create' failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
conda activate ./env
|
conda activate ./env || fail "conda activate failed"
|
||||||
|
|
||||||
if conda install -c conda-forge --prefix ./env -y antlr4-python3-runtime=4.8 ; then
|
if conda install -c conda-forge --prefix ./env -y antlr4-python3-runtime=4.8 ; then
|
||||||
echo "Installed. Testing.."
|
echo "Installed. Testing.."
|
||||||
else
|
else
|
||||||
printf "\n\nError installing antlr4-python3-runtime for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error installing antlr4-python3-runtime"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
out_test=`python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"`
|
out_test=`python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"`
|
||||||
if [ "$out_test" != "42" ]; then
|
if [ "$out_test" != "42" ]; then
|
||||||
printf "\n\nDependency test failed! Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Dependency test failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo conda_sd_env_created >> ../scripts/install_status.txt
|
echo conda_sd_env_created >> ../scripts/install_status.txt
|
||||||
@ -89,20 +94,20 @@ else
|
|||||||
printf "\n\nDownloading packages necessary for GFPGAN (Face Correction)..\n"
|
printf "\n\nDownloading packages necessary for GFPGAN (Face Correction)..\n"
|
||||||
|
|
||||||
export PYTHONNOUSERSITE=1
|
export PYTHONNOUSERSITE=1
|
||||||
|
export PYTHONPATH="$(pwd):$(pwd)/env/lib/site-packages"
|
||||||
|
|
||||||
if pip install -e git+https://github.com/TencentARC/GFPGAN#egg=GFPGAN ; then
|
if pip install -e git+https://github.com/TencentARC/GFPGAN#egg=GFPGAN ; then
|
||||||
echo "Installed. Testing.."
|
echo "Installed. Testing.."
|
||||||
else
|
else
|
||||||
printf "\n\nError installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error installing the packages necessary for GFPGAN (Face Correction)."
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
out_test=`python -c "from gfpgan import GFPGANer; print(42)"`
|
out_test=`python -c "from gfpgan import GFPGANer; print(42)"`
|
||||||
if [ "$out_test" != "42" ]; then
|
if [ "$out_test" != "42" ]; then
|
||||||
printf "\n\nDependency test failed! Error installing the packages necessary for GFPGAN (Face Correction). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
echo "EE The dependency check has failed. This usually means that some system libraries are missing."
|
||||||
read -p "Press any key to continue"
|
echo "EE On Debian/Ubuntu systems, this are often these packages: libsm6 libxext6 libxrender-dev"
|
||||||
exit
|
echo "EE Other Linux distributions might have different package names for these libraries."
|
||||||
|
fail "GFPGAN dependency test failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo conda_sd_gfpgan_deps_installed >> ../scripts/install_status.txt
|
echo conda_sd_gfpgan_deps_installed >> ../scripts/install_status.txt
|
||||||
@ -114,20 +119,17 @@ else
|
|||||||
printf "\n\nDownloading packages necessary for ESRGAN (Resolution Upscaling)..\n"
|
printf "\n\nDownloading packages necessary for ESRGAN (Resolution Upscaling)..\n"
|
||||||
|
|
||||||
export PYTHONNOUSERSITE=1
|
export PYTHONNOUSERSITE=1
|
||||||
|
export PYTHONPATH="$(pwd):$(pwd)/env/lib/site-packages"
|
||||||
|
|
||||||
if pip install -e git+https://github.com/xinntao/Real-ESRGAN#egg=realesrgan ; then
|
if pip install -e git+https://github.com/xinntao/Real-ESRGAN#egg=realesrgan ; then
|
||||||
echo "Installed. Testing.."
|
echo "Installed. Testing.."
|
||||||
else
|
else
|
||||||
printf "\n\nError installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error installing the packages necessary for ESRGAN"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
out_test=`python -c "from basicsr.archs.rrdbnet_arch import RRDBNet; from realesrgan import RealESRGANer; print(42)"`
|
out_test=`python -c "from basicsr.archs.rrdbnet_arch import RRDBNet; from realesrgan import RealESRGANer; print(42)"`
|
||||||
if [ "$out_test" != "42" ]; then
|
if [ "$out_test" != "42" ]; then
|
||||||
printf "\n\nDependency test failed! Error installing the packages necessary for ESRGAN (Resolution Upscaling). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "ESRGAN dependency test failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo conda_sd_esrgan_deps_installed >> ../scripts/install_status.txt
|
echo conda_sd_esrgan_deps_installed >> ../scripts/install_status.txt
|
||||||
@ -139,19 +141,16 @@ else
|
|||||||
printf "\n\nDownloading packages necessary for Stable Diffusion UI..\n\n"
|
printf "\n\nDownloading packages necessary for Stable Diffusion UI..\n\n"
|
||||||
|
|
||||||
export PYTHONNOUSERSITE=1
|
export PYTHONNOUSERSITE=1
|
||||||
|
export PYTHONPATH="$(pwd):$(pwd)/env/lib/site-packages"
|
||||||
|
|
||||||
if conda install -c conda-forge --prefix ./env -y uvicorn fastapi ; then
|
if conda install -c conda-forge --prefix ./env -y uvicorn fastapi ; then
|
||||||
echo "Installed. Testing.."
|
echo "Installed. Testing.."
|
||||||
else
|
else
|
||||||
printf "\n\nError installing the packages necessary for Stable Diffusion UI. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "'conda install uvicorn' failed"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v uvicorn &> /dev/null; then
|
if ! command -v uvicorn &> /dev/null; then
|
||||||
printf "\n\nUI packages not found! Error installing the packages necessary for Stable Diffusion UI. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "UI packages not found!"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo conda_sd_ui_deps_installed >> ../scripts/install_status.txt
|
echo conda_sd_ui_deps_installed >> ../scripts/install_status.txt
|
||||||
@ -159,8 +158,11 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p "../models/stable-diffusion"
|
||||||
|
echo "" > "../models/stable-diffusion/Put your custom ckpt files here.txt"
|
||||||
|
|
||||||
if [ -f "sd-v1-4.ckpt" ]; then
|
if [ -f "sd-v1-4.ckpt" ]; then
|
||||||
model_size=`ls -l sd-v1-4.ckpt | awk '{print $5}'`
|
model_size=`find "sd-v1-4.ckpt" -printf "%s"`
|
||||||
|
|
||||||
if [ "$model_size" -eq "4265380512" ] || [ "$model_size" -eq "7703807346" ] || [ "$model_size" -eq "7703810927" ]; then
|
if [ "$model_size" -eq "4265380512" ] || [ "$model_size" -eq "7703807346" ] || [ "$model_size" -eq "7703810927" ]; then
|
||||||
echo "Data files (weights) necessary for Stable Diffusion were already downloaded"
|
echo "Data files (weights) necessary for Stable Diffusion were already downloaded"
|
||||||
@ -176,23 +178,18 @@ if [ ! -f "sd-v1-4.ckpt" ]; then
|
|||||||
curl -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt
|
curl -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt
|
||||||
|
|
||||||
if [ -f "sd-v1-4.ckpt" ]; then
|
if [ -f "sd-v1-4.ckpt" ]; then
|
||||||
model_size=`ls -l sd-v1-4.ckpt | awk '{print $5}'`
|
model_size=`find "sd-v1-4.ckpt" -printf "%s"`
|
||||||
if [ ! "$model_size" == "4265380512" ]; then
|
if [ ! "$model_size" == "4265380512" ]; then
|
||||||
printf "\n\nError: The downloaded model file was invalid! Bytes downloaded: $model_size\n\n"
|
fail "The downloaded model file was invalid! Bytes downloaded: $model_size"
|
||||||
printf "\n\nError downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading the data files (weights) for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error downloading the data files (weights) for Stable Diffusion"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "GFPGANv1.3.pth" ]; then
|
if [ -f "GFPGANv1.3.pth" ]; then
|
||||||
model_size=`ls -l GFPGANv1.3.pth | awk '{print $5}'`
|
model_size=`find "GFPGANv1.3.pth" -printf "%s"`
|
||||||
|
|
||||||
if [ "$model_size" -eq "348632874" ]; then
|
if [ "$model_size" -eq "348632874" ]; then
|
||||||
echo "Data files (weights) necessary for GFPGAN (Face Correction) were already downloaded"
|
echo "Data files (weights) necessary for GFPGAN (Face Correction) were already downloaded"
|
||||||
@ -208,23 +205,18 @@ if [ ! -f "GFPGANv1.3.pth" ]; then
|
|||||||
curl -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth
|
curl -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth
|
||||||
|
|
||||||
if [ -f "GFPGANv1.3.pth" ]; then
|
if [ -f "GFPGANv1.3.pth" ]; then
|
||||||
model_size=`ls -l GFPGANv1.3.pth | awk '{print $5}'`
|
model_size=`find "GFPGANv1.3.pth" -printf "%s"`
|
||||||
if [ ! "$model_size" -eq "348632874" ]; then
|
if [ ! "$model_size" -eq "348632874" ]; then
|
||||||
printf "\n\nError: The downloaded GFPGAN model file was invalid! Bytes downloaded: $model_size\n\n"
|
fail "The downloaded GFPGAN model file was invalid! Bytes downloaded: $model_size"
|
||||||
printf "\n\nError downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading the data files (weights) for GFPGAN (Face Correction). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error downloading the data files (weights) for GFPGAN (Face Correction)."
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "RealESRGAN_x4plus.pth" ]; then
|
if [ -f "RealESRGAN_x4plus.pth" ]; then
|
||||||
model_size=`ls -l RealESRGAN_x4plus.pth | awk '{print $5}'`
|
model_size=`find "RealESRGAN_x4plus.pth" -printf "%s"`
|
||||||
|
|
||||||
if [ "$model_size" -eq "67040989" ]; then
|
if [ "$model_size" -eq "67040989" ]; then
|
||||||
echo "Data files (weights) necessary for ESRGAN (Resolution Upscaling) x4plus were already downloaded"
|
echo "Data files (weights) necessary for ESRGAN (Resolution Upscaling) x4plus were already downloaded"
|
||||||
@ -240,23 +232,18 @@ if [ ! -f "RealESRGAN_x4plus.pth" ]; then
|
|||||||
curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth
|
curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth
|
||||||
|
|
||||||
if [ -f "RealESRGAN_x4plus.pth" ]; then
|
if [ -f "RealESRGAN_x4plus.pth" ]; then
|
||||||
model_size=`ls -l RealESRGAN_x4plus.pth | awk '{print $5}'`
|
model_size=`find "RealESRGAN_x4plus.pth" -printf "%s"`
|
||||||
if [ ! "$model_size" -eq "67040989" ]; then
|
if [ ! "$model_size" -eq "67040989" ]; then
|
||||||
printf "\n\nError: The downloaded ESRGAN x4plus model file was invalid! Bytes downloaded: $model_size\n\n"
|
fail "The downloaded ESRGAN x4plus model file was invalid! Bytes downloaded: $model_size"
|
||||||
printf "\n\nError downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus"
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "RealESRGAN_x4plus_anime_6B.pth" ]; then
|
if [ -f "RealESRGAN_x4plus_anime_6B.pth" ]; then
|
||||||
model_size=`ls -l RealESRGAN_x4plus_anime_6B.pth | awk '{print $5}'`
|
model_size=`find "RealESRGAN_x4plus_anime_6B.pth" -printf "%s"`
|
||||||
|
|
||||||
if [ "$model_size" -eq "17938799" ]; then
|
if [ "$model_size" -eq "17938799" ]; then
|
||||||
echo "Data files (weights) necessary for ESRGAN (Resolution Upscaling) x4plus_anime were already downloaded"
|
echo "Data files (weights) necessary for ESRGAN (Resolution Upscaling) x4plus_anime were already downloaded"
|
||||||
@ -272,17 +259,12 @@ if [ ! -f "RealESRGAN_x4plus_anime_6B.pth" ]; then
|
|||||||
curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth
|
curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth
|
||||||
|
|
||||||
if [ -f "RealESRGAN_x4plus_anime_6B.pth" ]; then
|
if [ -f "RealESRGAN_x4plus_anime_6B.pth" ]; then
|
||||||
model_size=`ls -l RealESRGAN_x4plus_anime_6B.pth | awk '{print $5}'`
|
model_size=`find "RealESRGAN_x4plus_anime_6B.pth" -printf "%s"`
|
||||||
if [ ! "$model_size" -eq "17938799" ]; then
|
if [ ! "$model_size" -eq "17938799" ]; then
|
||||||
printf "\n\nError: The downloaded ESRGAN x4plus_anime model file was invalid! Bytes downloaded: $model_size\n\n"
|
fail "The downloaded ESRGAN x4plus_anime model file was invalid! Bytes downloaded: $model_size"
|
||||||
printf "\n\nError downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nError downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
|
fail "Error downloading the data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime."
|
||||||
read -p "Press any key to continue"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -295,15 +277,16 @@ fi
|
|||||||
printf "\n\nStable Diffusion is ready!\n\n"
|
printf "\n\nStable Diffusion is ready!\n\n"
|
||||||
|
|
||||||
SD_PATH=`pwd`
|
SD_PATH=`pwd`
|
||||||
export PYTHONPATH="$SD_PATH;$SD_PATH/env/lib/python3.8/site-packages"
|
export PYTHONPATH="$SD_PATH:$SD_PATH/env/lib/python3.8/site-packages"
|
||||||
echo "PYTHONPATH=$PYTHONPATH"
|
echo "PYTHONPATH=$PYTHONPATH"
|
||||||
|
|
||||||
|
which python
|
||||||
|
python --version
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
export SD_UI_PATH=`pwd`/ui
|
export SD_UI_PATH=`pwd`/ui
|
||||||
cd stable-diffusion
|
cd stable-diffusion
|
||||||
|
|
||||||
python --version
|
uvicorn server:app --app-dir "$SD_UI_PATH" --port ${SD_UI_BIND_PORT:-9000} --host ${SD_UI_BIND_IP:-0.0.0.0}
|
||||||
|
|
||||||
uvicorn server:app --app-dir "$SD_UI_PATH" --port 9000 --host 0.0.0.0
|
|
||||||
|
|
||||||
read -p "Press any key to continue"
|
read -p "Press any key to continue"
|
||||||
|
19
scripts/start.sh
Normal file → Executable file
@ -1,7 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source installer/bin/activate
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
conda-unpack
|
# set legacy installer's PATH, if it exists
|
||||||
|
if [ -e "installer" ]; then export PATH="$(pwd)/installer/bin:$PATH"; fi
|
||||||
|
|
||||||
|
# Setup the packages required for the installer
|
||||||
|
scripts/bootstrap.sh || exit 1
|
||||||
|
|
||||||
|
# set new installer's PATH, if it downloaded any packages
|
||||||
|
if [ -e "installer_files/env" ]; then export PATH="$(pwd)/installer_files/env/bin:$PATH"; fi
|
||||||
|
|
||||||
|
# Test the bootstrap
|
||||||
|
which git
|
||||||
|
git --version || exit 1
|
||||||
|
|
||||||
|
which conda
|
||||||
|
conda --version || exit 1
|
||||||
|
|
||||||
|
# Download the rest of the installer and UI
|
||||||
scripts/on_env_start.sh
|
scripts/on_env_start.sh
|
||||||
|
1634
ui/index.html
74
ui/media/css/auto-save.css
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/* Auto-Settings Styling */
|
||||||
|
#auto_save_settings ~ button {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
#auto_save_settings:not(:checked) ~ button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config {
|
||||||
|
position: absolute;
|
||||||
|
background: rgba(32, 33, 36, 50%);
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config > div {
|
||||||
|
background: var(--background-color3);
|
||||||
|
max-width: 600px;
|
||||||
|
margin: auto;
|
||||||
|
margin-top: 50px;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-table {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-table th {
|
||||||
|
padding-top: 15px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-table td:first-child,
|
||||||
|
#save-settings-config-table th:first-child {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-table td:last-child,
|
||||||
|
#save-settings-config-table th:last-child {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-table td small {
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-settings-config-close-btn {
|
||||||
|
float: right;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 10px;
|
||||||
|
transform: translate(50%, -50%) scaleX(130%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#reset-image-settings {
|
||||||
|
cursor: pointer;
|
||||||
|
float: right;
|
||||||
|
padding: 8px;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible:not(.active) #reset-image-settings {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#reset-image-settings.hidden {
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
6
ui/media/css/fontawesome-all.min.css
vendored
Normal file
40
ui/media/css/fonts.css
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* work-sans-regular - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Work Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(''),
|
||||||
|
url('/media/fonts/work-sans-v18-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('/media/fonts/work-sans-v18-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* work-sans-600 - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Work Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
src: local(''),
|
||||||
|
url('/media/fonts/work-sans-v18-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('/media/fonts/work-sans-v18-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* work-sans-700 - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Work Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
src: local(''),
|
||||||
|
url('/media/fonts/work-sans-v18-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('/media/fonts/work-sans-v18-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* work-sans-800 - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Work Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
src: local(''),
|
||||||
|
url('/media/fonts/work-sans-v18-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('/media/fonts/work-sans-v18-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
643
ui/media/css/main.css
Normal file
@ -0,0 +1,643 @@
|
|||||||
|
* {
|
||||||
|
font-family: Work Sans, Verdana, Geneva, sans-serif;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-size: 11pt;
|
||||||
|
background-color: var(--background-color1);
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: rgb(0, 102, 204);
|
||||||
|
}
|
||||||
|
a:visited {
|
||||||
|
color: rgb(0, 102, 204);
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
#prompt {
|
||||||
|
width: 100%;
|
||||||
|
height: 65pt;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
.image_preview_container {
|
||||||
|
/* display: none; */
|
||||||
|
margin-top: 10pt;
|
||||||
|
}
|
||||||
|
.image_clear_btn {
|
||||||
|
position: absolute;
|
||||||
|
transform: translate(30%, -30%);
|
||||||
|
background: black;
|
||||||
|
color: white;
|
||||||
|
border: 2pt solid #ccc;
|
||||||
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
outline: inherit;
|
||||||
|
border-radius: 8pt;
|
||||||
|
width: 16pt;
|
||||||
|
height: 16pt;
|
||||||
|
font-family: Verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
top: 0px;
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
.settings-box ul {
|
||||||
|
font-size: 9pt;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding-left: 10px;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
.settings-box li {
|
||||||
|
padding-bottom: 4pt;
|
||||||
|
}
|
||||||
|
.editor-slider {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.outputMsg {
|
||||||
|
font-size: small;
|
||||||
|
padding-bottom: 3pt;
|
||||||
|
}
|
||||||
|
#progressBar {
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
font-size: small;
|
||||||
|
padding-left: 10pt;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
#footer-legal {
|
||||||
|
font-size: 8pt;
|
||||||
|
}
|
||||||
|
.imgSeedLabel {
|
||||||
|
font-size: 0.8em;
|
||||||
|
background-color: var(--background-color2);
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.imgItem {
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
.imgContainer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.imgItemInfo {
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
flex-direction: column;
|
||||||
|
position: absolute;
|
||||||
|
padding: 5px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: 0.1s all;
|
||||||
|
}
|
||||||
|
.imgContainer:hover > .imgItemInfo {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.imgItemInfo * {
|
||||||
|
margin-bottom: 7px;
|
||||||
|
}
|
||||||
|
#container {
|
||||||
|
width: 95%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 1800px) {
|
||||||
|
#container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#logo small {
|
||||||
|
font-size: 11pt;
|
||||||
|
}
|
||||||
|
#editor {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
#editor label {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
.settings-box label small {
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
#preview {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
#editor-inputs {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
#editor-inputs-prompt {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
#editor-inputs .row {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
#makeImage {
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
#editor-modifiers h5 {
|
||||||
|
padding: 5pt 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#makeImage {
|
||||||
|
flex: 0 0 70px;
|
||||||
|
background: var(--accent-color);
|
||||||
|
border: var(--make-image-border);
|
||||||
|
color: rgb(255, 221, 255);
|
||||||
|
width: 100%;
|
||||||
|
height: 30pt;
|
||||||
|
}
|
||||||
|
#makeImage:hover {
|
||||||
|
background: hsl(var(--accent-hue), 100%, calc(var(--accent-lightness) + 6%));
|
||||||
|
}
|
||||||
|
#stopImage {
|
||||||
|
flex: 0 0 70px;
|
||||||
|
background: rgb(132, 8, 0);
|
||||||
|
border: 2px solid rgb(122, 29, 0);
|
||||||
|
color: rgb(255, 221, 255);
|
||||||
|
width: 100%;
|
||||||
|
height: 30pt;
|
||||||
|
border-radius: 6px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#stopImage:hover {
|
||||||
|
background: rgb(177, 27, 0);
|
||||||
|
}
|
||||||
|
.flex-container {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.col-50 {
|
||||||
|
flex: 50%;
|
||||||
|
}
|
||||||
|
.col-fixed-10 {
|
||||||
|
flex: 0 0 350pt;
|
||||||
|
}
|
||||||
|
.col-free {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.collapsible {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.collapsible-content {
|
||||||
|
display: none;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
.collapsible-content h5 {
|
||||||
|
padding: 5pt 0pt;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.collapsible-handle {
|
||||||
|
color: white;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
.panel-box {
|
||||||
|
background: var(--background-color2);
|
||||||
|
border: 1px solid var(--background-color3);
|
||||||
|
border-radius: 7px;
|
||||||
|
padding: 5px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.panel-box h4 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px 0;
|
||||||
|
}
|
||||||
|
#editor-modifiers .editor-modifiers-leaf {
|
||||||
|
padding-top: 10pt;
|
||||||
|
padding-bottom: 10pt;
|
||||||
|
}
|
||||||
|
#preview {
|
||||||
|
margin-left: 10pt;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.line-separator {
|
||||||
|
background: rgb(56, 56, 56);
|
||||||
|
height: 1pt;
|
||||||
|
margin: 15pt 0;
|
||||||
|
}
|
||||||
|
#editor-inputs-tags-container {
|
||||||
|
margin-top: 5pt;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#server-status {
|
||||||
|
display: inline;
|
||||||
|
float: right;
|
||||||
|
transform: translateY(-5pt);
|
||||||
|
}
|
||||||
|
#server-status-color {
|
||||||
|
/* width: 8pt;
|
||||||
|
height: 8pt;
|
||||||
|
border-radius: 4pt; */
|
||||||
|
font-size: 14pt;
|
||||||
|
color: rgb(200, 139, 0);
|
||||||
|
/* background-color: rgb(197, 1, 1); */
|
||||||
|
/* transform: translateY(15%); */
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
#server-status-msg {
|
||||||
|
color: rgb(200, 139, 0);
|
||||||
|
padding-left: 2pt;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.preview-prompt {
|
||||||
|
font-size: 13pt;
|
||||||
|
margin-bottom: 10pt;
|
||||||
|
}
|
||||||
|
#coffeeButton {
|
||||||
|
height: 23px;
|
||||||
|
transform: translateY(25%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#inpaintingEditor {
|
||||||
|
width: 300pt;
|
||||||
|
height: 300pt;
|
||||||
|
margin-top: 5pt;
|
||||||
|
}
|
||||||
|
.drawing-board-canvas-wrapper {
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
.drawing-board-controls {
|
||||||
|
min-width: 273px;
|
||||||
|
}
|
||||||
|
.drawing-board-control > button {
|
||||||
|
background-color: #eee;
|
||||||
|
border-radius: 3pt;
|
||||||
|
}
|
||||||
|
.drawing-board-control-inner {
|
||||||
|
background-color: #eee;
|
||||||
|
border-radius: 3pt;
|
||||||
|
}
|
||||||
|
#inpaintingEditor canvas {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
#enable_mask {
|
||||||
|
margin-top: 8pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top-nav {
|
||||||
|
padding-top: 3pt;
|
||||||
|
padding-bottom: 15pt;
|
||||||
|
}
|
||||||
|
#top-nav .icon {
|
||||||
|
padding-right: 4pt;
|
||||||
|
font-size: 14pt;
|
||||||
|
transform: translateY(1pt);
|
||||||
|
}
|
||||||
|
#logo {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
#logo h1 {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
#top-nav-items {
|
||||||
|
list-style-type: none;
|
||||||
|
display: inline;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#top-nav-items > li {
|
||||||
|
float: left;
|
||||||
|
display: inline;
|
||||||
|
padding-left: 20pt;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
#initial-text {
|
||||||
|
padding-top: 15pt;
|
||||||
|
padding-left: 4pt;
|
||||||
|
}
|
||||||
|
.settings-subheader {
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.pl-5 {
|
||||||
|
padding-left: 5pt;
|
||||||
|
}
|
||||||
|
#system-settings {
|
||||||
|
width: 360pt;
|
||||||
|
transform: translateX(-100%) translateX(70pt);
|
||||||
|
|
||||||
|
padding-top: 10pt;
|
||||||
|
padding-bottom: 10pt;
|
||||||
|
}
|
||||||
|
#system-settings ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#system-settings li {
|
||||||
|
padding-left: 5pt;
|
||||||
|
}
|
||||||
|
#community-links {
|
||||||
|
list-style-type: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 12pt;
|
||||||
|
padding-bottom: 0pt;
|
||||||
|
transform: translateX(-15%);
|
||||||
|
}
|
||||||
|
#community-links li {
|
||||||
|
padding-bottom: 12pt;
|
||||||
|
display: block;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
#community-links li .fa-fw {
|
||||||
|
padding-right: 2pt;
|
||||||
|
}
|
||||||
|
#community-links li a {
|
||||||
|
color: var(--text-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.dropdown {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.dropdown-content {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
background: var(--background-color4);
|
||||||
|
border: 2px solid var(--background-color2);
|
||||||
|
border-radius: 7px;
|
||||||
|
padding: 5px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
box-shadow: 0 20px 28px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.dropdown:hover .dropdown-content {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageTaskContainer {
|
||||||
|
border: 1px solid var(--background-color2);
|
||||||
|
margin-bottom: 10pt;
|
||||||
|
padding: 5pt;
|
||||||
|
border-radius: 5pt;
|
||||||
|
box-shadow: 0 20px 28px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.taskStatusLabel {
|
||||||
|
float: left;
|
||||||
|
font-size: 8pt;
|
||||||
|
background:var(--background-color2);
|
||||||
|
border: 1px solid rgb(61, 62, 66);
|
||||||
|
padding: 2pt 4pt;
|
||||||
|
border-radius: 2pt;
|
||||||
|
margin-right: 5pt;
|
||||||
|
}
|
||||||
|
.activeTaskLabel {
|
||||||
|
background:rgb(0, 90, 30);
|
||||||
|
border: 1px solid rgb(0, 75, 19);
|
||||||
|
color:rgb(222, 253, 230)
|
||||||
|
}
|
||||||
|
.waitingTaskLabel {
|
||||||
|
background:rgb(128, 89, 0);
|
||||||
|
border: 1px solid rgb(107, 75, 0);
|
||||||
|
color:rgb(255, 242, 211)
|
||||||
|
}
|
||||||
|
.secondaryButton {
|
||||||
|
background: rgb(132, 8, 0);
|
||||||
|
border: 1px solid rgb(122, 29, 0);
|
||||||
|
color: rgb(255, 221, 255);
|
||||||
|
padding: 3pt 6pt;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.secondaryButton:hover {
|
||||||
|
background: rgb(177, 27, 0);
|
||||||
|
}
|
||||||
|
.stopTask {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#preview-tools {
|
||||||
|
display: none;
|
||||||
|
padding: 4pt;
|
||||||
|
}
|
||||||
|
.taskConfig {
|
||||||
|
font-size: 10pt;
|
||||||
|
color: #aaa;
|
||||||
|
margin-bottom: 5pt;
|
||||||
|
}
|
||||||
|
.img-batch {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
#prompt_from_file {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#init_image_preview {
|
||||||
|
max-width: 150px;
|
||||||
|
max-height: 150px;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 6px;
|
||||||
|
transition: all 1s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#init_image_preview:hover {
|
||||||
|
max-width: 500px;
|
||||||
|
max-height: 1000px;
|
||||||
|
transition: all 1s 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#init_image_wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
#init_image_size_box {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 3px;
|
||||||
|
padding: 3px;
|
||||||
|
background: black;
|
||||||
|
color: white;
|
||||||
|
text-shadow: 0px 0px 4px black;
|
||||||
|
opacity: 60%;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 6px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#editor-settings-entries table td {
|
||||||
|
padding: 0px;
|
||||||
|
line-height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#editor-settings-entries table td:first-child {
|
||||||
|
float: right;
|
||||||
|
padding-right: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
#negative_prompt {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input[type="file"],
|
||||||
|
input[type="checkbox"],
|
||||||
|
select,
|
||||||
|
option {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
border-radius: var(--input-border-radius);
|
||||||
|
padding: 4px;
|
||||||
|
accent-color: var(--accent-color);
|
||||||
|
background: var(--input-background-color);
|
||||||
|
border: var(--input-border-size) solid var(--input-border-color);
|
||||||
|
color: var(--input-text-color);
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:hover {
|
||||||
|
accent-color: var(--accent-color-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
padding: 4px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus,
|
||||||
|
select:focus,
|
||||||
|
textarea:focus {
|
||||||
|
outline: 2px solid var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[disabled],
|
||||||
|
select[disabled],
|
||||||
|
textarea[disabled] {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input::file-selector-button {
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--button-color);
|
||||||
|
color: var(--button-text-color);
|
||||||
|
border: var(--button-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
input::file-selector-button {
|
||||||
|
padding: 0px 4px;
|
||||||
|
height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 700px) {
|
||||||
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
#container {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px
|
||||||
|
}
|
||||||
|
.flex-container {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
#preview {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
#preview .collapsible-content {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
#preview .collapsible-content {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.imgItem {
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
.imgItem img {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
.dropdown-content {
|
||||||
|
width: auto !important;
|
||||||
|
transform: none !important;
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#promptsFromFileBtn {
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#reset-image-settings {
|
||||||
|
position: relative;
|
||||||
|
transform: translateY(-13%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-tooltip {
|
||||||
|
border-radius: 3px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
background-color: var(--background-color3);
|
||||||
|
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
position: absolute;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 8px 12px;
|
||||||
|
transition: 0.3s all;
|
||||||
|
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (hover: hover) {
|
||||||
|
:hover > .simple-tooltip {
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* position specific */
|
||||||
|
.simple-tooltip.right {
|
||||||
|
right: 0px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(calc(100% - 15%), -50%);
|
||||||
|
}
|
||||||
|
:hover > .simple-tooltip.right {
|
||||||
|
transform: translate(100%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-tooltip.top {
|
||||||
|
top: 0px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, calc(-100% + 15%));
|
||||||
|
}
|
||||||
|
:hover > .simple-tooltip.top {
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-tooltip.left {
|
||||||
|
left: 0px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(calc(-100% + 15%), -50%);
|
||||||
|
}
|
||||||
|
:hover > .simple-tooltip.left {
|
||||||
|
transform: translate(-100%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-tooltip.bottom {
|
||||||
|
bottom: 0px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, calc(100% - 15%));
|
||||||
|
}
|
||||||
|
:hover > .simple-tooltip.bottom {
|
||||||
|
transform: translate(-50%, 100%);
|
||||||
|
}
|
249
ui/media/css/modifier-thumbnails.css
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
.modifier-card {
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
|
||||||
|
transition: 0.1s;
|
||||||
|
border-radius: 7px;
|
||||||
|
margin: 3pt 3pt;
|
||||||
|
float: left;
|
||||||
|
width: 8em;
|
||||||
|
height: 11.5em;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: 8em 3.5em;
|
||||||
|
gap: 0px 0px;
|
||||||
|
grid-auto-flow: row;
|
||||||
|
grid-template-areas:
|
||||||
|
"modifier-card-image-container"
|
||||||
|
"modifier-card-container";
|
||||||
|
border: 2px solid rgba(255, 255, 255, .05);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.modifier-card-size_5 {
|
||||||
|
width: 18em;
|
||||||
|
grid-template-rows: 18em 3.5em;
|
||||||
|
height: 21.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_5 .modifier-card-image-overlay {
|
||||||
|
font-size: 8em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_4 {
|
||||||
|
width: 14em;
|
||||||
|
grid-template-rows: 14em 3.5em;
|
||||||
|
height: 17.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_4 .modifier-card-image-overlay {
|
||||||
|
font-size: 7em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_3 {
|
||||||
|
width: 11em;
|
||||||
|
grid-template-rows: 11em 3.5em;
|
||||||
|
height: 14.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_3 .modifier-card-image-overlay {
|
||||||
|
font-size: 6em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_2 {
|
||||||
|
width: 10em;
|
||||||
|
grid-template-rows: 10em 3.5em;
|
||||||
|
height: 13.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_2 .modifier-card-image-overlay {
|
||||||
|
font-size: 6em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_1 {
|
||||||
|
width: 9em;
|
||||||
|
grid-template-rows: 9em 3.5em;
|
||||||
|
height: 12.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_1 .modifier-card-image-overlay {
|
||||||
|
font-size: 5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-1 {
|
||||||
|
width: 7em;
|
||||||
|
grid-template-rows: 7em 3.5em;
|
||||||
|
height: 10.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-1 .modifier-card-image-overlay {
|
||||||
|
font-size: 4em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-2 {
|
||||||
|
width: 6em;
|
||||||
|
grid-template-rows: 6em 3.5em;
|
||||||
|
height: 9.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-2 .modifier-card-image-overlay {
|
||||||
|
font-size: 3em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-3 {
|
||||||
|
width: 5em;
|
||||||
|
grid-template-rows: 5em 3.5em;
|
||||||
|
height: 8.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-3 .modifier-card-image-overlay {
|
||||||
|
font-size: 3em;
|
||||||
|
}
|
||||||
|
.modifier-card-size_-3 .modifier-card-label {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
.modifier-card-tiny {
|
||||||
|
width: 6em;
|
||||||
|
height: 9.5em;
|
||||||
|
grid-template-rows: 6em 3.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-tiny .modifier-card-image-overlay {
|
||||||
|
font-size: 4em;
|
||||||
|
}
|
||||||
|
.modifier-card:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
box-shadow: 0 5px 16px 5px rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
.modifier-card-image-container {
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
width: inherit;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, .2);
|
||||||
|
grid-area: modifier-card-image-container;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: rgb(255 255 255 / 8%);
|
||||||
|
}
|
||||||
|
.modifier-card-image-container img {
|
||||||
|
width: inherit;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
}
|
||||||
|
.modifier-card-image-container * {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.modifier-card-container {
|
||||||
|
text-align: center;
|
||||||
|
background-color: rgba(0,0,0,0.5);
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
grid-area: modifier-card-container;
|
||||||
|
font-weight: 100;
|
||||||
|
font-size: .9em;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
.modifier-card-label {
|
||||||
|
padding: 4px;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.modifier-card-image-overlay {
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
background-color: rgb(0 0 0 / 50%);
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
opacity: 0;
|
||||||
|
font-size: 5em;
|
||||||
|
font-weight: 900;
|
||||||
|
color: rgb(255 255 255 / 50%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.modifier-card-overlay {
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
.modifier-card:hover > .modifier-card-image-container .modifier-card-image-overlay {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.modifier-card:hover > .modifier-card-image-container img {
|
||||||
|
filter: blur(.1em);
|
||||||
|
}
|
||||||
|
.modifier-card:active {
|
||||||
|
transform: scale(0.95);
|
||||||
|
box-shadow: 0 5px 16px 5px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
#preview-image {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
.modifier-card-active {
|
||||||
|
border: 2px solid rgb(179 82 255 / 94%);
|
||||||
|
box-shadow: 0 0px 10px 0 rgb(170 0 229 / 58%);
|
||||||
|
}
|
||||||
|
.tooltip {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.tooltip .tooltip-text {
|
||||||
|
visibility: hidden;
|
||||||
|
width: 120px;
|
||||||
|
background: rgb(101,97,181);
|
||||||
|
background: linear-gradient(180deg, rgba(101,97,181,1) 0%, rgba(47,45,85,1) 100%);
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 5px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
top: 105%;
|
||||||
|
left: 39%;
|
||||||
|
margin-left: -60px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
border: 2px solid rgb(90 100 177 / 94%);
|
||||||
|
box-shadow: 0px 10px 20px 5px rgb(11 0 58 / 55%);
|
||||||
|
width: 10em;
|
||||||
|
}
|
||||||
|
.tooltip .tooltip-text::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -0.9em;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -5px;
|
||||||
|
border-width: 5px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent rgb(90 100 177 / 94%) transparent;
|
||||||
|
}
|
||||||
|
.tooltip:hover .tooltip-text {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
#modifier-card-size-slider {
|
||||||
|
width: 6em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
#modifier-settings-btn {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modifier-settings-config {
|
||||||
|
position: fixed;
|
||||||
|
background: rgba(32, 33, 36, 50%);
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modifier-settings-config > div {
|
||||||
|
background: var(--background-color2);
|
||||||
|
max-width: 600px;
|
||||||
|
margin: auto;
|
||||||
|
margin-top: 100px;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#modifier-settings-config-close-btn {
|
||||||
|
float: right;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 10px;
|
||||||
|
transform: translate(50%, -50%) scaleX(130%);
|
||||||
|
}
|
||||||
|
#modifier-settings-config textarea {
|
||||||
|
width: 90%;
|
||||||
|
height: 150px;
|
||||||
|
}
|
146
ui/media/css/themes.css
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
:root {
|
||||||
|
--background-color1: rgb(32, 33, 36); /* main parts of the page */
|
||||||
|
--background-color2: rgb(44, 45, 48); /* main panels */
|
||||||
|
--background-color3: rgb(47, 49, 53);
|
||||||
|
--background-color4: rgb(18, 18, 19); /* settings dropdowns */
|
||||||
|
|
||||||
|
--accent-hue: 266;
|
||||||
|
--accent-lightness: 36%;
|
||||||
|
--accent-lightness-hover: 40%;
|
||||||
|
|
||||||
|
--text-color: #eee;
|
||||||
|
|
||||||
|
--input-text-color: black;
|
||||||
|
--input-background-color: #e9e9ed;
|
||||||
|
--input-border-color: #8f8f9d;
|
||||||
|
|
||||||
|
--button-text-color: var(--input-text-color);
|
||||||
|
--button-color: #e9e9ed;
|
||||||
|
--button-border: 1px solid #8f8f9d;
|
||||||
|
|
||||||
|
/* other */
|
||||||
|
--input-border-radius: 4px;
|
||||||
|
--input-border-size: 1px;
|
||||||
|
--accent-color: hsl(var(--accent-hue), 100%, var(--accent-lightness));
|
||||||
|
--accent-color-hover: hsl(var(--accent-hue), 100%, var(--accent-lightness-hover));
|
||||||
|
--make-image-border: 2px solid hsl(var(--accent-hue), 100%, calc(var(--accent-lightness) - 21%));
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light {
|
||||||
|
--background-color1: white;
|
||||||
|
--background-color2: #dddddd;
|
||||||
|
--background-color3: #e7e9eb;
|
||||||
|
--background-color4: #cccccc;
|
||||||
|
|
||||||
|
--text-color: black;
|
||||||
|
|
||||||
|
--input-text-color: black;
|
||||||
|
--input-background-color: #f8f9fa;
|
||||||
|
--input-border-color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-discord {
|
||||||
|
--background-color1: #36393f;
|
||||||
|
--background-color2: #2f3136;
|
||||||
|
--background-color3: #292b2f;
|
||||||
|
--background-color4: #202225;
|
||||||
|
|
||||||
|
--accent-hue: 235;
|
||||||
|
--accent-lightness: 65%;
|
||||||
|
--make-image-border: none;
|
||||||
|
|
||||||
|
--button-color: var(--accent-color);
|
||||||
|
--button-border: none;
|
||||||
|
|
||||||
|
--input-text-color: #ccc;
|
||||||
|
--input-border-size: 2px;
|
||||||
|
--input-background-color: #202225;
|
||||||
|
--input-border-color: var(--input-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-cool-blue {
|
||||||
|
--main-hue: 222;
|
||||||
|
--main-saturation: 18%;
|
||||||
|
--value-base: 19%;
|
||||||
|
--value-step: 3%;
|
||||||
|
--background-color1: hsl(var(--main-hue), var(--main-saturation), var(--value-base));
|
||||||
|
--background-color2: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (1 * var(--value-step))));
|
||||||
|
--background-color3: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (2 * var(--value-step))));
|
||||||
|
--background-color4: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (3 * var(--value-step))));
|
||||||
|
|
||||||
|
--accent-hue: 212;
|
||||||
|
--make-image-border: none;
|
||||||
|
|
||||||
|
--button-color: var(--accent-color);
|
||||||
|
--button-border: none;
|
||||||
|
|
||||||
|
--input-border-size: 1px;
|
||||||
|
--input-background-color: var(--background-color3);
|
||||||
|
--input-text-color: #ccc;
|
||||||
|
--input-border-color: var(--background-color4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.theme-blurple {
|
||||||
|
--main-hue: 235;
|
||||||
|
--main-saturation: 18%;
|
||||||
|
--value-base: 16%;
|
||||||
|
--value-step: 3%;
|
||||||
|
--background-color1: hsl(var(--main-hue), var(--main-saturation), var(--value-base));
|
||||||
|
--background-color2: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (1 * var(--value-step))));
|
||||||
|
--background-color3: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (2 * var(--value-step))));
|
||||||
|
--background-color4: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (3 * var(--value-step))));
|
||||||
|
|
||||||
|
--make-image-border: none;
|
||||||
|
|
||||||
|
--button-color: var(--accent-color);
|
||||||
|
--button-border: none;
|
||||||
|
|
||||||
|
--input-border-size: 1px;
|
||||||
|
--input-background-color: var(--background-color3);
|
||||||
|
--input-text-color: #ccc;
|
||||||
|
--input-border-color: var(--background-color4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-super-dark {
|
||||||
|
--main-hue: 222;
|
||||||
|
--main-saturation: 18%;
|
||||||
|
--value-base: 5%;
|
||||||
|
--value-step: 5%;
|
||||||
|
--background-color1: hsl(var(--main-hue), var(--main-saturation), var(--value-base));
|
||||||
|
--background-color2: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) + (1 * var(--value-step))));
|
||||||
|
--background-color3: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) + (2 * var(--value-step))));
|
||||||
|
--background-color4: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) + (3 * var(--value-step))));
|
||||||
|
|
||||||
|
--make-image-border: none;
|
||||||
|
|
||||||
|
--button-color: var(--accent-color);
|
||||||
|
--button-border: none;
|
||||||
|
|
||||||
|
--input-border-size: 0px;
|
||||||
|
--input-background-color: var(--background-color3);
|
||||||
|
--input-text-color: #ccc;
|
||||||
|
--input-border-color: var(--background-color4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-wild {
|
||||||
|
--main-hue: 128;
|
||||||
|
--main-saturation: 18%;
|
||||||
|
--value-base: 20%;
|
||||||
|
--value-step: 5%;
|
||||||
|
--background-color1: hsl(var(--main-hue), var(--main-saturation), var(--value-base));
|
||||||
|
--background-color2: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (1 * var(--value-step))));
|
||||||
|
--background-color3: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (2 * var(--value-step))));
|
||||||
|
--background-color4: hsl(var(--main-hue), var(--main-saturation), calc(var(--value-base) - (3 * var(--value-step))));
|
||||||
|
|
||||||
|
--accent-hue: 212;
|
||||||
|
--make-image-border: none;
|
||||||
|
|
||||||
|
--button-color: var(--accent-color);
|
||||||
|
--button-border: none;
|
||||||
|
|
||||||
|
--input-border-size: 1px;
|
||||||
|
--input-background-color: hsl(222, var(--main-saturation), calc(var(--value-base) - (2 * var(--value-step))));
|
||||||
|
--input-text-color: red;
|
||||||
|
--input-border-color: green;
|
||||||
|
}
|
BIN
ui/media/fonts/fa-brands-400.ttf
Normal file
BIN
ui/media/fonts/fa-brands-400.woff2
Normal file
BIN
ui/media/fonts/fa-regular-400.ttf
Normal file
BIN
ui/media/fonts/fa-regular-400.woff2
Normal file
BIN
ui/media/fonts/fa-solid-900.ttf
Normal file
BIN
ui/media/fonts/fa-solid-900.woff2
Normal file
BIN
ui/media/fonts/fa-v4compatibility.ttf
Normal file
BIN
ui/media/fonts/fa-v4compatibility.woff2
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-600.woff
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-600.woff2
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-700.woff
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-700.woff2
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-800.woff
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-800.woff2
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-regular.woff
Normal file
BIN
ui/media/fonts/work-sans-v18-latin-regular.woff2
Normal file
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 973 B After Width: | Height: | Size: 973 B |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
291
ui/media/js/auto-save.js
Normal file
@ -0,0 +1,291 @@
|
|||||||
|
// Saving settings
|
||||||
|
let saveSettingsConfigTable = document.getElementById("save-settings-config-table")
|
||||||
|
let saveSettingsConfigOverlay = document.getElementById("save-settings-config")
|
||||||
|
let resetImageSettingsButton = document.getElementById("reset-image-settings")
|
||||||
|
|
||||||
|
const SETTINGS_KEY = "user_settings_v2"
|
||||||
|
|
||||||
|
const SETTINGS = {} // key=id. dict initialized in initSettings. { element, default, value, ignore }
|
||||||
|
const SETTINGS_IDS_LIST = [
|
||||||
|
"prompt",
|
||||||
|
"seed",
|
||||||
|
"random_seed",
|
||||||
|
"num_outputs_total",
|
||||||
|
"num_outputs_parallel",
|
||||||
|
"stable_diffusion_model",
|
||||||
|
"sampler",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"num_inference_steps",
|
||||||
|
"guidance_scale",
|
||||||
|
"prompt_strength",
|
||||||
|
"output_format",
|
||||||
|
"negative_prompt",
|
||||||
|
"stream_image_progress",
|
||||||
|
"use_face_correction",
|
||||||
|
"use_upscale",
|
||||||
|
"show_only_filtered_image",
|
||||||
|
"upscale_model",
|
||||||
|
"preview-image",
|
||||||
|
"modifier-card-size-slider",
|
||||||
|
"theme",
|
||||||
|
"save_to_disk",
|
||||||
|
"diskPath",
|
||||||
|
"sound_toggle",
|
||||||
|
"turbo",
|
||||||
|
"use_cpu",
|
||||||
|
"use_full_precision",
|
||||||
|
"auto_save_settings"
|
||||||
|
]
|
||||||
|
|
||||||
|
const IGNORE_BY_DEFAULT = [
|
||||||
|
"prompt"
|
||||||
|
]
|
||||||
|
|
||||||
|
const SETTINGS_SECTIONS = [ // gets the "keys" property filled in with an ordered list of settings in this section via initSettings
|
||||||
|
{ id: "editor-inputs", name: "Prompt" },
|
||||||
|
{ id: "editor-settings", name: "Image Settings" },
|
||||||
|
{ id: "system-settings", name: "System Settings" },
|
||||||
|
{ id: "container", name: "Other" }
|
||||||
|
]
|
||||||
|
|
||||||
|
async function initSettings() {
|
||||||
|
SETTINGS_IDS_LIST.forEach(id => {
|
||||||
|
var element = document.getElementById(id)
|
||||||
|
var label = document.querySelector(`label[for='${element.id}']`)
|
||||||
|
SETTINGS[id] = {
|
||||||
|
key: id,
|
||||||
|
element: element,
|
||||||
|
label: getSettingLabel(element),
|
||||||
|
default: getSetting(element),
|
||||||
|
value: getSetting(element),
|
||||||
|
ignore: IGNORE_BY_DEFAULT.includes(id)
|
||||||
|
}
|
||||||
|
element.addEventListener("input", settingChangeHandler)
|
||||||
|
element.addEventListener("change", settingChangeHandler)
|
||||||
|
})
|
||||||
|
var unsorted_settings_ids = [...SETTINGS_IDS_LIST]
|
||||||
|
SETTINGS_SECTIONS.forEach(section => {
|
||||||
|
var name = section.name
|
||||||
|
var element = document.getElementById(section.id)
|
||||||
|
var children = Array.from(element.querySelectorAll(unsorted_settings_ids.map(id => `#${id}`).join(",")))
|
||||||
|
section.keys = []
|
||||||
|
children.forEach(e => {
|
||||||
|
section.keys.push(e.id)
|
||||||
|
})
|
||||||
|
unsorted_settings_ids = unsorted_settings_ids.filter(id => children.find(e => e.id == id) == undefined)
|
||||||
|
})
|
||||||
|
loadSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSetting(element) {
|
||||||
|
if (typeof element === "string" || element instanceof String) {
|
||||||
|
element = SETTINGS[element].element
|
||||||
|
}
|
||||||
|
if (element.type == "checkbox") {
|
||||||
|
return element.checked
|
||||||
|
}
|
||||||
|
return element.value
|
||||||
|
}
|
||||||
|
function setSetting(element, value) {
|
||||||
|
if (typeof element === "string" || element instanceof String) {
|
||||||
|
element = SETTINGS[element].element
|
||||||
|
}
|
||||||
|
SETTINGS[element.id].value = value
|
||||||
|
if (getSetting(element) == value) {
|
||||||
|
return // no setting necessary
|
||||||
|
}
|
||||||
|
if (element.type == "checkbox") {
|
||||||
|
element.checked = value
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
element.value = value
|
||||||
|
}
|
||||||
|
element.dispatchEvent(new Event("input"))
|
||||||
|
element.dispatchEvent(new Event("change"))
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveSettings() {
|
||||||
|
var saved_settings = Object.values(SETTINGS).map(setting => {
|
||||||
|
return {
|
||||||
|
key: setting.key,
|
||||||
|
value: setting.value,
|
||||||
|
ignore: setting.ignore
|
||||||
|
}
|
||||||
|
})
|
||||||
|
localStorage.setItem(SETTINGS_KEY, JSON.stringify(saved_settings))
|
||||||
|
}
|
||||||
|
|
||||||
|
var CURRENTLY_LOADING_SETTINGS = false
|
||||||
|
function loadSettings() {
|
||||||
|
var saved_settings_text = localStorage.getItem(SETTINGS_KEY)
|
||||||
|
if (saved_settings_text) {
|
||||||
|
var saved_settings = JSON.parse(saved_settings_text)
|
||||||
|
if (saved_settings.find(s => s.key == "auto_save_settings").value == false) {
|
||||||
|
setSetting("auto_save_settings", false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
CURRENTLY_LOADING_SETTINGS = true
|
||||||
|
saved_settings.map(saved_setting => {
|
||||||
|
var setting = SETTINGS[saved_setting.key]
|
||||||
|
if (setting === undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setting.ignore = saved_setting.ignore
|
||||||
|
if (!setting.ignore) {
|
||||||
|
setting.value = saved_setting.value
|
||||||
|
setSetting(setting.element, setting.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
CURRENTLY_LOADING_SETTINGS = false
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CURRENTLY_LOADING_SETTINGS = true
|
||||||
|
tryLoadOldSettings();
|
||||||
|
CURRENTLY_LOADING_SETTINGS = false
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadDefaultSettingsSection(section_id) {
|
||||||
|
CURRENTLY_LOADING_SETTINGS = true
|
||||||
|
var section = SETTINGS_SECTIONS.find(s => s.id == section_id);
|
||||||
|
section.keys.forEach(key => {
|
||||||
|
var setting = SETTINGS[key];
|
||||||
|
setting.value = setting.default
|
||||||
|
setSetting(setting.element, setting.value)
|
||||||
|
})
|
||||||
|
CURRENTLY_LOADING_SETTINGS = false
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function settingChangeHandler(event) {
|
||||||
|
if (!CURRENTLY_LOADING_SETTINGS) {
|
||||||
|
var element = event.target
|
||||||
|
var value = getSetting(element)
|
||||||
|
if (value != SETTINGS[element.id].value) {
|
||||||
|
SETTINGS[element.id].value = value
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSettingLabel(element) {
|
||||||
|
var labelElement = document.querySelector(`label[for='${element.id}']`)
|
||||||
|
var label = labelElement?.innerText || element.id
|
||||||
|
var truncate_length = 30
|
||||||
|
if (label.includes(" (")) {
|
||||||
|
label = label.substring(0, label.indexOf(" ("))
|
||||||
|
}
|
||||||
|
if (label.length > truncate_length) {
|
||||||
|
label = label.substring(0, truncate_length - 3) + "..."
|
||||||
|
}
|
||||||
|
label = label.replace("➕", "")
|
||||||
|
label = label.replace("➖", "")
|
||||||
|
return label
|
||||||
|
}
|
||||||
|
|
||||||
|
function fillSaveSettingsConfigTable() {
|
||||||
|
saveSettingsConfigTable.textContent = ""
|
||||||
|
SETTINGS_SECTIONS.forEach(section => {
|
||||||
|
var section_row = `<tr><th>${section.name}</th><td></td></tr>`
|
||||||
|
saveSettingsConfigTable.insertAdjacentHTML("beforeend", section_row)
|
||||||
|
section.keys.forEach(key => {
|
||||||
|
var setting = SETTINGS[key]
|
||||||
|
var element = setting.element
|
||||||
|
var checkbox_id = `shouldsave_${element.id}`
|
||||||
|
var is_checked = setting.ignore ? "" : "checked"
|
||||||
|
var value = setting.value
|
||||||
|
var value_truncate_length = 30
|
||||||
|
if ((typeof value === "string" || value instanceof String) && value.length > value_truncate_length) {
|
||||||
|
value = value.substring(0, value_truncate_length - 3) + "..."
|
||||||
|
}
|
||||||
|
var newrow = `<tr><td><label for="${checkbox_id}">${setting.label}</label></td><td><input id="${checkbox_id}" name="${checkbox_id}" ${is_checked} type="checkbox" ></td><td><small>(${value})</small></td></tr>`
|
||||||
|
saveSettingsConfigTable.insertAdjacentHTML("beforeend", newrow)
|
||||||
|
var checkbox = document.getElementById(checkbox_id)
|
||||||
|
checkbox.addEventListener("input", event => {
|
||||||
|
setting.ignore = !checkbox.checked
|
||||||
|
saveSettings()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("save-settings-config-close-btn").addEventListener('click', () => {
|
||||||
|
saveSettingsConfigOverlay.style.display = 'none'
|
||||||
|
})
|
||||||
|
document.getElementById("configureSettingsSaveBtn").addEventListener('click', () => {
|
||||||
|
fillSaveSettingsConfigTable()
|
||||||
|
saveSettingsConfigOverlay.style.display = 'block'
|
||||||
|
})
|
||||||
|
saveSettingsConfigOverlay.addEventListener('click', (event) => {
|
||||||
|
if (event.target.id == saveSettingsConfigOverlay.id) {
|
||||||
|
saveSettingsConfigOverlay.style.display = 'none'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
document.getElementById("save-settings-config-close-btn").addEventListener('click', () => {
|
||||||
|
saveSettingsConfigOverlay.style.display = 'none'
|
||||||
|
})
|
||||||
|
resetImageSettingsButton.addEventListener('click', event => {
|
||||||
|
loadDefaultSettingsSection("editor-settings");
|
||||||
|
event.stopPropagation()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function tryLoadOldSettings() {
|
||||||
|
console.log("Loading old user settings")
|
||||||
|
// load v1 auto-save.js settings
|
||||||
|
var old_map = {
|
||||||
|
"guidance_scale_slider": "guidance_scale",
|
||||||
|
"prompt_strength_slider": "prompt_strength"
|
||||||
|
}
|
||||||
|
var settings_key_v1 = "user_settings"
|
||||||
|
var saved_settings_text = localStorage.getItem(settings_key_v1)
|
||||||
|
if (saved_settings_text) {
|
||||||
|
var saved_settings = JSON.parse(saved_settings_text)
|
||||||
|
Object.keys(saved_settings.should_save).forEach(key => {
|
||||||
|
key = key in old_map ? old_map[key] : key
|
||||||
|
SETTINGS[key].ignore = !saved_settings.should_save[key]
|
||||||
|
});
|
||||||
|
Object.keys(saved_settings.values).forEach(key => {
|
||||||
|
key = key in old_map ? old_map[key] : key
|
||||||
|
var setting = SETTINGS[key]
|
||||||
|
if (!setting.ignore) {
|
||||||
|
setting.value = saved_settings.values[key]
|
||||||
|
setSetting(setting.element, setting.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
localStorage.removeItem(settings_key_v1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// load old individually stored items
|
||||||
|
var individual_settings_map = { // maps old localStorage-key to new SETTINGS-key
|
||||||
|
"soundEnabled": "sound_toggle",
|
||||||
|
"saveToDisk": "save_to_disk",
|
||||||
|
"useCPU": "use_cpu",
|
||||||
|
"useFullPrecision": "use_full_precision",
|
||||||
|
"useTurboMode": "turbo",
|
||||||
|
"diskPath": "diskPath",
|
||||||
|
"useFaceCorrection": "use_face_correction",
|
||||||
|
"useUpscaling": "use_upscale",
|
||||||
|
"showOnlyFilteredImage": "show_only_filtered_image",
|
||||||
|
"streamImageProgress": "stream_image_progress",
|
||||||
|
"outputFormat": "output_format",
|
||||||
|
"autoSaveSettings": "auto_save_settings",
|
||||||
|
};
|
||||||
|
Object.keys(individual_settings_map).forEach(localStorageKey => {
|
||||||
|
var localStorageValue = localStorage.getItem(localStorageKey);
|
||||||
|
if (localStorageValue !== null) {
|
||||||
|
var setting = SETTINGS[individual_settings_map[localStorageKey]]
|
||||||
|
if (setting == null || setting == undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (setting.element.type == "checkbox" && (typeof localStorageValue === "string" || localStorageValue instanceof String)) {
|
||||||
|
localStorageValue = localStorageValue == "true"
|
||||||
|
}
|
||||||
|
setting.value = localStorageValue
|
||||||
|
setSetting(setting.element, setting.value)
|
||||||
|
localStorage.removeItem(localStorageKey);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
294
ui/media/js/image-modifiers.js
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
let activeTags = []
|
||||||
|
let modifiers = []
|
||||||
|
let customModifiersGroupElement = undefined
|
||||||
|
|
||||||
|
let editorModifierEntries = document.querySelector('#editor-modifiers-entries')
|
||||||
|
let editorModifierTagsList = document.querySelector('#editor-inputs-tags-list')
|
||||||
|
let editorTagsContainer = document.querySelector('#editor-inputs-tags-container')
|
||||||
|
let modifierCardSizeSlider = document.querySelector('#modifier-card-size-slider')
|
||||||
|
let previewImageField = document.querySelector('#preview-image')
|
||||||
|
let modifierSettingsBtn = document.querySelector('#modifier-settings-btn')
|
||||||
|
let modifierSettingsOverlay = document.querySelector('#modifier-settings-config')
|
||||||
|
let customModifiersTextBox = document.querySelector('#custom-modifiers-input')
|
||||||
|
let customModifierEntriesToolbar = document.querySelector('#editor-modifiers-entries-toolbar')
|
||||||
|
|
||||||
|
const modifierThumbnailPath = 'media/modifier-thumbnails'
|
||||||
|
const activeCardClass = 'modifier-card-active'
|
||||||
|
const CUSTOM_MODIFIERS_KEY = "customModifiers"
|
||||||
|
|
||||||
|
function createModifierCard(name, previews) {
|
||||||
|
const modifierCard = document.createElement('div')
|
||||||
|
modifierCard.className = 'modifier-card'
|
||||||
|
modifierCard.innerHTML = `
|
||||||
|
<div class="modifier-card-overlay"></div>
|
||||||
|
<div class="modifier-card-image-container">
|
||||||
|
<div class="modifier-card-image-overlay">+</div>
|
||||||
|
<p class="modifier-card-error-label"></p>
|
||||||
|
<img onerror="this.remove()" alt="Modifier Image" class="modifier-card-image">
|
||||||
|
</div>
|
||||||
|
<div class="modifier-card-container">
|
||||||
|
<div class="modifier-card-label"><p></p></div>
|
||||||
|
</div>`
|
||||||
|
|
||||||
|
const image = modifierCard.querySelector('.modifier-card-image')
|
||||||
|
const errorText = modifierCard.querySelector('.modifier-card-error-label')
|
||||||
|
const label = modifierCard.querySelector('.modifier-card-label')
|
||||||
|
|
||||||
|
errorText.innerText = 'No Image'
|
||||||
|
|
||||||
|
if (typeof previews == 'object') {
|
||||||
|
image.src = previews[0]; // portrait
|
||||||
|
image.setAttribute('preview-type', 'portrait')
|
||||||
|
} else {
|
||||||
|
image.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
const maxLabelLength = 30
|
||||||
|
const nameWithoutBy = name.replace('by ', '')
|
||||||
|
|
||||||
|
if(nameWithoutBy.length <= maxLabelLength) {
|
||||||
|
label.querySelector('p').innerText = nameWithoutBy
|
||||||
|
} else {
|
||||||
|
const tooltipText = document.createElement('span')
|
||||||
|
tooltipText.className = 'tooltip-text'
|
||||||
|
tooltipText.innerText = name
|
||||||
|
|
||||||
|
label.classList.add('tooltip')
|
||||||
|
label.appendChild(tooltipText)
|
||||||
|
|
||||||
|
label.querySelector('p').innerText = nameWithoutBy.substring(0, maxLabelLength) + '...'
|
||||||
|
}
|
||||||
|
|
||||||
|
return modifierCard
|
||||||
|
}
|
||||||
|
|
||||||
|
function createModifierGroup(modifierGroup, initiallyExpanded) {
|
||||||
|
const title = modifierGroup.category
|
||||||
|
const modifiers = modifierGroup.modifiers
|
||||||
|
|
||||||
|
const titleEl = document.createElement('h5')
|
||||||
|
titleEl.className = 'collapsible'
|
||||||
|
titleEl.innerText = title
|
||||||
|
|
||||||
|
const modifiersEl = document.createElement('div')
|
||||||
|
modifiersEl.classList.add('collapsible-content', 'editor-modifiers-leaf')
|
||||||
|
|
||||||
|
if (initiallyExpanded === true) {
|
||||||
|
titleEl.className += ' active'
|
||||||
|
modifiersEl.style.display = 'block'
|
||||||
|
}
|
||||||
|
|
||||||
|
modifiers.forEach(modObj => {
|
||||||
|
const modifierName = modObj.modifier
|
||||||
|
const modifierPreviews = modObj?.previews?.map(preview => `${modifierThumbnailPath}/${preview.path}`)
|
||||||
|
|
||||||
|
const modifierCard = createModifierCard(modifierName, modifierPreviews)
|
||||||
|
|
||||||
|
if(typeof modifierCard == 'object') {
|
||||||
|
modifiersEl.appendChild(modifierCard)
|
||||||
|
|
||||||
|
modifierCard.addEventListener('click', () => {
|
||||||
|
if (activeTags.map(x => x.name).includes(modifierName)) {
|
||||||
|
// remove modifier from active array
|
||||||
|
activeTags = activeTags.filter(x => x.name != modifierName)
|
||||||
|
modifierCard.classList.remove(activeCardClass)
|
||||||
|
|
||||||
|
modifierCard.querySelector('.modifier-card-image-overlay').innerText = '+'
|
||||||
|
} else {
|
||||||
|
// add modifier to active array
|
||||||
|
activeTags.push({
|
||||||
|
'name': modifierName,
|
||||||
|
'element': modifierCard.cloneNode(true),
|
||||||
|
'originElement': modifierCard,
|
||||||
|
'previews': modifierPreviews
|
||||||
|
})
|
||||||
|
|
||||||
|
modifierCard.classList.add(activeCardClass)
|
||||||
|
|
||||||
|
modifierCard.querySelector('.modifier-card-image-overlay').innerText = '-'
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshTagsList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let brk = document.createElement('br')
|
||||||
|
brk.style.clear = 'both'
|
||||||
|
modifiersEl.appendChild(brk)
|
||||||
|
|
||||||
|
let e = document.createElement('div')
|
||||||
|
e.appendChild(titleEl)
|
||||||
|
e.appendChild(modifiersEl)
|
||||||
|
|
||||||
|
editorModifierEntries.insertBefore(e, customModifierEntriesToolbar.nextSibling)
|
||||||
|
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadModifiers() {
|
||||||
|
try {
|
||||||
|
let res = await fetch('/get/modifiers')
|
||||||
|
if (res.status === 200) {
|
||||||
|
res = await res.json()
|
||||||
|
|
||||||
|
modifiers = res; // update global variable
|
||||||
|
|
||||||
|
res.reverse()
|
||||||
|
|
||||||
|
res.forEach((modifierGroup, idx) => {
|
||||||
|
createModifierGroup(modifierGroup, idx === res.length - 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
createCollapsibles(editorModifierEntries)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('error fetching modifiers', e)
|
||||||
|
}
|
||||||
|
|
||||||
|
loadCustomModifiers()
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshTagsList() {
|
||||||
|
editorModifierTagsList.innerHTML = ''
|
||||||
|
|
||||||
|
if (activeTags.length == 0) {
|
||||||
|
editorTagsContainer.style.display = 'none'
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
editorTagsContainer.style.display = 'block'
|
||||||
|
}
|
||||||
|
|
||||||
|
activeTags.forEach((tag, index) => {
|
||||||
|
tag.element.querySelector('.modifier-card-image-overlay').innerText = '-'
|
||||||
|
tag.element.classList.add('modifier-card-tiny')
|
||||||
|
|
||||||
|
editorModifierTagsList.appendChild(tag.element)
|
||||||
|
|
||||||
|
tag.element.addEventListener('click', () => {
|
||||||
|
let idx = activeTags.indexOf(tag)
|
||||||
|
|
||||||
|
if (idx !== -1) {
|
||||||
|
activeTags[idx].originElement.classList.remove(activeCardClass)
|
||||||
|
activeTags[idx].originElement.querySelector('.modifier-card-image-overlay').innerText = '+'
|
||||||
|
|
||||||
|
activeTags.splice(idx, 1)
|
||||||
|
refreshTagsList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
let brk = document.createElement('br')
|
||||||
|
brk.style.clear = 'both'
|
||||||
|
editorModifierTagsList.appendChild(brk)
|
||||||
|
}
|
||||||
|
|
||||||
|
function changePreviewImages(val) {
|
||||||
|
const previewImages = document.querySelectorAll('.modifier-card-image-container img')
|
||||||
|
|
||||||
|
let previewArr = []
|
||||||
|
|
||||||
|
modifiers.map(x => x.modifiers).forEach(x => previewArr.push(...x.map(m => m.previews)))
|
||||||
|
|
||||||
|
previewArr = previewArr.map(x => {
|
||||||
|
let obj = {}
|
||||||
|
|
||||||
|
x.forEach(preview => {
|
||||||
|
obj[preview.name] = preview.path
|
||||||
|
})
|
||||||
|
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
|
||||||
|
previewImages.forEach(previewImage => {
|
||||||
|
const currentPreviewType = previewImage.getAttribute('preview-type')
|
||||||
|
const relativePreviewPath = previewImage.src.split(modifierThumbnailPath + '/').pop()
|
||||||
|
|
||||||
|
const previews = previewArr.find(preview => relativePreviewPath == preview[currentPreviewType])
|
||||||
|
|
||||||
|
if(typeof previews == 'object') {
|
||||||
|
let preview = null
|
||||||
|
|
||||||
|
if (val == 'portrait') {
|
||||||
|
preview = previews.portrait
|
||||||
|
}
|
||||||
|
else if (val == 'landscape') {
|
||||||
|
preview = previews.landscape
|
||||||
|
}
|
||||||
|
|
||||||
|
if(preview != null) {
|
||||||
|
previewImage.src = `${modifierThumbnailPath}/${preview}`
|
||||||
|
previewImage.setAttribute('preview-type', val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resizeModifierCards(val) {
|
||||||
|
const cardSizePrefix = 'modifier-card-size_'
|
||||||
|
const modifierCardClass = 'modifier-card'
|
||||||
|
|
||||||
|
const modifierCards = document.querySelectorAll(`.${modifierCardClass}`)
|
||||||
|
const cardSize = n => `${cardSizePrefix}${n}`
|
||||||
|
|
||||||
|
modifierCards.forEach(card => {
|
||||||
|
// remove existing size classes
|
||||||
|
const classes = card.className.split(' ').filter(c => !c.startsWith(cardSizePrefix))
|
||||||
|
card.className = classes.join(' ').trim()
|
||||||
|
|
||||||
|
if(val != 0) {
|
||||||
|
card.classList.add(cardSize(val))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
modifierCardSizeSlider.onchange = () => resizeModifierCards(modifierCardSizeSlider.value)
|
||||||
|
previewImageField.onchange = () => changePreviewImages(previewImageField.value)
|
||||||
|
|
||||||
|
modifierSettingsBtn.addEventListener('click', function() {
|
||||||
|
modifierSettingsOverlay.style.display = 'block'
|
||||||
|
})
|
||||||
|
document.getElementById("modifier-settings-config-close-btn").addEventListener('click', () => {
|
||||||
|
modifierSettingsOverlay.style.display = 'none'
|
||||||
|
})
|
||||||
|
modifierSettingsOverlay.addEventListener('click', (event) => {
|
||||||
|
if (event.target.id == modifierSettingsOverlay.id) {
|
||||||
|
modifierSettingsOverlay.style.display = 'none'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function saveCustomModifiers() {
|
||||||
|
localStorage.setItem(CUSTOM_MODIFIERS_KEY, customModifiersTextBox.value.trim())
|
||||||
|
|
||||||
|
loadCustomModifiers()
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadCustomModifiers() {
|
||||||
|
let customModifiers = localStorage.getItem(CUSTOM_MODIFIERS_KEY, '')
|
||||||
|
customModifiersTextBox.value = customModifiers
|
||||||
|
|
||||||
|
if (customModifiersGroupElement !== undefined) {
|
||||||
|
customModifiersGroupElement.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (customModifiers && customModifiers.trim() !== '') {
|
||||||
|
customModifiers = customModifiers.split('\n')
|
||||||
|
customModifiers = customModifiers.filter(m => m.trim() !== '')
|
||||||
|
customModifiers = customModifiers.map(function(m) {
|
||||||
|
return {
|
||||||
|
"modifier": m
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let customGroup = {
|
||||||
|
'category': 'Custom Modifiers',
|
||||||
|
'modifiers': customModifiers
|
||||||
|
}
|
||||||
|
|
||||||
|
customModifiersGroupElement = createModifierGroup(customGroup, true)
|
||||||
|
|
||||||
|
createCollapsibles(customModifiersGroupElement)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customModifiersTextBox.addEventListener('change', saveCustomModifiers)
|
41
ui/media/js/inpainting-editor.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
const INPAINTING_EDITOR_SIZE = 450
|
||||||
|
|
||||||
|
let inpaintingEditorContainer = document.querySelector('#inpaintingEditor')
|
||||||
|
let inpaintingEditor = new DrawingBoard.Board('inpaintingEditor', {
|
||||||
|
color: "#ffffff",
|
||||||
|
background: false,
|
||||||
|
size: 30,
|
||||||
|
webStorage: false,
|
||||||
|
controls: [{'DrawingMode': {'filler': false}}, 'Size', 'Navigation']
|
||||||
|
})
|
||||||
|
let inpaintingEditorCanvasBackground = document.querySelector('.drawing-board-canvas-wrapper')
|
||||||
|
|
||||||
|
function resizeInpaintingEditor(widthValue, heightValue) {
|
||||||
|
if (widthValue === heightValue) {
|
||||||
|
widthValue = INPAINTING_EDITOR_SIZE
|
||||||
|
heightValue = INPAINTING_EDITOR_SIZE
|
||||||
|
} else if (widthValue > heightValue) {
|
||||||
|
heightValue = (heightValue / widthValue) * INPAINTING_EDITOR_SIZE
|
||||||
|
widthValue = INPAINTING_EDITOR_SIZE
|
||||||
|
} else {
|
||||||
|
widthValue = (widthValue / heightValue) * INPAINTING_EDITOR_SIZE
|
||||||
|
heightValue = INPAINTING_EDITOR_SIZE
|
||||||
|
}
|
||||||
|
if (inpaintingEditor.opts.aspectRatio === (widthValue / heightValue).toFixed(3)) {
|
||||||
|
// Same ratio, don't reset the canvas.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
inpaintingEditor.opts.aspectRatio = (widthValue / heightValue).toFixed(3)
|
||||||
|
|
||||||
|
inpaintingEditorContainer.style.width = widthValue + 'px'
|
||||||
|
inpaintingEditorContainer.style.height = heightValue + 'px'
|
||||||
|
inpaintingEditor.opts.enlargeYourContainer = true
|
||||||
|
|
||||||
|
inpaintingEditor.opts.size = inpaintingEditor.ctx.lineWidth
|
||||||
|
inpaintingEditor.resize()
|
||||||
|
|
||||||
|
inpaintingEditor.ctx.lineCap = "round"
|
||||||
|
inpaintingEditor.ctx.lineJoin = "round"
|
||||||
|
inpaintingEditor.ctx.lineWidth = inpaintingEditor.opts.size
|
||||||
|
inpaintingEditor.setColor(inpaintingEditor.opts.color)
|
||||||
|
}
|
1287
ui/media/js/main.js
Normal file
47
ui/media/js/plugins.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
const PLUGIN_API_VERSION = "1.0"
|
||||||
|
|
||||||
|
const PLUGINS = {
|
||||||
|
/**
|
||||||
|
* Register new buttons to show on each output image.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* PLUGINS['IMAGE_INFO_BUTTONS'].push({
|
||||||
|
* text: 'Make a Similar Image',
|
||||||
|
* on_click: function(origRequest, image) {
|
||||||
|
* let newTaskRequest = getCurrentUserRequest()
|
||||||
|
* newTaskRequest.reqBody = Object.assign({}, origRequest, {
|
||||||
|
* init_image: image.src,
|
||||||
|
* prompt_strength: 0.7,
|
||||||
|
* seed: Math.floor(Math.random() * 10000000)
|
||||||
|
* })
|
||||||
|
* newTaskRequest.seed = newTaskRequest.reqBody.seed
|
||||||
|
* createTask(newTaskRequest)
|
||||||
|
* },
|
||||||
|
* filter: function(origRequest, image) {
|
||||||
|
* // this is an optional function. return true/false to show/hide the button
|
||||||
|
* // if this function isn't set, the button will always be visible
|
||||||
|
* return true
|
||||||
|
* }
|
||||||
|
* })
|
||||||
|
*/
|
||||||
|
IMAGE_INFO_BUTTONS: []
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadUIPlugins() {
|
||||||
|
try {
|
||||||
|
let res = await fetch('/get/ui_plugins')
|
||||||
|
if (res.status === 200) {
|
||||||
|
res = await res.json()
|
||||||
|
res.forEach(pluginPath => {
|
||||||
|
let script = document.createElement('script')
|
||||||
|
script.src = pluginPath + '?t=' + Date.now()
|
||||||
|
|
||||||
|
console.log('loading plugin', pluginPath)
|
||||||
|
|
||||||
|
document.head.appendChild(script)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('error fetching plugin paths', e)
|
||||||
|
}
|
||||||
|
}
|
73
ui/media/js/themes.js
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
const themeField = document.getElementById("theme");
|
||||||
|
var DEFAULT_THEME = {};
|
||||||
|
var THEMES = []; // initialized in initTheme from data in css
|
||||||
|
|
||||||
|
function getThemeName(theme) {
|
||||||
|
theme = theme.replace("theme-", "");
|
||||||
|
theme = theme.split("-").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
// init themefield
|
||||||
|
function initTheme() {
|
||||||
|
Array.from(document.styleSheets)
|
||||||
|
.filter(sheet => sheet.href?.startsWith(window.location.origin))
|
||||||
|
.flatMap(sheet => Array.from(sheet.cssRules))
|
||||||
|
.forEach(rule => {
|
||||||
|
var selector = rule.selectorText; // TODO: also do selector == ":root", re-run un-set props
|
||||||
|
if (selector && selector.startsWith(".theme-")) {
|
||||||
|
var theme_key = selector.substring(1);
|
||||||
|
THEMES.push({
|
||||||
|
key: theme_key,
|
||||||
|
name: getThemeName(theme_key),
|
||||||
|
rule: rule
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (selector && selector == ":root") {
|
||||||
|
DEFAULT_THEME = {
|
||||||
|
key: "theme-default",
|
||||||
|
name: "Default",
|
||||||
|
rule: rule
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
THEMES.forEach(theme => {
|
||||||
|
var new_option = document.createElement("option");
|
||||||
|
new_option.setAttribute("value", theme.key);
|
||||||
|
new_option.innerText = theme.name;
|
||||||
|
themeField.appendChild(new_option);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// setup the style transitions a second after app initializes, so initial style is instant
|
||||||
|
setTimeout(() => {
|
||||||
|
var body = document.querySelector("body");
|
||||||
|
var style = document.createElement('style');
|
||||||
|
style.innerHTML = "* { transition: background 0.5s, color 0.5s, background-color 0.5s; }";
|
||||||
|
body.appendChild(style);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
initTheme();
|
||||||
|
|
||||||
|
function themeFieldChanged() {
|
||||||
|
var theme_key = themeField.value;
|
||||||
|
|
||||||
|
var body = document.querySelector("body");
|
||||||
|
body.classList.remove(...THEMES.map(theme => theme.key));
|
||||||
|
body.classList.add(theme_key);
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
body.style = "";
|
||||||
|
var theme = THEMES.find(t => t.key == theme_key);
|
||||||
|
if (theme) {
|
||||||
|
// refresh variables incase they are back referencing
|
||||||
|
Array.from(DEFAULT_THEME.rule.style)
|
||||||
|
.filter(cssVariable => !Array.from(theme.rule.style).includes(cssVariable))
|
||||||
|
.forEach(cssVariable => {
|
||||||
|
body.style.setProperty(cssVariable, DEFAULT_THEME.rule.style.getPropertyValue(cssVariable));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
themeField.addEventListener('change', themeFieldChanged);
|
356
ui/media/js/utils.js
Normal file
@ -0,0 +1,356 @@
|
|||||||
|
// https://gomakethings.com/finding-the-next-and-previous-sibling-elements-that-match-a-selector-with-vanilla-js/
|
||||||
|
function getNextSibling(elem, selector) {
|
||||||
|
// Get the next sibling element
|
||||||
|
var sibling = elem.nextElementSibling
|
||||||
|
|
||||||
|
// If there's no selector, return the first sibling
|
||||||
|
if (!selector) return sibling
|
||||||
|
|
||||||
|
// If the sibling matches our selector, use it
|
||||||
|
// If not, jump to the next sibling and continue the loop
|
||||||
|
while (sibling) {
|
||||||
|
if (sibling.matches(selector)) return sibling
|
||||||
|
sibling = sibling.nextElementSibling
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Panel Stuff */
|
||||||
|
|
||||||
|
// true = open
|
||||||
|
var COLLAPSIBLES_INITIALIZED = false;
|
||||||
|
const COLLAPSIBLES_KEY = "collapsibles";
|
||||||
|
const COLLAPSIBLE_PANELS = []; // filled in by createCollapsibles with all the elements matching .collapsible
|
||||||
|
|
||||||
|
// on-init call this for any panels that are marked open
|
||||||
|
function toggleCollapsible(element) {
|
||||||
|
var collapsibleHeader = element.querySelector(".collapsible");
|
||||||
|
var handle = element.querySelector(".collapsible-handle");
|
||||||
|
collapsibleHeader.classList.toggle("active")
|
||||||
|
let content = getNextSibling(collapsibleHeader, '.collapsible-content')
|
||||||
|
if (content.style.display === "block") {
|
||||||
|
content.style.display = "none"
|
||||||
|
handle.innerHTML = '➕' // plus
|
||||||
|
} else {
|
||||||
|
content.style.display = "block"
|
||||||
|
handle.innerHTML = '➖' // minus
|
||||||
|
}
|
||||||
|
|
||||||
|
if (COLLAPSIBLES_INITIALIZED && COLLAPSIBLE_PANELS.includes(element)) {
|
||||||
|
saveCollapsibles()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCollapsibles() {
|
||||||
|
var values = {}
|
||||||
|
COLLAPSIBLE_PANELS.forEach(element => {
|
||||||
|
var value = element.querySelector(".collapsible").className.indexOf("active") !== -1
|
||||||
|
values[element.id] = value
|
||||||
|
})
|
||||||
|
localStorage.setItem(COLLAPSIBLES_KEY, JSON.stringify(values))
|
||||||
|
}
|
||||||
|
|
||||||
|
function createCollapsibles(node) {
|
||||||
|
var save = false
|
||||||
|
if (!node) {
|
||||||
|
node = document
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
let collapsibles = node.querySelectorAll(".collapsible")
|
||||||
|
collapsibles.forEach(function(c) {
|
||||||
|
if (save && c.parentElement.id) {
|
||||||
|
COLLAPSIBLE_PANELS.push(c.parentElement)
|
||||||
|
}
|
||||||
|
let handle = document.createElement('span')
|
||||||
|
handle.className = 'collapsible-handle'
|
||||||
|
|
||||||
|
if (c.className.indexOf('active') !== -1) {
|
||||||
|
handle.innerHTML = '➖' // minus
|
||||||
|
} else {
|
||||||
|
handle.innerHTML = '➕' // plus
|
||||||
|
}
|
||||||
|
c.insertBefore(handle, c.firstChild)
|
||||||
|
|
||||||
|
c.addEventListener('click', function() {
|
||||||
|
toggleCollapsible(c.parentElement)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (save) {
|
||||||
|
var saved = localStorage.getItem(COLLAPSIBLES_KEY)
|
||||||
|
if (!saved) {
|
||||||
|
saved = tryLoadOldCollapsibles();
|
||||||
|
}
|
||||||
|
if (!saved) {
|
||||||
|
saveCollapsibles()
|
||||||
|
saved = localStorage.getItem(COLLAPSIBLES_KEY)
|
||||||
|
}
|
||||||
|
var values = JSON.parse(saved)
|
||||||
|
COLLAPSIBLE_PANELS.forEach(element => {
|
||||||
|
var value = element.querySelector(".collapsible").className.indexOf("active") !== -1
|
||||||
|
if (values[element.id] != value) {
|
||||||
|
toggleCollapsible(element)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
COLLAPSIBLES_INITIALIZED = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryLoadOldCollapsibles() {
|
||||||
|
var old_map = {
|
||||||
|
"advancedPanelOpen": "editor-settings",
|
||||||
|
"modifiersPanelOpen": "editor-modifiers",
|
||||||
|
"negativePromptPanelOpen": "editor-inputs-prompt"
|
||||||
|
};
|
||||||
|
if (localStorage.getItem(Object.keys(old_map)[0])) {
|
||||||
|
var result = {};
|
||||||
|
Object.keys(old_map).forEach(key => {
|
||||||
|
var value = localStorage.getItem(key);
|
||||||
|
if (value !== null) {
|
||||||
|
result[old_map[key]] = value == true || value == "true"
|
||||||
|
localStorage.removeItem(key)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result = JSON.stringify(result)
|
||||||
|
localStorage.setItem(COLLAPSIBLES_KEY, result)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function permute(arr) {
|
||||||
|
let permutations = []
|
||||||
|
let n = arr.length
|
||||||
|
let n_permutations = Math.pow(2, n)
|
||||||
|
for (let i = 0; i < n_permutations; i++) {
|
||||||
|
let perm = []
|
||||||
|
let mask = Number(i).toString(2).padStart(n, '0')
|
||||||
|
|
||||||
|
for (let idx = 0; idx < mask.length; idx++) {
|
||||||
|
if (mask[idx] === '1' && arr[idx].trim() !== '') {
|
||||||
|
perm.push(arr[idx])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (perm.length > 0) {
|
||||||
|
permutations.push(perm)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return permutations
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/a/8212878
|
||||||
|
function millisecondsToStr(milliseconds) {
|
||||||
|
function numberEnding (number) {
|
||||||
|
return (number > 1) ? 's' : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = Math.floor(milliseconds / 1000)
|
||||||
|
var hours = Math.floor((temp %= 86400) / 3600)
|
||||||
|
var s = ''
|
||||||
|
if (hours) {
|
||||||
|
s += hours + ' hour' + numberEnding(hours) + ' '
|
||||||
|
}
|
||||||
|
var minutes = Math.floor((temp %= 3600) / 60)
|
||||||
|
if (minutes) {
|
||||||
|
s += minutes + ' minute' + numberEnding(minutes) + ' '
|
||||||
|
}
|
||||||
|
var seconds = temp % 60
|
||||||
|
if (!hours && minutes < 4 && seconds) {
|
||||||
|
s += seconds + ' second' + numberEnding(seconds)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://rosettacode.org/wiki/Brace_expansion#JavaScript
|
||||||
|
function BraceExpander() {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
// Index of any closing brace matching the opening
|
||||||
|
// brace at iPosn,
|
||||||
|
// with the indices of any immediately-enclosed commas.
|
||||||
|
function bracePair(tkns, iPosn, iNest, lstCommas) {
|
||||||
|
if (iPosn >= tkns.length || iPosn < 0) return null;
|
||||||
|
|
||||||
|
var t = tkns[iPosn],
|
||||||
|
n = (t === '{') ? (
|
||||||
|
iNest + 1
|
||||||
|
) : (t === '}' ? (
|
||||||
|
iNest - 1
|
||||||
|
) : iNest),
|
||||||
|
lst = (t === ',' && iNest === 1) ? (
|
||||||
|
lstCommas.concat(iPosn)
|
||||||
|
) : lstCommas;
|
||||||
|
|
||||||
|
return n ? bracePair(tkns, iPosn + 1, n, lst) : {
|
||||||
|
close: iPosn,
|
||||||
|
commas: lst
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse of a SYNTAGM subtree
|
||||||
|
function andTree(dctSofar, tkns) {
|
||||||
|
if (!tkns.length) return [dctSofar, []];
|
||||||
|
|
||||||
|
var dctParse = dctSofar ? dctSofar : {
|
||||||
|
fn: and,
|
||||||
|
args: []
|
||||||
|
},
|
||||||
|
|
||||||
|
head = tkns[0],
|
||||||
|
tail = head ? tkns.slice(1) : [],
|
||||||
|
|
||||||
|
dctBrace = head === '{' ? bracePair(
|
||||||
|
tkns, 0, 0, []
|
||||||
|
) : null,
|
||||||
|
|
||||||
|
lstOR = dctBrace && (
|
||||||
|
dctBrace.close
|
||||||
|
) && dctBrace.commas.length ? (
|
||||||
|
splitAt(dctBrace.close + 1, tkns)
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
return andTree({
|
||||||
|
fn: and,
|
||||||
|
args: dctParse.args.concat(
|
||||||
|
lstOR ? (
|
||||||
|
orTree(dctParse, lstOR[0], dctBrace.commas)
|
||||||
|
) : head
|
||||||
|
)
|
||||||
|
}, lstOR ? (
|
||||||
|
lstOR[1]
|
||||||
|
) : tail);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse of a PARADIGM subtree
|
||||||
|
function orTree(dctSofar, tkns, lstCommas) {
|
||||||
|
if (!tkns.length) return [dctSofar, []];
|
||||||
|
var iLast = lstCommas.length;
|
||||||
|
|
||||||
|
return {
|
||||||
|
fn: or,
|
||||||
|
args: splitsAt(
|
||||||
|
lstCommas, tkns
|
||||||
|
).map(function (x, i) {
|
||||||
|
var ts = x.slice(
|
||||||
|
1, i === iLast ? (
|
||||||
|
-1
|
||||||
|
) : void 0
|
||||||
|
);
|
||||||
|
|
||||||
|
return ts.length ? ts : [''];
|
||||||
|
}).map(function (ts) {
|
||||||
|
return ts.length > 1 ? (
|
||||||
|
andTree(null, ts)[0]
|
||||||
|
) : ts[0];
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of unescaped braces and commas, and remaining strings
|
||||||
|
function tokens(str) {
|
||||||
|
// Filter function excludes empty splitting artefacts
|
||||||
|
var toS = function (x) {
|
||||||
|
return x.toString();
|
||||||
|
};
|
||||||
|
|
||||||
|
return str.split(/(\\\\)/).filter(toS).reduce(function (a, s) {
|
||||||
|
return a.concat(s.charAt(0) === '\\' ? s : s.split(
|
||||||
|
/(\\*[{,}])/
|
||||||
|
).filter(toS));
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// PARSE TREE OPERATOR (1 of 2)
|
||||||
|
// Each possible head * each possible tail
|
||||||
|
function and(args) {
|
||||||
|
var lng = args.length,
|
||||||
|
head = lng ? args[0] : null,
|
||||||
|
lstHead = "string" === typeof head ? (
|
||||||
|
[head]
|
||||||
|
) : head;
|
||||||
|
|
||||||
|
return lng ? (
|
||||||
|
1 < lng ? lstHead.reduce(function (a, h) {
|
||||||
|
return a.concat(
|
||||||
|
and(args.slice(1)).map(function (t) {
|
||||||
|
return h + t;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}, []) : lstHead
|
||||||
|
) : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// PARSE TREE OPERATOR (2 of 2)
|
||||||
|
// Each option flattened
|
||||||
|
function or(args) {
|
||||||
|
return args.reduce(function (a, b) {
|
||||||
|
return a.concat(b);
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// One list split into two (first sublist length n)
|
||||||
|
function splitAt(n, lst) {
|
||||||
|
return n < lst.length + 1 ? [
|
||||||
|
lst.slice(0, n), lst.slice(n)
|
||||||
|
] : [lst, []];
|
||||||
|
}
|
||||||
|
|
||||||
|
// One list split into several (sublist lengths [n])
|
||||||
|
function splitsAt(lstN, lst) {
|
||||||
|
return lstN.reduceRight(function (a, x) {
|
||||||
|
return splitAt(x, a[0]).concat(a.slice(1));
|
||||||
|
}, [lst]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Value of the parse tree
|
||||||
|
function evaluated(e) {
|
||||||
|
return typeof e === 'string' ? e :
|
||||||
|
e.fn(e.args.map(evaluated));
|
||||||
|
}
|
||||||
|
|
||||||
|
// JSON prettyprint (for parse tree, token list etc)
|
||||||
|
function pp(e) {
|
||||||
|
return JSON.stringify(e, function (k, v) {
|
||||||
|
return typeof v === 'function' ? (
|
||||||
|
'[function ' + v.name + ']'
|
||||||
|
) : v;
|
||||||
|
}, 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------- MAIN ------------------------
|
||||||
|
|
||||||
|
// s -> [s]
|
||||||
|
this.expand = function(s) {
|
||||||
|
// BRACE EXPRESSION PARSED
|
||||||
|
var dctParse = andTree(null, tokens(s))[0];
|
||||||
|
|
||||||
|
// ABSTRACT SYNTAX TREE LOGGED
|
||||||
|
// console.log(pp(dctParse));
|
||||||
|
|
||||||
|
// AST EVALUATED TO LIST OF STRINGS
|
||||||
|
return evaluated(dctParse);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function asyncDelay(timeout) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
setTimeout(resolve, timeout, true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function preventNonNumericalInput(e) {
|
||||||
|
e = e || window.event;
|
||||||
|
let charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
|
||||||
|
let charStr = String.fromCharCode(charCode);
|
||||||
|
let re = e.target.getAttribute('pattern') || '^[0-9]+$'
|
||||||
|
re = new RegExp(re)
|
||||||
|
|
||||||
|
if (!charStr.match(re)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
BIN
ui/media/modifier-thumbnails/artist/artstation/landscape-0.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
ui/media/modifier-thumbnails/artist/artstation/portrait-0.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 33 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_alex_grey/landscape-0.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_alex_grey/portrait-0.jpg
Normal file
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 41 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_artgerm/landscape-0.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_artgerm/portrait-0.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 44 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_banksy/landscape-0.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_banksy/portrait-0.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_beeple/landscape-0.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_beeple/portrait-0.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 47 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_chris_foss/portrait-0.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 38 KiB |
BIN
ui/media/modifier-thumbnails/artist/by_david_mann/portrait-0.jpg
Normal file
After Width: | Height: | Size: 38 KiB |