You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This merge adds the following major features:
* Support for image variations.
* Security fix for webGUI (binds to localhost by default, use
--host=0.0.0.0 to allow access from external interface.
* Scalable configs/models.yaml configuration file for adding more
models as they become available.
* More tuning and exception handling for M1 hardware running MPS.
* Various documentation fixes.
You have to have macOS 12.3 Monterey or later. Anything earlier than that won't work.
10
+
*I haven't tested any of this on Intel Macs but I have read that one person got
11
+
it to work, so Apple Silicon might not be requried.
14
12
15
-
Tested on a 2022 Macbook M2 Air with 10-core GPU and 24 GB unified memory.
13
+
Things have moved really fast and so these instructions change often and are
14
+
often out-of-date. One of the problems is that there are so many different ways to
15
+
run this.
16
16
17
-
How to:
17
+
We are trying to build a testing setup so that when we make changes it doesn't
18
+
always break.
19
+
20
+
How to (this hasn't been 100% tested yet):
21
+
22
+
First get the weights checkpoint download started - it's big:
23
+
24
+
1. Sign up at https://huggingface.co
25
+
2. Go to the [Stable diffusion diffusion model page](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original)
26
+
3. Accept the terms and click Access Repository:
27
+
4. Download [sd-v1-4.ckpt (4.27 GB)](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt) and note where you have saved it (probably the Downloads folder)
28
+
29
+
While that is downloading, open Terminal and run the following commands one at a time.
If `conda env create -f environment-mac.yaml` takes forever run this.
100
+
101
+
git clean -f
102
+
103
+
And run this.
56
104
57
105
conda clean --yes --all
58
106
59
-
Or you can reset Anaconda.
107
+
Or you could reset Anaconda.
60
108
61
109
conda update --force-reinstall -y -n base -c defaults conda
62
110
63
-
### "No module named cv2" (or some other module)
111
+
### "No module named cv2", torch, 'ldm', 'transformers', 'taming', etc.
112
+
113
+
There are several causes of these errors.
64
114
65
-
Did you remember to `conda activate ldm`? If your terminal prompt
115
+
First, did you remember to `conda activate ldm`? If your terminal prompt
66
116
begins with "(ldm)" then you activated it. If it begins with "(base)"
67
117
or something else you haven't.
68
118
69
-
If it says you're missing taming you need to rebuild your virtual
119
+
Second, you might've run `./scripts/preload_models.py` or `./scripts/dream.py`
120
+
instead of `python ./scripts/preload_models.py` or `python ./scripts/dream.py`.
121
+
The cause of this error is long so it's below.
122
+
123
+
Third, if it says you're missing taming you need to rebuild your virtual
70
124
environment.
71
125
72
126
conda env remove -n ldm
73
127
conda env create -f environment-mac.yaml
74
128
75
-
If you have activated the ldm virtual environment and tried rebuilding
129
+
Fourth, If you have activated the ldm virtual environment and tried rebuilding
76
130
it, maybe the problem could be that I have something installed that
77
131
you don't and you'll just need to manually install it. Make sure you
78
132
activate the virtual environment so it installs there instead of
@@ -83,6 +137,56 @@ globally.
83
137
84
138
You might also need to install Rust (I mention this again below).
85
139
140
+
### How many snakes are living in your computer?
141
+
142
+
Here's the reason why you have to specify which python to use.
143
+
There are several versions of python on macOS and the computer is
144
+
picking the wrong one. More specifically, preload_models.py and dream.py says to
145
+
find the first `python3` in the path environment variable. You can see which one
146
+
it is picking with `which python3`. These are the mostly likely paths you'll see.
147
+
148
+
% which python3
149
+
/usr/bin/python3
150
+
151
+
The above path is part of the OS. However, that path is a stub that asks you if
152
+
you want to install Xcode. If you have Xcode installed already,
153
+
/usr/bin/python3 will execute /Library/Developer/CommandLineTools/usr/bin/python3 or
154
+
/Applications/Xcode.app/Contents/Developer/usr/bin/python3 (depending on which
155
+
Xcode you've selected with `xcode-select`).
156
+
157
+
% which python3
158
+
/opt/homebrew/bin/python3
159
+
160
+
If you installed python3 with Homebrew and you've modified your path to search
161
+
for Homebrew binaries before system ones, you'll see the above path.
162
+
163
+
% which python
164
+
/opt/anaconda3/bin/python
165
+
166
+
If you drop the "3" you get an entirely different python. Note: starting in
167
+
macOS 12.3, /usr/bin/python no longer exists (it was python 2 anyway).
168
+
169
+
If you have Anaconda installed, this is what you'll see. There is a
170
+
/opt/anaconda3/bin/python3 also.
171
+
172
+
(ldm) % which python
173
+
/Users/name/miniforge3/envs/ldm/bin/python
174
+
175
+
This is what you'll see if you have miniforge and you've correctly activated
176
+
the ldm environment. This is the goal.
177
+
178
+
It's all a mess and you should know [how to modify the path environment variable](https://support.apple.com/guide/terminal/use-environment-variables-apd382cc5fa-4f58-4449-b20a-41c53c006f8f/mac)
179
+
if you want to fix it. Here's a brief hint of all the ways you can modify it
180
+
(don't really have the time to explain it all here).
181
+
182
+
-~/.zshrc
183
+
-~/.bash_profile
184
+
-~/.bashrc
185
+
- /etc/paths.d
186
+
- /etc/path
187
+
188
+
Which one you use will depend on what you have installed except putting a file
189
+
in /etc/paths.d is what I prefer to do.
86
190
87
191
### Debugging?
88
192
@@ -139,7 +243,7 @@ the environment variable `CONDA_SUBDIR=osx-arm64`, like so:
139
243
This error happens with Anaconda on Macs when the Intel-only `mkl` is pulled in by
140
244
a dependency. [nomkl](https://stackoverflow.com/questions/66224879/what-is-the-nomkl-python-package-used-for)
141
245
is a metapackage designed to prevent this, by making it impossible to install
142
-
`mkl`, but if your environment is already broken it may not work.
246
+
`mkl`, but if your environment is already broken it may not work.
143
247
144
248
Do *not* use `os.environ['KMP_DUPLICATE_LIB_OK']='True'` or equivalents as this
145
249
masks the underlying issue of using Intel packages.
@@ -207,7 +311,7 @@ change instead. This is a 32-bit vs 16-bit problem.
207
311
What? Intel? On an Apple Silicon?
208
312
209
313
Intel MKL FATAL ERROR: This system does not meet the minimum requirements for use of the Intel(R) Math Kernel Library.
210
-
The processor must support the Intel(R) Supplemental Streaming SIMD Extensions 3 (Intel(R) SSSE3) instructions.██████████████| 50/50 [02:25<00:00, 2.53s/it]
314
+
The processor must support the Intel(R) Supplemental Streaming SIMD Extensions 3 (Intel(R) SSSE3) instructions.
211
315
The processor must support the Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) instructions.
212
316
The processor must support the Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
4. A notebook for running the code on Google Colab.
28
+
29
29
5. Upscaling and face fixing using the optional ESRGAN and GFPGAN
30
30
packages.
31
31
32
32
6. Weighted subprompts for prompt tuning.
33
33
34
-
7. Textual inversion for customization of the prompt language and images.
34
+
7.[Image variations](VARIATIONS.md) which allow you to systematically
35
+
generate variations of an image you like and combine two or more
36
+
images together to combine the best features of both.
37
+
38
+
8. Textual inversion for customization of the prompt language and images.
35
39
36
40
8. ...and more!
37
41
@@ -42,8 +46,11 @@ improvements and bug fixes.
42
46
# Table of Contents
43
47
44
48
1.[Major Features](#features)
45
-
2.[Changelog](#latest)
49
+
2.[Changelog](#latest-changes)
46
50
3.[Installation](#installation)
51
+
1.[Linux](#linux)
52
+
1.[Windows](#windows)
53
+
1.[MacOS](README-Mac-MPS.md)
47
54
4.[Troubleshooting](#troubleshooting)
48
55
5.[Contributing](#contributing)
49
56
6.[Support](#support)
@@ -331,8 +338,10 @@ and introducing a new vocabulary to the fixed model.
331
338
332
339
To train, prepare a folder that contains images sized at 512x512 and execute the following:
333
340
341
+
342
+
WINDOWS: As the default backend is not available on Windows, if you're using that platform, set the environment variable `PL_TORCH_DISTRIBUTED_BACKEND=gloo`
343
+
334
344
```
335
-
# As the default backend is not available on Windows, if you're using that platform, execute SET PL_TORCH_DISTRIBUTED_BACKEND=gloo
0 commit comments