wjmcat commited on
Commit
9e0eb99
1 Parent(s): d18668a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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.get(url).content
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