Spaces:
Runtime error
Runtime error
Commit ·
ce9d54d
1
Parent(s): bb38282
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,8 @@ from diffusers import StableDiffusionPipeline
|
|
| 5 |
from PIL import Image
|
| 6 |
from huggingface_hub import notebook_login
|
| 7 |
#if not (Path.home()/'.huggingface'/'token').exists():
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
token = os.environ.get("HUGGING_FACE_HUB_TOKEN")
|
| 11 |
-
|
| 12 |
|
| 13 |
import torch, logging
|
| 14 |
logging.disable(logging.WARNING)
|
|
@@ -24,7 +22,7 @@ model_id = "CompVis/stable-diffusion-v1-4"
|
|
| 24 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 25 |
context = autocast if device == "cuda" else nullcontext
|
| 26 |
|
| 27 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, revision="fp16",torch_dtype=torch.float16,
|
| 28 |
|
| 29 |
|
| 30 |
def infer(prompt,samples):
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
from huggingface_hub import notebook_login
|
| 7 |
#if not (Path.home()/'.huggingface'/'token').exists():
|
| 8 |
+
#token = os.environ.get("HUGGING_FACE_HUB_TOKEN")
|
| 9 |
+
token = "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"
|
|
|
|
|
|
|
| 10 |
|
| 11 |
import torch, logging
|
| 12 |
logging.disable(logging.WARNING)
|
|
|
|
| 22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
context = autocast if device == "cuda" else nullcontext
|
| 24 |
|
| 25 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, revision="fp16",torch_dtype=torch.float16,use_auth_token=token).to(device)
|
| 26 |
|
| 27 |
|
| 28 |
def infer(prompt,samples):
|