Spaces:
Runtime error
Runtime error
Update app_sd.py
Browse files
app_sd.py
CHANGED
|
@@ -6,6 +6,9 @@ from io import BytesIO
|
|
| 6 |
|
| 7 |
from diffusers import StableDiffusionImg2ImgPipeline
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
# load the pipeline
|
| 10 |
device = "cuda"
|
| 11 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
|
@@ -13,7 +16,7 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
|
| 13 |
model_id_or_path,
|
| 14 |
revision="fp16",
|
| 15 |
torch_dtype=torch.float16,
|
| 16 |
-
use_auth_token=
|
| 17 |
)
|
| 18 |
# or download via git clone https://huggingface.co/CompVis/stable-diffusion-v1-4
|
| 19 |
# and pass `model_id_or_path="./stable-diffusion-v1-4"` without having to use `use_auth_token=True`.
|
|
|
|
| 6 |
|
| 7 |
from diffusers import StableDiffusionImg2ImgPipeline
|
| 8 |
|
| 9 |
+
import os
|
| 10 |
+
MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
|
| 11 |
+
YOUR_TOKEN=MY_SECRET_TOKEN
|
| 12 |
# load the pipeline
|
| 13 |
device = "cuda"
|
| 14 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
|
|
|
| 16 |
model_id_or_path,
|
| 17 |
revision="fp16",
|
| 18 |
torch_dtype=torch.float16,
|
| 19 |
+
use_auth_token=YOUR_TOKEN
|
| 20 |
)
|
| 21 |
# or download via git clone https://huggingface.co/CompVis/stable-diffusion-v1-4
|
| 22 |
# and pass `model_id_or_path="./stable-diffusion-v1-4"` without having to use `use_auth_token=True`.
|