echoece commited on
Commit
3e26252
·
verified ·
1 Parent(s): e602c60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -2,9 +2,14 @@ import gradio as gr
2
  from diffusers import StableDiffusionPipeline
3
  import torch
4
 
5
- # ⚠️ You can replace this with any try-on model, e.g. akhaliq/TryOnDiffusion
6
- model_id = "lllyasviel/TryOnDiffusion" # public
7
- pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
 
 
 
 
 
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):