save code
This commit is contained in:
+15
-8
@@ -12,7 +12,7 @@ from volcenginesdkarkruntime import Ark
|
||||
import shutil
|
||||
import oss2
|
||||
import redis
|
||||
from check_img_body import is_thigh_visible
|
||||
# from check_img_body import is_thigh_visible
|
||||
import logging
|
||||
from config import QUEUE_NAME, DEFAULT_TIMEOUT, KEY_QUEUE_LOCK_NAME, acquire_lock
|
||||
|
||||
@@ -111,7 +111,7 @@ def GetHumanDesDesc(img_url):
|
||||
"url": img_url
|
||||
},
|
||||
},
|
||||
{"type": "text", "text": "图片是一个人物的照片,返回为json格式, 第一个字段'性别', 判断一下性别,只要答案, 选项有(男、女). 第二个字段'人物',判断一下图片是否有人,只要答案,选项有(有人、没人)"},
|
||||
{"type": "text", "text": "图片是一个人物的照片,返回为json格式, 第一个字段'性别', 判断一下性别,只要答案, 选项有(男、女). 第二个字段'跨',判断一下图片中的人物是否拍摄到了胯的部分,只要答案,选项有(有、没)"},
|
||||
],
|
||||
}
|
||||
],
|
||||
@@ -122,7 +122,7 @@ def GetHumanDesDesc(img_url):
|
||||
print(text)
|
||||
return text
|
||||
|
||||
def takeoff_cloth_first(human_name):
|
||||
def takeoff_cloth_first(human_name, is_girl):
|
||||
print('换泳装')
|
||||
queue = requests.get("http://localhost:8188/queue").json()
|
||||
if queue["queue_running"] or queue["queue_pending"]:
|
||||
@@ -139,7 +139,10 @@ def takeoff_cloth_first(human_name):
|
||||
# prompt["99"]["inputs"]["width"] = int((c_width/c_height) * 1024)
|
||||
|
||||
#input cloth img
|
||||
prompt["22"]["inputs"]["image"] = 'cloth_black.jpg'
|
||||
if is_girl:
|
||||
prompt["22"]["inputs"]["image"] = 'girl_cloth.jpg'
|
||||
else:
|
||||
prompt["22"]["inputs"]["image"] = 'man_cloth.jpg'
|
||||
|
||||
#input human img
|
||||
prompt["61"]["inputs"]["image"] = human_name
|
||||
@@ -192,9 +195,9 @@ def generate_from_face(human_name, sex_girl):
|
||||
prompt["93"]["inputs"]["image"] = human_name
|
||||
|
||||
if sex_girl:
|
||||
prompt["6"]["inputs"]["text"] = "full body shot(1.9),complete figure,front-facing,model pose, Hands are at the sides of the body, smile,clear skin glow,wearing black micro skirt,simple white background,clean composition,32k,high detail,professional beauty photography style,"
|
||||
prompt["6"]["inputs"]["text"] = "asian girl,full body shot(1.9),complete figure,front-facing,model pose,hands are at the sides of the body,smile,wearing black tube top and micro skirt,simple ,white background,32k,high detail,and face is illuminated by soft side light and natural light."
|
||||
else:
|
||||
prompt["6"]["inputs"]["text"] = "full body shot(1.9),complete figure,front-facing,model pose,Hands are at the sides of the body,smile,clear skin glow,wearing fitted vest and tight shortst,simple white background,clean composition,32k,high detail,professional beauty photography style,"
|
||||
prompt["6"]["inputs"]["text"] = "asian man,full body shot(1.9),complete figure,front-facing,model pose,hands are at the sides of the body,smile,wearing black tight shortst,simple white background,32k,high detail,and face is illuminated by soft side light and natural light."
|
||||
|
||||
#out put name
|
||||
out_img_name = str(uuid.uuid4())[:8]
|
||||
@@ -238,6 +241,10 @@ def change(human_name, cloth_name, c_width, c_height, cloth_url, human_url, no2)
|
||||
if '男' in sex_type:
|
||||
sex_girl = False
|
||||
|
||||
kua = False
|
||||
if human_json_data['跨'] == '有':
|
||||
kua = True
|
||||
|
||||
|
||||
json_str = GetPicDesc(cloth_url)
|
||||
json_data = json.loads(json_str)
|
||||
@@ -252,8 +259,8 @@ def change(human_name, cloth_name, c_width, c_height, cloth_url, human_url, no2)
|
||||
print(f'不用第二部 no2{no2}')
|
||||
else:
|
||||
print(f'要第二部 no2{no2} 先搞第一步')
|
||||
thigh_visible = is_thigh_visible(f"/home/szlc/code/ComfyUI/input/{human_name}")
|
||||
if thigh_visible:
|
||||
# thigh_visible = is_thigh_visible(f"/home/szlc/code/ComfyUI/input/{human_name}")
|
||||
if kua:
|
||||
#脱衣服
|
||||
takeoff_file_name = takeoff_cloth_first(human_name)
|
||||
if takeoff_file_name == None:
|
||||
|
||||
Reference in New Issue
Block a user