Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from diffusers import
|
| 3 |
import torch
|
| 4 |
import os
|
| 5 |
|
| 6 |
-
|
| 7 |
-
model_id = "Kotiko-ua/tryondiffusion-model"
|
| 8 |
token = os.getenv("HF_TOKEN")
|
| 9 |
|
| 10 |
-
pipe =
|
| 11 |
-
|
| 12 |
-
use_auth_token=token
|
| 13 |
-
torch_dtype=torch.float16
|
| 14 |
)
|
|
|
|
| 15 |
pipe = pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
|
| 17 |
def try_on(person_img, cloth_img):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from diffusers import DiffusionPipeline
|
| 3 |
import torch
|
| 4 |
import os
|
| 5 |
|
|
|
|
|
|
|
| 6 |
token = os.getenv("HF_TOKEN")
|
| 7 |
|
| 8 |
+
pipe = DiffusionPipeline.from_pretrained(
|
| 9 |
+
"Kotiko-ua/tryondiffusion-model",
|
| 10 |
+
use_auth_token=token # if the repo is gated
|
|
|
|
| 11 |
)
|
| 12 |
+
|
| 13 |
pipe = pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
|
| 15 |
def try_on(person_img, cloth_img):
|