添加单张图片变换
This commit is contained in:
+9
-3
@@ -26,8 +26,8 @@ def change_cloth_base64():
|
||||
human_img = data.get('human_img')
|
||||
cloth_img = data.get('cloth_img')
|
||||
|
||||
if not human_img or not cloth_img:
|
||||
return jsonify({"ret": -1, "state": -1, "msg": "Both human_img and cloth_img are required"}), 400
|
||||
if not human_img:
|
||||
return jsonify({"ret": -1, "state": -1, "msg": "human_img is required"}), 400
|
||||
|
||||
kuzi_img = data.get('kuzi_img')
|
||||
|
||||
@@ -46,13 +46,19 @@ def change_cloth_base64():
|
||||
'change_desc': change_desc,
|
||||
}
|
||||
response = requests.post('http://127.0.0.1:12223/try-on', json=payload, timeout=360)
|
||||
else:
|
||||
elif cloth_img:
|
||||
payload = {
|
||||
'model_image': human_img,
|
||||
'shirt_image': cloth_img,
|
||||
'change_desc': change_desc,
|
||||
}
|
||||
response = requests.post('http://127.0.0.1:12222/try-on', json=payload, timeout=360)
|
||||
else:
|
||||
payload = {
|
||||
'model_image': human_img,
|
||||
'change_desc': change_desc,
|
||||
}
|
||||
response = requests.post('http://127.0.0.1:12221/try-on', json=payload, timeout=360)
|
||||
|
||||
response.raise_for_status()
|
||||
result = response.json()
|
||||
|
||||
Reference in New Issue
Block a user