lucksadasd commited on
Commit
1b27974
·
verified ·
1 Parent(s): f5e616f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -16,9 +16,9 @@ llm = pipeline(
16
  )
17
 
18
  # Step 2: 加载 Stable Diffusion 模型
 
19
  sd_v15 = StableDiffusionPipeline.from_pretrained(
20
- "runwayml/stable-diffusion-v1-5",
21
- revision="fp16",
22
  torch_dtype=torch.float16
23
  )
24
  sd_v15 = sd_v15.to("cuda" if torch.cuda.is_available() else "cpu")
@@ -107,3 +107,4 @@ with gr.Blocks(title="Prompt-to-Image Generator") as demo:
107
  # Step 4: 启动应用
108
  if __name__ == "__main__":
109
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
16
  )
17
 
18
  # Step 2: 加载 Stable Diffusion 模型
19
+ # 移除无效的 revision 参数,仅使用 torch_dtype 加速加载
20
  sd_v15 = StableDiffusionPipeline.from_pretrained(
21
+ "runwayml/stable-diffusion-v1-5",
 
22
  torch_dtype=torch.float16
23
  )
24
  sd_v15 = sd_v15.to("cuda" if torch.cuda.is_available() else "cpu")
 
107
  # Step 4: 启动应用
108
  if __name__ == "__main__":
109
  demo.launch(server_name="0.0.0.0", server_port=7860)
110
+