zenafey commited on
Commit
5c87c18
·
verified ·
1 Parent(s): 4be3fff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ def run_face_swap(source, target):
25
 
26
  def upload_image(file):
27
  files = {'file': open(file, 'rb')}
28
- img_id = requests.post(os.getenv("-IMAGE_API_1"), files=files).json()['id']
29
 
30
  payload = {
31
  "content": "",
@@ -33,9 +33,9 @@ def upload_image(file):
33
  "replies": [],
34
  "attachments": [img_id]
35
  }
36
- res = requests.post(os.getenv("image-api-2"), json=payload, headers={"x-session-token": os.getenv("SESSION_TOKEN")})
37
 
38
- return f"{os.getenv('IMAGE_API_2')}/{img_id}/{res.json()['attachments'][0]['filename']}"
39
 
40
 
41
  def image_to_base64(image: Image):
 
25
 
26
  def upload_image(file):
27
  files = {'file': open(file, 'rb')}
28
+ img_id = requests.post(os.getenv("IMAGE_API_1"), files=files).json()['id']
29
 
30
  payload = {
31
  "content": "",
 
33
  "replies": [],
34
  "attachments": [img_id]
35
  }
36
+ res = requests.post(os.getenv("IMAGE_API_2"), json=payload, headers={"x-session-token": os.getenv("SESSION_TOKEN")})
37
 
38
+ return f"{os.getenv('IMAGE_API_1')}/{img_id}/{res.json()['attachments'][0]['filename']}"
39
 
40
 
41
  def image_to_base64(image: Image):