Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,9 @@ import spaces
|
|
| 11 |
import torch
|
| 12 |
from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline, StableDiffusionXLPipeline, StableDiffusionXLInpaintPipeline, EulerAncestralDiscreteScheduler, DPMSolverSinglestepScheduler
|
| 13 |
from diffusers.utils import load_image
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
DESCRIPTION = """
|
| 16 |
# [Fluently Playground](https://huggingface.co/fluently)
|
|
@@ -29,8 +32,8 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
| 29 |
|
| 30 |
|
| 31 |
if torch.cuda.is_available():
|
| 32 |
-
pipe_xl_final = StableDiffusionXLPipeline.
|
| 33 |
-
"fluently/Fluently-XL-Final",
|
| 34 |
torch_dtype=torch.float16,
|
| 35 |
use_safetensors=True,
|
| 36 |
)
|
|
|
|
| 11 |
import torch
|
| 12 |
from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline, StableDiffusionXLPipeline, StableDiffusionXLInpaintPipeline, EulerAncestralDiscreteScheduler, DPMSolverSinglestepScheduler
|
| 13 |
from diffusers.utils import load_image
|
| 14 |
+
from huggingface_hub import hf_hub_download
|
| 15 |
+
|
| 16 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 17 |
|
| 18 |
DESCRIPTION = """
|
| 19 |
# [Fluently Playground](https://huggingface.co/fluently)
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
if torch.cuda.is_available():
|
| 35 |
+
pipe_xl_final = StableDiffusionXLPipeline.from_single_file(
|
| 36 |
+
hf_hub_download(repo_id="fluently/Fluently-XL-Final", filename="FluentlyXL-Final.safetensors", token=HF_TOKEN),
|
| 37 |
torch_dtype=torch.float16,
|
| 38 |
use_safetensors=True,
|
| 39 |
)
|