From a421f2301e299627c3aabb6bad7af49db99c7573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 5 Jul 2024 16:14:45 +0800 Subject: [PATCH] 'commit' --- BaiHu/Config.ini | 1 + BaiHu/doTask.py | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/BaiHu/Config.ini b/BaiHu/Config.ini index a15db0b0..252dc570 100644 --- a/BaiHu/Config.ini +++ b/BaiHu/Config.ini @@ -14,6 +14,7 @@ server_address = 192.168.1.21:8188 webui_address = 192.168.1.21:7860 txt2img_url = /sdapi/v1/txt2img img2img_url = /sdapi/v1/img2img +wd_url = /tagger/v1/interrogate ; WEB服务器地址 [webServer] web_url = https://www.hzkjai.com diff --git a/BaiHu/doTask.py b/BaiHu/doTask.py index df621d38..b259c283 100644 --- a/BaiHu/doTask.py +++ b/BaiHu/doTask.py @@ -25,7 +25,7 @@ def upload_img_file(file_path, model_id): return url -# 文生图服务调用 +# 1、文生图服务调用 def webui_txt_2_img(model_id, json_data, input_image, target_folder): # 提示词 prompt = json_data['prompt'] @@ -59,7 +59,7 @@ def webui_txt_2_img(model_id, json_data, input_image, target_folder): res.append(url) -# 图生图服务调用 +# 2、图生图服务调用 def webui_img_2_img(model_id, prompt_id, json_data, input_image, target_folder): source_img = encode_image(input_image[0]) # 模型固定的参考图片 @@ -96,7 +96,7 @@ def webui_img_2_img(model_id, prompt_id, json_data, input_image, target_folder): res.append(url) # 添加到结果集合中 -# ComfyUI服务调用 +# 3、ComfyUI服务调用 def runComfyUI(model_id, json_data, input_image, target_folder): # 生成一个唯一的客户端ID client_id = str(uuid.uuid4()) @@ -129,7 +129,7 @@ def runComfyUI(model_id, json_data, input_image, target_folder): res.append(url) -# 风格转绘 +# 4、风格转绘 def webui_convert(model_id, json_data, input_image, target_folder): # 1、需要反推提示词 prompt = get_wd_14(wd_url, input_image[0]) @@ -361,9 +361,7 @@ if __name__ == '__main__': # COMFYUI服务器地址 comfyui_address = config.get('comfyui', 'server_address') # 反推接口地址 - wd_url = 'http://' + webui_address + '/tagger/v1/interrogate' - # image_path = r'D:\KeCheng\BaiHu\Backup\mote2.png' - # print(get_wd_14(wd_url, image_path)) + wd_url = 'http://' + webui_address + config['webui']['wd_url'] while True: try: