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
Copy file name to clipboardExpand all lines: README.md
+61-4Lines changed: 61 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,64 @@ See the [model card](https://huggingface.co/CompVis/stable-diffusion) for more i
41
41
42
42
You need to accept the model license before downloading or using the Stable Diffusion weights. Please, visit the [model card](https://huggingface.co/CompVis/stable-diffusion-v1-3), read the license and tick the checkbox if you agree. You have to be a registered user in 🤗 Hugging Face Hub, and you'll also need to use an access token for the code to work. For more information on access tokens, please refer to [this section](https://huggingface.co/docs/hub/security-tokens) of the documentation.
43
43
44
+
44
45
### Text-to-Image generation with Stable Diffusion
45
46
46
47
```python
47
48
# make sure you're logged in with `huggingface-cli login`
48
49
from torch import autocast
49
-
import torch
50
-
from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler
Copy file name to clipboardExpand all lines: src/diffusers/pipelines/stable_diffusion/README.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ The summary of the model is the following:
12
12
13
13
- Stable Diffusion has the same architecture as [Latent Diffusion](https://arxiv.org/abs/2112.10752) but uses a frozen CLIP Text Encoder instead of training the text encoder jointly with the diffusion model.
14
14
- An in-detail explanation of the Stable Diffusion model can be found under [Stable Diffusion with 🧨 Diffusers](https://huggingface.co/blog/stable_diffusion).
15
+
- If you don't want to rely on the Hugging Face Hub and having to pass a authentification token, you can
16
+
download the weights with `git lfs install; git clone https://huggingface.co/CompVis/stable-diffusion-v1-4` and instead pass the local path to the cloned folder to `from_pretrained` as shown below.
15
17
- Stable Diffusion can work with a variety of different samplers as is shown below.
16
18
17
19
## Available Pipelines:
@@ -24,6 +26,35 @@ The summary of the model is the following:
24
26
25
27
## Examples:
26
28
29
+
### Using Stable Diffusion without being logged into the Hub.
30
+
31
+
If you want to download the model weights using a single Python line, you need to pass the token
32
+
to `use_auth_token` or be logged in via `huggingface-cli login`.
33
+
For more information on access tokens, please refer to [this section](https://huggingface.co/docs/hub/security-tokens) of the documentation.
34
+
35
+
Assuming your token is stored under YOUR_TOKEN, you can download the stable diffusion pipeline as follows:
This however can make it difficult to build applications on top of `diffusers` as you will always have to pass the token around. A potential way to solve this issue is by downloading the weights to a local path `"./stable-diffusion-v1-4"`:
0 commit comments