Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def gen_image(prompt: str):
|
|
14 |
return
|
15 |
access_token = os.environ['token']
|
16 |
url = f"https://aip.baidubce.com/rpc/2.0/nlp-itec/poc/stable_diffusion?access_token={access_token}&text={prompt}"
|
17 |
-
content = requests.
|
18 |
cache_dir = 'images'
|
19 |
os.makedirs(cache_dir, exist_ok=True)
|
20 |
|
|
|
14 |
return
|
15 |
access_token = os.environ['token']
|
16 |
url = f"https://aip.baidubce.com/rpc/2.0/nlp-itec/poc/stable_diffusion?access_token={access_token}&text={prompt}"
|
17 |
+
content = requests.post(url, json={"text": prompt}).content
|
18 |
cache_dir = 'images'
|
19 |
os.makedirs(cache_dir, exist_ok=True)
|
20 |
|