|
|
|
@ -101,7 +101,7 @@ def runComfyUI(model_id, json_data, input_image, target_folder):
|
|
|
|
|
img = []
|
|
|
|
|
for x in input_image:
|
|
|
|
|
with open(x, "rb") as f:
|
|
|
|
|
y = upload_file(server_address, f, "", True)
|
|
|
|
|
y = upload_file(comfyui_address, f, "", True)
|
|
|
|
|
img.append(y)
|
|
|
|
|
# 如果存在多个姿势图和风格图,那么在配置文件中写死,比如pose=post_1.jpg style=style_1.jpg
|
|
|
|
|
# 同时,由于ComfyUI需要把这个文件上传到服务器,所以,需要在json文件中指定哪个文件需要上传
|
|
|
|
@ -116,7 +116,7 @@ def runComfyUI(model_id, json_data, input_image, target_folder):
|
|
|
|
|
if value['inputs']['filename_prefix'] == 'ComfyUI':
|
|
|
|
|
myfilter.append(key)
|
|
|
|
|
# 生成
|
|
|
|
|
files = generate_clip(server_address, json_data, client_id, target_folder, myfilter)
|
|
|
|
|
files = generate_clip(comfyui_address, json_data, client_id, target_folder, myfilter)
|
|
|
|
|
|
|
|
|
|
# 上传到云存储,回写数据接口
|
|
|
|
|
for file in files:
|
|
|
|
@ -156,7 +156,7 @@ def fill_input(prompt_data, file_array):
|
|
|
|
|
key = x['key']
|
|
|
|
|
value = x['value']
|
|
|
|
|
with open(value, "rb") as f:
|
|
|
|
|
y = upload_file(server_address, f, "", True)
|
|
|
|
|
y = upload_file(comfyui_address, f, "", True)
|
|
|
|
|
# 需要
|
|
|
|
|
array = key.split(",")
|
|
|
|
|
prompt_data[array[0]][array[1]][array[2]] = y
|
|
|
|
@ -287,17 +287,17 @@ if __name__ == '__main__':
|
|
|
|
|
machine_id = config['system']['machine_id']
|
|
|
|
|
|
|
|
|
|
# webui 服务器地址
|
|
|
|
|
webui_server = config['webui']['webui_server']
|
|
|
|
|
webui_address = 'http://' + config['webui']['webui_address']
|
|
|
|
|
# 文生图服务地址
|
|
|
|
|
txt2img_url = webui_server + config['webui']['txt2img_url']
|
|
|
|
|
txt2img_url = webui_address + config['webui']['txt2img_url']
|
|
|
|
|
# 图生图服务地址
|
|
|
|
|
img2img_url = webui_server + config['webui']['img2img_url']
|
|
|
|
|
img2img_url = webui_address + config['webui']['img2img_url']
|
|
|
|
|
|
|
|
|
|
# WEB服务器地址
|
|
|
|
|
web_url = config['webServer']['web_url']
|
|
|
|
|
|
|
|
|
|
# COMFYUI服务器地址
|
|
|
|
|
server_address = config.get('comfyui', 'server_address')
|
|
|
|
|
comfyui_address = config.get('comfyui', 'server_address')
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
try:
|
|
|
|
@ -314,11 +314,12 @@ if __name__ == '__main__':
|
|
|
|
|
finish_task(v_task_id, v_target_img_urls)
|
|
|
|
|
|
|
|
|
|
# 清理SD缓存
|
|
|
|
|
clear_webui_cache(server_address)
|
|
|
|
|
get_webui_used(server_address)
|
|
|
|
|
clear_webui_cache(webui_address)
|
|
|
|
|
get_webui_used(webui_address)
|
|
|
|
|
|
|
|
|
|
# 清理GPU缓存
|
|
|
|
|
clear_comfyui_cache(server_address)
|
|
|
|
|
get_comfyui_used(server_address)
|
|
|
|
|
clear_comfyui_cache(comfyui_address)
|
|
|
|
|
get_comfyui_used(comfyui_address)
|
|
|
|
|
|
|
|
|
|
elif v_task_id == 0:
|
|
|
|
|
# 本轮没有任务
|
|
|
|
|