Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import re
|
3 |
#from tempfile import NamedTemporaryFile
|
4 |
import numpy as np
|
@@ -20,7 +21,7 @@ model_id = "stabilityai/stable-diffusion-3-medium-diffusers"
|
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
if torch.cuda.is_available():
|
22 |
torch.cuda.max_memory_allocated(device=device)
|
23 |
-
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
24 |
pipe = pipe.to(device)
|
25 |
else:
|
26 |
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, use_safetensors=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
import re
|
4 |
#from tempfile import NamedTemporaryFile
|
5 |
import numpy as np
|
|
|
21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
22 |
if torch.cuda.is_available():
|
23 |
torch.cuda.max_memory_allocated(device=device)
|
24 |
+
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True, token=os.getenv('token'))
|
25 |
pipe = pipe.to(device)
|
26 |
else:
|
27 |
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, use_safetensors=True)
|