yunshi1207 commited on
Commit
c779bb9
·
1 Parent(s): 019e7d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,4 +1,6 @@
1
  import gradio as gr
 
 
2
 
3
  # gr.Interface.load("models/runwayml/stable-diffusion-v1-5").launch()
4
 
@@ -9,7 +11,8 @@ headers = {"Authorization": "Bearer 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"}
9
 
10
  def query(payload):
11
  response = requests.post(API_URL, headers=headers, json=payload)
12
- return response.content
 
13
 
14
  # 创建Gradio界面
15
  iface = gr.Interface(
 
1
  import gradio as gr
2
+ import io
3
+ from PIL import Image
4
 
5
  # gr.Interface.load("models/runwayml/stable-diffusion-v1-5").launch()
6
 
 
11
 
12
  def query(payload):
13
  response = requests.post(API_URL, headers=headers, json=payload)
14
+ image = Image.open(io.BytesIO(response.content))
15
+ return image
16
 
17
  # 创建Gradio界面
18
  iface = gr.Interface(