save code
This commit is contained in:
+21
@@ -423,5 +423,26 @@ def change_cloth():
|
||||
|
||||
return process_change_cloth(human_filename, cloth_filename, output_format, cloth_url, is_generated)
|
||||
|
||||
|
||||
@app.route('/change_cloth_one_step', methods=['POST'])
|
||||
def change_cloth_one_step():
|
||||
# 获取参数
|
||||
data = request.get_json()
|
||||
if not data:
|
||||
return jsonify({"ret":-1,'msg': 'No JSON data provided'}), 400
|
||||
|
||||
input_type = data.get("input_type")
|
||||
if input_type == 'base64':
|
||||
human_img = data.get("human_url")
|
||||
if not human_img:
|
||||
return jsonify({"error": "Missing 'human_img' parameter"}), 400
|
||||
else:
|
||||
human_url = data.get("human_url")
|
||||
if not human_url:
|
||||
return jsonify({"error": "Missing 'human_url' parameter"}), 400
|
||||
cloth_url = data.get("cloth_url")
|
||||
if not cloth_url:
|
||||
return jsonify({"error": "Missing 'cloth_url' parameter"}), 400
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host="0.0.0.0", port=8888, debug=True)
|
||||
Reference in New Issue
Block a user