Spaces:
Paused
Paused
test gradio
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import spaces
|
|
7 |
from diffusers.utils import load_image, make_image_grid
|
8 |
import torch
|
9 |
from diffusers import StableDiffusionXLAdapterPipeline,T2IAdapter
|
10 |
-
from diffusers.models import T2IAdapter
|
11 |
from diffusers.schedulers import UniPCMultistepScheduler
|
12 |
|
13 |
# Log in to Hugging Face with your token
|
@@ -15,13 +14,12 @@ token = os.getenv("HF_TOKEN")
|
|
15 |
login(token=token)
|
16 |
|
17 |
|
18 |
-
|
19 |
-
# Load the T2I-Style Adapter and the SDXL pipeline
|
20 |
-
adapter = T2IAdapter.from_pretrained("TencentARC/t2i-adapter-style-sdxl")
|
21 |
pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
|
22 |
-
"stabilityai/
|
23 |
-
adapter=adapter,
|
24 |
)
|
|
|
|
|
|
|
25 |
|
26 |
# Set up the scheduler and device
|
27 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
|
|
7 |
from diffusers.utils import load_image, make_image_grid
|
8 |
import torch
|
9 |
from diffusers import StableDiffusionXLAdapterPipeline,T2IAdapter
|
|
|
10 |
from diffusers.schedulers import UniPCMultistepScheduler
|
11 |
|
12 |
# Log in to Hugging Face with your token
|
|
|
14 |
login(token=token)
|
15 |
|
16 |
|
|
|
|
|
|
|
17 |
pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
|
18 |
+
"stabilityai/sdxl-turbo",
|
|
|
19 |
)
|
20 |
+
pipe.load_ip_adapter("TencentARC/T2I-Adapter",
|
21 |
+
subfolder="models",
|
22 |
+
weight_name="t2iadapter_style_sd14v1.pth")
|
23 |
|
24 |
# Set up the scheduler and device
|
25 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|