Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,14 @@ import gradio as gr
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import torch
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
pipe = pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
|
| 10 |
def try_on(person_img, cloth_img):
|
|
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
model_id = "lllyasviel/TryOnDiffusion"
|
| 6 |
+
token = os.getenv("HF_TOKEN")
|
| 7 |
+
|
| 8 |
+
pipe = StableDiffusionPipeline.from_pretrained(
|
| 9 |
+
model_id,
|
| 10 |
+
use_auth_token=token,
|
| 11 |
+
torch_dtype=torch.float16
|
| 12 |
+
)
|
| 13 |
pipe = pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
|
| 15 |
def try_on(person_img, cloth_img):
|