main
黄海 1 year ago
parent 9d8f6bffc6
commit 34c2134bf8

@ -1,4 +1,11 @@
{
"source_images": [
"49,inputs,image"
],
"other_images": [
"./Image/C22/pose_1.png",
"./Image/C22/style_1.png"
],
"3": {
"inputs": {
"ckpt_name": "xxmix9realistic_v40.safetensors",
@ -204,7 +211,7 @@
},
"98": {
"inputs": {
"image": "image (93).png",
"image": "style_1.png",
"upload": "image"
},
"class_type": "LoadImage",
@ -242,7 +249,7 @@
},
"118": {
"inputs": {
"image": "pose-456x576-2 (1).jpg",
"image": "pose_1.png",
"upload": "image"
},
"class_type": "LoadImage",

@ -1,4 +1,11 @@
{
"source_images": [
"49,inputs,image"
],
"other_images": [
"./Image/C22/pose_2.png",
"./Image/C22/style_2.png"
],
"3": {
"inputs": {
"ckpt_name": "xxmix9realistic_v40.safetensors",
@ -204,7 +211,7 @@
},
"98": {
"inputs": {
"image": "image (93).png",
"image": "style_2.png",
"upload": "image"
},
"class_type": "LoadImage",
@ -242,7 +249,7 @@
},
"118": {
"inputs": {
"image": "pose-456x576-2 (1).jpg",
"image": "pose_2.png",
"upload": "image"
},
"class_type": "LoadImage",

@ -1,4 +1,11 @@
{
"source_images": [
"49,inputs,image"
],
"other_images": [
"./Image/C22/pose_3.png",
"./Image/C22/style_3.png"
],
"3": {
"inputs": {
"ckpt_name": "xxmix9realistic_v40.safetensors",
@ -204,7 +211,7 @@
},
"98": {
"inputs": {
"image": "image (93).png",
"image": "style_3.png",
"upload": "image"
},
"class_type": "LoadImage",
@ -242,7 +249,7 @@
},
"118": {
"inputs": {
"image": "pose-456x576-2 (1).jpg",
"image": "pose_3.png",
"upload": "image"
},
"class_type": "LoadImage",

@ -1,4 +1,11 @@
{
"source_images": [
"49,inputs,image"
],
"other_images": [
"./Image/C22/pose_4.png",
"./Image/C22/style_4.png"
],
"3": {
"inputs": {
"ckpt_name": "xxmix9realistic_v40.safetensors",
@ -204,7 +211,7 @@
},
"98": {
"inputs": {
"image": "image (93).png",
"image": "style_4.png",
"upload": "image"
},
"class_type": "LoadImage",
@ -242,7 +249,7 @@
},
"118": {
"inputs": {
"image": "pose-456x576-2 (1).jpg",
"image": "pose_4.png",
"upload": "image"
},
"class_type": "LoadImage",

@ -1,4 +1,11 @@
{
"source_images": [
"49,inputs,image"
],
"other_images": [
"./Image/C22/pose_1.png",
"./Image/C22/style_2.png"
],
"3": {
"inputs": {
"ckpt_name": "xxmix9realistic_v40.safetensors",
@ -204,7 +211,7 @@
},
"98": {
"inputs": {
"image": "image (93).png",
"image": "style_2.png",
"upload": "image"
},
"class_type": "LoadImage",
@ -242,7 +249,7 @@
},
"118": {
"inputs": {
"image": "pose-456x576-2 (1).jpg",
"image": "pose_1.png",
"upload": "image"
},
"class_type": "LoadImage",

@ -148,6 +148,15 @@ def getMyFilter(prompt_data):
# 根据输入的图片集合,填充到
def fill_input(prompt_data, file_array):
'''
样例
"source_images": [
"22,inputs,image"
],
prompt_data["98"]["inputs"]["image"] = image_pose
# 原图
prompt_data["49"]["inputs"]["image"] = img[0]
'''
# 是不是不存在配置节
if "source_images" not in prompt_data:
print("配置文件不包含source_images配置节程序无法继续")
@ -167,6 +176,14 @@ def fill_input(prompt_data, file_array):
if "source_images" in prompt_data:
del prompt_data["source_images"]
if 'other_images' in prompt_data:
for x in prompt_data['other_images']:
with open(x, "rb") as f:
y = upload_file(server_address, f, "", True)
if "other_images" in prompt_data:
del prompt_data["other_images"]
return prompt_data
@ -180,7 +197,8 @@ def runComfyUI(model_id, json_data, input_image, target_folder):
with open(x, "rb") as f:
y = upload_file(server_address, f, "", True)
img.append(y)
# 如果存在多个姿势图和风格图那么在配置文件中写死比如pose=post_1.jpg style=style_1.jpg
# 同时由于ComfyUI需要把这个文件上传到服务器所以需要在json文件中指定哪个文件需要上传
# 填充输入
json_data = fill_input(json_data, img)
# 过滤器,哪些返回节点中获取到的图片是有用的

Loading…
Cancel
Save