添加单张图片变换

This commit is contained in:
Your Name
2026-05-06 00:12:55 +08:00
parent 0b9b5d21ff
commit 47ff49dc19
7 changed files with 1119 additions and 39 deletions
+9 -3
View File
@@ -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()