main
黄海 1 year ago
parent a7f4b4d641
commit 43fead4086

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

@ -129,7 +129,7 @@ def runComfyUI(model_id, json_data, input_image, target_folder):
# 4、风格转绘
def webui_convert(model_id, json_data, input_image, target_folder):
def webui_convert(model_id, prompt_id, json_data, input_image, target_folder):
# 1、需要反推提示词
prompt = get_wd_14(wd_url, input_image[0])
@ -140,18 +140,21 @@ def webui_convert(model_id, json_data, input_image, target_folder):
img.close()
# 填充反推的提示词,以原图片的宽高为参数
json_data['prompt'] = prompt+json_data['prompt']
json_data['prompt'] = prompt + json_data['prompt']
json_data['width'] = width
json_data['height'] = height
# 图片
args = json_data['alwayson_scripts']['ControlNet']['args']
args[0]['input_image'] = encode_image(input_image[0])
json_data['init_images'] = [encode_image(input_image[0])]
# 开始生成图片
printf("开始生成图片...")
# 调用图生图服务
response = submit_post(img2img_url, json_data)
if response.status_code == 500:
print(response.text)
exit(0)
# 创建文件的完整路径
file_path = os.path.join(target_folder, str(uuid.uuid4()) + '.png')
save_encoded_image(response.json()['images'][0], file_path)

Loading…
Cancel
Save