Commit
·
d258d96
1
Parent(s):
c779bb9
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,9 @@ API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion
|
|
10 |
headers = {"Authorization": "Bearer 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"}
|
11 |
|
12 |
def query(payload):
|
13 |
-
|
14 |
image = Image.open(io.BytesIO(response.content))
|
15 |
-
|
16 |
|
17 |
# 创建Gradio界面
|
18 |
iface = gr.Interface(
|
|
|
10 |
headers = {"Authorization": "Bearer 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"}
|
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(
|