接口5改造(生发机制与接口2一致,按性别分流): - generate_hairline_pngs: 生发图来源从 _grow_from_texture(局部inpaint) 改为按性别分流——female走 generate_grow_results_swap(swapHair+Flux整帧重绘), male走 generate_grow_results(ComfyUI add_hair) - 新增参数 redraw_max_side/unet_name/v2_defaults(female路径透传) - 接口5 handler 加 flux_model/redraw_max_side Form参数 - 保留接口5独有输出: 3档叠图(middle/high/low)/中心点/face_measure - 已验证: female日志出现"接口2女 管线降分辨率max_side=640"+swap+Flux; male走add_hair.json; generate_grow_image=false正确跳过生发 统一ComfyUI重绘提示词: - "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜" → "填充遮罩区域的头发" - 覆盖: _REDRAW_PROMPT/_DEFAULT_PROMPT常量 + app.py各接口Form默认 + 工作流JSON节点60(add_hair/0716add-hair-api/hair_repaint) + 全部测试页输入框
327 lines
4.9 KiB
JSON
327 lines
4.9 KiB
JSON
{
|
|
"16": {
|
|
"class_type": "UnetLoaderGGUF",
|
|
"inputs": {
|
|
"unet_name": "flux-2-klein-9b-Q4_K_M.gguf",
|
|
"weight_dtype": "fp8_e4m3fn_fast"
|
|
}
|
|
},
|
|
"3": {
|
|
"class_type": "VAELoader",
|
|
"inputs": {
|
|
"vae_name": "flux2-vae.safetensors"
|
|
}
|
|
},
|
|
"61": {
|
|
"class_type": "CLIPLoader",
|
|
"inputs": {
|
|
"clip_name": "qwen_3_8b_fp8mixed.safetensors",
|
|
"type": "flux2",
|
|
"device": "cpu"
|
|
}
|
|
},
|
|
"26": {
|
|
"class_type": "LoadImage",
|
|
"inputs": {
|
|
"image": "placeholder.png"
|
|
}
|
|
},
|
|
"60": {
|
|
"class_type": "JjkText",
|
|
"inputs": {
|
|
"text": "填充遮罩区域的头发"
|
|
}
|
|
},
|
|
"22": {
|
|
"class_type": "CLIPTextEncode",
|
|
"inputs": {
|
|
"clip": [
|
|
"61",
|
|
0
|
|
],
|
|
"text": [
|
|
"60",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"31": {
|
|
"class_type": "easy imageSize",
|
|
"inputs": {
|
|
"image": [
|
|
"26",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"33": {
|
|
"class_type": "Mask Fill Holes",
|
|
"inputs": {
|
|
"masks": [
|
|
"26",
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"36": {
|
|
"class_type": "Convert Masks to Images",
|
|
"inputs": {
|
|
"masks": [
|
|
"33",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"39": {
|
|
"class_type": "ImageScale",
|
|
"inputs": {
|
|
"image": [
|
|
"36",
|
|
0
|
|
],
|
|
"upscale_method": "nearest-exact",
|
|
"width": [
|
|
"31",
|
|
0
|
|
],
|
|
"height": [
|
|
"31",
|
|
1
|
|
],
|
|
"crop": "disabled"
|
|
}
|
|
},
|
|
"37": {
|
|
"class_type": "Image To Mask",
|
|
"inputs": {
|
|
"image": [
|
|
"39",
|
|
0
|
|
],
|
|
"method": "intensity"
|
|
}
|
|
},
|
|
"32": {
|
|
"class_type": "LayerUtility: ImageScaleByAspectRatio V2",
|
|
"inputs": {
|
|
"image": [
|
|
"26",
|
|
0
|
|
],
|
|
"mask": [
|
|
"37",
|
|
0
|
|
],
|
|
"aspect_ratio": "custom",
|
|
"proportional_width": [
|
|
"31",
|
|
0
|
|
],
|
|
"proportional_height": [
|
|
"31",
|
|
1
|
|
],
|
|
"fit": "letterbox",
|
|
"method": "lanczos",
|
|
"round_to_multiple": "8",
|
|
"scale_to_side": "None",
|
|
"scale_to_length": 1024,
|
|
"background_color": "#000000"
|
|
}
|
|
},
|
|
"44": {
|
|
"class_type": "ImageAndMaskPreview",
|
|
"inputs": {
|
|
"image": [
|
|
"32",
|
|
0
|
|
],
|
|
"mask": [
|
|
"32",
|
|
1
|
|
],
|
|
"mask_opacity": 1,
|
|
"mask_color": "FFFF00",
|
|
"pass_through": true
|
|
}
|
|
},
|
|
"14": {
|
|
"class_type": "GetImageSize+",
|
|
"inputs": {
|
|
"image": [
|
|
"44",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"13": {
|
|
"class_type": "VAEEncode",
|
|
"inputs": {
|
|
"pixels": [
|
|
"44",
|
|
0
|
|
],
|
|
"vae": [
|
|
"3",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"2": {
|
|
"class_type": "ModelSamplingFlux",
|
|
"inputs": {
|
|
"model": [
|
|
"16",
|
|
0
|
|
],
|
|
"max_shift": 1.15,
|
|
"base_shift": 0.5,
|
|
"width": [
|
|
"14",
|
|
0
|
|
],
|
|
"height": [
|
|
"14",
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"19": {
|
|
"class_type": "FluxGuidance",
|
|
"inputs": {
|
|
"conditioning": [
|
|
"22",
|
|
0
|
|
],
|
|
"guidance": 1
|
|
}
|
|
},
|
|
"5": {
|
|
"class_type": "ReferenceLatent",
|
|
"inputs": {
|
|
"conditioning": [
|
|
"19",
|
|
0
|
|
],
|
|
"latent": [
|
|
"13",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"7": {
|
|
"class_type": "EmptySD3LatentImage",
|
|
"inputs": {
|
|
"width": [
|
|
"14",
|
|
0
|
|
],
|
|
"height": [
|
|
"14",
|
|
1
|
|
],
|
|
"batch_size": 1
|
|
}
|
|
},
|
|
"1": {
|
|
"class_type": "BasicScheduler",
|
|
"inputs": {
|
|
"model": [
|
|
"2",
|
|
0
|
|
],
|
|
"scheduler": "simple",
|
|
"steps": 4,
|
|
"denoise": 1
|
|
}
|
|
},
|
|
"20": {
|
|
"class_type": "BasicGuider",
|
|
"inputs": {
|
|
"model": [
|
|
"2",
|
|
0
|
|
],
|
|
"conditioning": [
|
|
"5",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"6": {
|
|
"class_type": "RandomNoise",
|
|
"inputs": {
|
|
"noise_seed": 0
|
|
}
|
|
},
|
|
"8": {
|
|
"class_type": "KSamplerSelect",
|
|
"inputs": {
|
|
"sampler_name": "euler"
|
|
}
|
|
},
|
|
"9": {
|
|
"class_type": "SamplerCustomAdvanced",
|
|
"inputs": {
|
|
"noise": [
|
|
"6",
|
|
0
|
|
],
|
|
"guider": [
|
|
"20",
|
|
0
|
|
],
|
|
"sampler": [
|
|
"8",
|
|
0
|
|
],
|
|
"sigmas": [
|
|
"1",
|
|
0
|
|
],
|
|
"latent_image": [
|
|
"7",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"10": {
|
|
"class_type": "VAEDecode",
|
|
"inputs": {
|
|
"samples": [
|
|
"9",
|
|
0
|
|
],
|
|
"vae": [
|
|
"3",
|
|
0
|
|
]
|
|
}
|
|
},
|
|
"62": {
|
|
"class_type": "ColorMatch",
|
|
"inputs": {
|
|
"image_ref": [
|
|
"26",
|
|
0
|
|
],
|
|
"image_target": [
|
|
"10",
|
|
0
|
|
],
|
|
"method": "mkl",
|
|
"strength": 1,
|
|
"multithread": true
|
|
}
|
|
},
|
|
"17": {
|
|
"class_type": "SaveImage",
|
|
"inputs": {
|
|
"images": [
|
|
"62",
|
|
0
|
|
],
|
|
"filename_prefix": "hair_inpaint"
|
|
}
|
|
}
|
|
} |