save code

This commit is contained in:
colomi
2025-07-13 23:53:40 +08:00
parent bcebd31667
commit aa5fc8cbf1
2 changed files with 21 additions and 14 deletions
+13 -12
View File
@@ -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
+8 -2
View File
@@ -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)