Menyu commited on
Commit
4941def
·
verified ·
1 Parent(s): bb34e02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -226,8 +226,14 @@ MAX_IMAGE_SIZE = 4096
226
 
227
  if torch.cuda.is_available():
228
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
 
 
 
 
 
 
229
  pipe = StableDiffusionXLPipeline.from_single_file(
230
- "https://huggingface.co/bluepen5805/illustrious_pencil-XL/illustrious_pencil-XL-v2.0.0.safetensors",
231
  vae=vae,
232
  use_safetensors=True,
233
  torch_dtype=torch.float16,
@@ -297,7 +303,7 @@ h1{text-align:center}
297
 
298
  with gr.Blocks(css=css) as demo:
299
  gr.Markdown("""# 梦羽的模型生成器
300
- ### 快速生成illustrious_pencil-XL模型的图片""")
301
  with gr.Group():
302
  with gr.Row():
303
  prompt = gr.Text(
 
226
 
227
  if torch.cuda.is_available():
228
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
229
+ token = os.environ.get("HF_TOKEN") # 从环境变量读取令牌
230
+ model_path = hf_hub_download(
231
+ repo_id="Menyu/Pixel", # 模型仓库名称(非完整URL)
232
+ filename="MiaoMiaoPixel_V1.0.safetensors",
233
+ use_auth_token=token
234
+ )
235
  pipe = StableDiffusionXLPipeline.from_single_file(
236
+ model_path,
237
  vae=vae,
238
  use_safetensors=True,
239
  torch_dtype=torch.float16,
 
303
 
304
  with gr.Blocks(css=css) as demo:
305
  gr.Markdown("""# 梦羽的模型生成器
306
+ ### 快速生成MiaoMiaoPixel 像素模型的图片""")
307
  with gr.Group():
308
  with gr.Row():
309
  prompt = gr.Text(