From aa5fc8cbf166ffff666b12e6db9bca1d46f857c5 Mon Sep 17 00:00:00 2001 From: colomi <1421901449@qq.com> Date: Sun, 13 Jul 2025 23:53:40 +0800 Subject: [PATCH] save code --- change_new.json | 25 +++++++++++++------------ http_app.py | 10 ++++++++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/change_new.json b/change_new.json index 869ad09..6956012 100644 --- a/change_new.json +++ b/change_new.json @@ -1,7 +1,7 @@ { "3": { "inputs": { - "seed": 712463095845292, + "seed": 578821909416451, "steps": 20, "cfg": 1, "sampler_name": "euler", @@ -196,7 +196,7 @@ }, "22": { "inputs": { - "image": "cloth_short.jpg" + "image": "微信图片_20250713223619.jpg" }, "class_type": "LoadImage", "_meta": { @@ -486,7 +486,7 @@ }, "61": { "inputs": { - "image": "girl_full.jpg" + "image": "微信图片_20250713223607.jpg" }, "class_type": "LoadImage", "_meta": { @@ -639,7 +639,7 @@ }, "94": { "inputs": { - "value": 1024 + "value": 2048 }, "class_type": "PrimitiveInt", "_meta": { @@ -667,8 +667,9 @@ }, "96": { "inputs": { - "cloth_len": "yao", + "cloth_len": "小腿", "line_len": 0.6000000000000001, + "cloth_short": true, "kps": [ "95", 1 @@ -818,7 +819,7 @@ }, "110": { "inputs": { - "preview": "", + "preview": "1638400", "source": [ "106", 0 @@ -831,7 +832,7 @@ }, "111": { "inputs": { - "preview": "", + "preview": "2048", "source": [ "108", 0 @@ -844,7 +845,7 @@ }, "112": { "inputs": { - "preview": "", + "preview": "2048", "source": [ "109", 0 @@ -857,7 +858,7 @@ }, "113": { "inputs": { - "preview": "", + "preview": "4096", "source": [ "107", 0 @@ -870,7 +871,7 @@ }, "114": { "inputs": { - "preview": "", + "preview": "2048", "source": [ "107", 1 @@ -883,7 +884,7 @@ }, "115": { "inputs": { - "preview": "", + "preview": "800", "source": [ "104", 0 @@ -896,7 +897,7 @@ }, "116": { "inputs": { - "preview": "", + "preview": "800", "source": [ "104", 1 diff --git a/http_app.py b/http_app.py index aaf0e5a..267424a 100644 --- a/http_app.py +++ b/http_app.py @@ -38,7 +38,7 @@ def GetPicDesc(img_url): "url": img_url }, }, - {"type": "text", "text": "图片是一件服装的照片,告诉我图片中的服装穿到正常人身上的长度会覆盖到人体的哪个部位, 只要答案, 选项有(胸、腰、跨、大腿、膝盖、小腿、脚踝、拖地、难以辨认)"}, + {"type": "text", "text": "图片是一件服装的照片,返回为json格式, 第一个字段'服装长度', 图片中的服装穿到正常人身上的长度会覆盖到人体的哪个部位, 只要答案, 选项有(胸、腰、跨、大腿、膝盖、小腿、脚踝、拖地、难以辨认). 第二个字段'衣袖',只要答案,选项有(短袖、长袖)"}, ], } ], @@ -51,7 +51,12 @@ def GetPicDesc(img_url): def change(human_name, cloth_name, c_width, c_height, cloth_url): - cloth_len = GetPicDesc(cloth_url) + json_str = GetPicDesc(cloth_url) + json_data = json.loads(json_str) + cloth_len = json_data['服装长度'] + cloth_short = True + if '长袖' in json_data['衣袖']: + cloth_short = False if cloth_len == '难以辨认': return None, "get image type error" @@ -65,6 +70,7 @@ def change(human_name, cloth_name, c_width, c_height, cloth_url): prompt = json.loads(prompt_text) prompt["96"]["inputs"]["cloth_len"] = cloth_len + prompt["96"]["inputs"]["cloth_short"] = cloth_short # prompt["99"]["inputs"]["width"] = int((c_width/c_height) * 1024)