save code

This commit is contained in:
Your Name
2026-04-06 17:47:45 +08:00
parent ecdef627d4
commit 79d8c6d17f
7 changed files with 241 additions and 27 deletions
+8
View File
@@ -31,18 +31,26 @@ def change_cloth_base64():
kuzi_img = data.get('kuzi_img')
change_desc = data.get('change_desc')
if change_desc is None:
change_desc = ''
elif not isinstance(change_desc, str):
return jsonify({"ret": -1, "state": -1, "msg": "change_desc must be a string"}), 400
try:
if kuzi_img:
payload = {
'model_image': human_img,
'shirt_image': cloth_img,
'pants_image': kuzi_img,
'change_desc': change_desc,
}
response = requests.post('http://127.0.0.1:12223/try-on', json=payload, timeout=360)
else:
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)