txh17 commited on
Commit
65255ac
·
verified ·
1 Parent(s): 486646b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -13,10 +13,11 @@ def generate_prompt(description: str) -> str:
13
 
14
  # 加载 ByteDance/SDXL-Lightning 模型
15
  pipe = DiffusionPipeline.from_pretrained("ByteDance/SDXL-Lightning")
 
16
  def generate_image(prompt: str):
17
  # 根据提示生成图像
18
- prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
19
  image = pipe(prompt).images[0]
 
20
 
21
  # 使用Whisper模型进行语音转文本
22
  processor = WhisperProcessor.from_pretrained("openai/whisper-large")
@@ -71,3 +72,4 @@ interface_with_audio = gr.Interface(
71
 
72
  # 使用标签页界面展示文本和语音输入
73
  gr.TabbedInterface([interface, interface_with_audio]).launch()
 
 
13
 
14
  # 加载 ByteDance/SDXL-Lightning 模型
15
  pipe = DiffusionPipeline.from_pretrained("ByteDance/SDXL-Lightning")
16
+
17
  def generate_image(prompt: str):
18
  # 根据提示生成图像
 
19
  image = pipe(prompt).images[0]
20
+ return image
21
 
22
  # 使用Whisper模型进行语音转文本
23
  processor = WhisperProcessor.from_pretrained("openai/whisper-large")
 
72
 
73
  # 使用标签页界面展示文本和语音输入
74
  gr.TabbedInterface([interface, interface_with_audio]).launch()
75
+