gengs commited on
Commit
4bdd10f
1 Parent(s): b8c5f04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -2,6 +2,14 @@ import gradio as gr
2
  from diffusers import StableDiffusion3Pipeline
3
  import torch
4
 
 
 
 
 
 
 
 
 
5
  # 加载模型
6
  pipe = StableDiffusion3Pipeline.from_pretrained("prithivMLmods/SD3.5-Large-Photorealistic-LoRA", torch_dtype=torch.float16)
7
 
 
2
  from diffusers import StableDiffusion3Pipeline
3
  import torch
4
 
5
+ from huggingface_hub import login
6
+
7
+ # 通过环境变量获取 Token
8
+ hf_token = os.getenv("HF_TOKEN")
9
+
10
+ # 使用 Hugging Face Token 登录
11
+ login(token=hf_token)
12
+
13
  # 加载模型
14
  pipe = StableDiffusion3Pipeline.from_pretrained("prithivMLmods/SD3.5-Large-Photorealistic-LoRA", torch_dtype=torch.float16)
15