diff --git a/0716add-hair-api.json b/0716add-hair-api.json index d4de696..3458035 100644 --- a/0716add-hair-api.json +++ b/0716add-hair-api.json @@ -1 +1,327 @@ -{"16": {"class_type": "UNETLoader", "inputs": {"unet_name": "flux-2-klein-4b-fp8.safetensors", "weight_dtype": "fp8_e4m3fn_fast"}}, "3": {"class_type": "VAELoader", "inputs": {"vae_name": "flux2-vae.safetensors"}}, "61": {"class_type": "CLIPLoader", "inputs": {"clip_name": "qwen_3_4b.safetensors", "type": "flux2", "device": "default"}}, "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"}}} \ No newline at end of file +{ + "16": { + "class_type": "UNETLoader", + "inputs": { + "unet_name": "flux-2-klein-4b-fp8.safetensors", + "weight_dtype": "fp8_e4m3fn_fast" + } + }, + "3": { + "class_type": "VAELoader", + "inputs": { + "vae_name": "flux2-vae.safetensors" + } + }, + "61": { + "class_type": "CLIPLoader", + "inputs": { + "clip_name": "qwen_3_4b.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" + } + } +} \ No newline at end of file diff --git a/0716add-hair.json b/0716add-hair.json index bbc94fd..db7e4e1 100644 --- a/0716add-hair.json +++ b/0716add-hair.json @@ -1 +1 @@ -{"id":"431f1189-2c6a-448d-925e-5f6c85416393","revision":0,"last_node_id":63,"last_link_id":104,"nodes":[{"id":37,"type":"Image To Mask","pos":[330.00017074563834,-900.0000465455873],"size":[280,110],"flags":{},"order":13,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"image","type":"IMAGE","link":47},{"label":"方法","localized_name":"方法","name":"method","type":"COMBO","widget":{"name":"method"},"link":null}],"outputs":[{"label":"遮罩","localized_name":"遮罩","name":"MASK","type":"MASK","links":[79]}],"properties":{"Node name for S&R":"Image To Mask","cnr_id":"masquerade-nodes-comfyui","ver":"432cb4d146a391b387a0cd25ace824328b5b61cf","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["intensity"],"color":"#223","bgcolor":"#335"},{"id":33,"type":"Mask Fill Holes","pos":[320.0000351119579,-1320.0000465455873],"size":[290,80],"flags":{},"order":9,"mode":0,"inputs":[{"label":"遮罩","localized_name":"遮罩","name":"masks","type":"MASK","link":38}],"outputs":[{"label":"遮罩","localized_name":"遮罩","name":"MASKS","type":"MASK","links":[41]}],"properties":{"cnr_id":"was-node-suite-comfyui","ver":"1cd8d304eda256c412b8589ce1f00be3c61cf9ec","Node name for S&R":"Mask Fill Holes","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":32,"type":"LayerUtility: ImageScaleByAspectRatio V2","pos":[650.0000351119579,-1399.9999109119071],"size":[320,480],"flags":{},"order":14,"mode":0,"inputs":[{"label":"图像","localized_name":"image","name":"image","shape":7,"type":"IMAGE","link":101},{"label":"遮罩","localized_name":"mask","name":"mask","shape":7,"type":"MASK","link":79},{"localized_name":"aspect_ratio","name":"aspect_ratio","type":"COMBO","widget":{"name":"aspect_ratio"},"link":null},{"label":"proportional_width","localized_name":"proportional_width","name":"proportional_width","type":"INT","widget":{"name":"proportional_width"},"link":55},{"label":"proportional_height","localized_name":"proportional_height","name":"proportional_height","type":"INT","widget":{"name":"proportional_height"},"link":56},{"localized_name":"fit","name":"fit","type":"COMBO","widget":{"name":"fit"},"link":null},{"localized_name":"method","name":"method","type":"COMBO","widget":{"name":"method"},"link":null},{"localized_name":"round_to_multiple","name":"round_to_multiple","type":"COMBO","widget":{"name":"round_to_multiple"},"link":null},{"localized_name":"scale_to_side","name":"scale_to_side","type":"COMBO","widget":{"name":"scale_to_side"},"link":null},{"localized_name":"scale_to_length","name":"scale_to_length","type":"INT","widget":{"name":"scale_to_length"},"link":null},{"localized_name":"background_color","name":"background_color","type":"STRING","widget":{"name":"background_color"},"link":null}],"outputs":[{"label":"图像","localized_name":"image","name":"image","type":"IMAGE","links":[57]},{"label":"遮罩","localized_name":"mask","name":"mask","type":"MASK","links":[58]},{"label":"原始大小","localized_name":"original_size","name":"original_size","type":"BOX"},{"label":"width","localized_name":"width","name":"width","type":"INT"},{"label":"height","localized_name":"height","name":"height","type":"INT"}],"properties":{"cnr_id":"comfyui_layerstyle","ver":"a46b1e6d26d45be9784c49f7065ba44700ef2b63","Node name for S&R":"LayerUtility: ImageScaleByAspectRatio V2","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":["custom",1,1,"letterbox","lanczos","8","None",1024,"#000000"],"color":"rgba(38, 73, 116, 0.7)"},{"id":14,"type":"GetImageSize+","pos":[1400.0001707456386,-930.0000465455873],"size":[320,120.15625],"flags":{},"order":17,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"image","type":"IMAGE","link":62}],"outputs":[{"label":"宽度","localized_name":"宽度","name":"width","type":"INT","links":[3,7]},{"label":"高度","localized_name":"高度","name":"height","type":"INT","links":[4,8]},{"label":"count","localized_name":"count","name":"count","type":"INT"}],"properties":{"cnr_id":"comfyui_essentials","ver":"9d9f4bedfc9f0321c19faf71855e228c93bd0dc9","Node name for S&R":"GetImageSize+","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":13,"type":"VAEEncode","pos":[1409.9998994782773,-1100.0000465455873],"size":[320,100],"flags":{},"order":18,"mode":0,"inputs":[{"label":"图像","localized_name":"像素","name":"pixels","type":"IMAGE","link":63},{"label":"VAE","localized_name":"vae","name":"vae","type":"VAE","link":18}],"outputs":[{"label":"Latent","localized_name":"Latent","name":"LATENT","type":"LATENT","links":[6]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"VAEEncode","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":9,"type":"SamplerCustomAdvanced","pos":[2500.000170745638,-1220.0000465455873],"size":[270,330],"flags":{},"order":24,"mode":0,"inputs":[{"label":"噪波生成","localized_name":"噪波","name":"noise","type":"NOISE","link":9},{"label":"引导","localized_name":"引导器","name":"guider","type":"GUIDER","link":10},{"label":"采样器","localized_name":"采样器","name":"sampler","type":"SAMPLER","link":11},{"label":"Sigmas","localized_name":"西格玛","name":"sigmas","type":"SIGMAS","link":12},{"label":"Latent","localized_name":"Latent图像","name":"latent_image","type":"LATENT","link":13}],"outputs":[{"label":"输出","localized_name":"Latent","name":"output","type":"LATENT","slot_index":0,"links":[14]},{"label":"降噪输出","localized_name":"降噪Latent","name":"denoised_output","type":"LATENT"}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"SamplerCustomAdvanced","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":22,"type":"CLIPTextEncode","pos":[1300.0001707456386,-1709.999910911907],"size":[390,140],"flags":{},"order":7,"mode":0,"inputs":[{"label":"CLIP","localized_name":"clip","name":"clip","type":"CLIP","link":92},{"label":"text","localized_name":"文本","name":"text","type":"STRING","widget":{"name":"text"},"link":98}],"outputs":[{"label":"条件","localized_name":"条件","name":"CONDITIONING","type":"CONDITIONING","slot_index":0,"links":[24]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"CLIPTextEncode","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":["The yellow part of the picture is replaced by a black bowl."],"color":"#232","bgcolor":"#353"},{"id":10,"type":"VAEDecode","pos":[2759.9998994782773,-1370.0000465455873],"size":[320,100],"flags":{},"order":25,"mode":0,"inputs":[{"label":"Latent","localized_name":"Latent","name":"samples","type":"LATENT","link":14},{"label":"VAE","localized_name":"vae","name":"vae","type":"VAE","link":15}],"outputs":[{"label":"图像","localized_name":"图像","name":"IMAGE","type":"IMAGE","slot_index":0,"links":[95]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"VAEDecode","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":39,"type":"ImageScale","pos":[320.0000351119579,-1150.0000465455873],"size":[290,210],"flags":{},"order":12,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"image","type":"IMAGE","link":44},{"localized_name":"缩放算法","name":"upscale_method","type":"COMBO","widget":{"name":"upscale_method"},"link":null},{"label":"width","localized_name":"宽度","name":"width","type":"INT","widget":{"name":"width"},"link":45},{"label":"height","localized_name":"高度","name":"height","type":"INT","widget":{"name":"height"},"link":46},{"localized_name":"裁剪","name":"crop","type":"COMBO","widget":{"name":"crop"},"link":null}],"outputs":[{"label":"图像","localized_name":"图像","name":"IMAGE","type":"IMAGE","links":[47]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.43","Node name for S&R":"ImageScale","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["nearest-exact",512,512,"disabled"],"color":"#223","bgcolor":"#335"},{"id":36,"type":"Convert Masks to Images","pos":[320.0000351119579,-1250.0000465455873],"size":[290,80],"flags":{},"order":11,"mode":0,"inputs":[{"label":"遮罩","localized_name":"遮罩","name":"masks","type":"MASK","link":41}],"outputs":[{"label":"图像","localized_name":"图像","name":"IMAGES","type":"IMAGE","links":[44]}],"properties":{"cnr_id":"was-node-suite-comfyui","ver":"1cd8d304eda256c412b8589ce1f00be3c61cf9ec","Node name for S&R":"Convert Masks to Images","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":44,"type":"ImageAndMaskPreview","pos":[639.9998994782773,-990.0000465455873],"size":[290,200],"flags":{},"order":15,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"image","shape":7,"type":"IMAGE","link":57},{"label":"遮罩","localized_name":"遮罩","name":"mask","shape":7,"type":"MASK","link":58},{"label":"遮罩不透明","localized_name":"遮罩不透明","name":"mask_opacity","type":"FLOAT","widget":{"name":"mask_opacity"},"link":null},{"label":"遮罩颜色","localized_name":"遮罩颜色","name":"mask_color","type":"STRING","widget":{"name":"mask_color"},"link":null},{"label":"穿透","localized_name":"穿透","name":"pass_through","type":"BOOLEAN","widget":{"name":"pass_through"},"link":null}],"outputs":[{"label":"图像","localized_name":"图像","name":"composite","type":"IMAGE","links":[59,62,63]}],"properties":{"cnr_id":"comfyui-kjnodes","ver":"aeab1a7de581dc7253f48257392e8287bbeee4a9","Node name for S&R":"ImageAndMaskPreview","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[1,"FFFF00",true],"color":"#223","bgcolor":"#335"},{"id":7,"type":"EmptySD3LatentImage","pos":[1789.9998994782773,-990.0000465455873],"size":[310,170],"flags":{},"order":20,"mode":0,"inputs":[{"label":"width","localized_name":"宽度","name":"width","type":"INT","widget":{"name":"width"},"link":7},{"label":"height","localized_name":"高度","name":"height","type":"INT","widget":{"name":"height"},"link":8},{"localized_name":"批量大小","name":"batch_size","type":"INT","widget":{"name":"batch_size"},"link":null}],"outputs":[{"label":"Latent","localized_name":"Latent","name":"LATENT","type":"LATENT","slot_index":0,"links":[13]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"EmptySD3LatentImage","ue_properties":{"version":"7.7","widget_ue_connectable":{"width":true,"height":true},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[1024,1024,1],"color":"#223","bgcolor":"#335"},{"id":62,"type":"ColorMatch","pos":[2790.000170745638,-1210.0000465455873],"size":[270,200],"flags":{},"order":26,"mode":0,"inputs":[{"label":"参考图像","localized_name":"参考图像","name":"image_ref","type":"IMAGE","link":102},{"label":"目标图像","localized_name":"目标图像","name":"image_target","type":"IMAGE","link":95},{"label":"方法","localized_name":"方法","name":"method","type":"COMBO","widget":{"name":"method"},"link":null},{"label":"强度","localized_name":"强度","name":"strength","shape":7,"type":"FLOAT","widget":{"name":"strength"},"link":null},{"label":"多线程","localized_name":"多线程","name":"multithread","shape":7,"type":"BOOLEAN","widget":{"name":"multithread"},"link":null}],"outputs":[{"label":"图像","localized_name":"图像","name":"image","type":"IMAGE","links":[96,97]}],"properties":{"cnr_id":"comfyui-kjnodes","ver":"5b38397a6430fdb16c7bd14a6bd64c2b0e69a5f0","Node name for S&R":"ColorMatch","ue_properties":{"widget_ue_connectable":{},"input_ue_unconnectable":{},"version":"7.6.2"},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["mkl",1,true],"color":"#223","bgcolor":"#335"},{"id":1,"type":"BasicScheduler","pos":[2150.000170745638,-1220.0000465455873],"size":[320,180],"flags":{},"order":22,"mode":0,"inputs":[{"label":"模型","localized_name":"模型","name":"model","type":"MODEL","link":1},{"localized_name":"调度器","name":"scheduler","type":"COMBO","widget":{"name":"scheduler"},"link":null},{"localized_name":"步数","name":"steps","type":"INT","widget":{"name":"steps"},"link":null},{"localized_name":"降噪","name":"denoise","type":"FLOAT","widget":{"name":"denoise"},"link":null}],"outputs":[{"label":"Sigmas","localized_name":"Sigmas","name":"SIGMAS","type":"SIGMAS","links":[12]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"BasicScheduler","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["simple",6,1],"color":"#223","bgcolor":"#335"},{"id":6,"type":"RandomNoise","pos":[1770.0001707456386,-1170.0000465455873],"size":[310,110],"flags":{},"order":0,"mode":0,"inputs":[{"localized_name":"噪波随机种","name":"noise_seed","type":"INT","widget":{"name":"noise_seed"},"link":null}],"outputs":[{"label":"噪波生成","localized_name":"噪波","name":"NOISE","type":"NOISE","links":[9]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"RandomNoise","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":[1109407891267066,"randomize"],"color":"#2a363b","bgcolor":"#3f5159"},{"id":8,"type":"KSamplerSelect","pos":[1750.0001707456386,-1290.0000465455873],"size":[320,110],"flags":{},"order":1,"mode":0,"inputs":[{"localized_name":"采样器名称","name":"sampler_name","type":"COMBO","widget":{"name":"sampler_name"},"link":null}],"outputs":[{"label":"采样器","localized_name":"采样器","name":"SAMPLER","type":"SAMPLER","links":[11]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"KSamplerSelect","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["euler"],"color":"#223","bgcolor":"#335"},{"id":31,"type":"easy imageSize","pos":[-29.999964888042086,-1380.0000465455873],"size":[290,170],"flags":{},"order":8,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"image","type":"IMAGE","link":100}],"outputs":[{"label":"宽度","localized_name":"宽度","name":"width_int","type":"INT","links":[45,55]},{"label":"高度","localized_name":"高度","name":"height_int","type":"INT","links":[46,56]}],"properties":{"cnr_id":"comfyui-easy-use","ver":"501d97bb5ca8d61b486d47379fb1f21a41b772d7","Node name for S&R":"easy imageSize","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["Width: 767 , Height: 747"],"color":"#223","bgcolor":"#335"},{"id":20,"type":"BasicGuider","pos":[2170.000170745638,-1350.0000465455873],"size":[270,100],"flags":{},"order":23,"mode":0,"inputs":[{"label":"模型","localized_name":"模型","name":"model","type":"MODEL","link":25},{"label":"条件","localized_name":"条件","name":"conditioning","type":"CONDITIONING","link":104}],"outputs":[{"label":"引导","localized_name":"引导器","name":"GUIDER","type":"GUIDER","slot_index":0,"links":[10]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"BasicGuider","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":5,"type":"ReferenceLatent","pos":[1409.9998994782773,-1220.0000465455873],"size":[310,100],"flags":{},"order":21,"mode":0,"inputs":[{"label":"conditioning","localized_name":"条件","name":"conditioning","type":"CONDITIONING","link":5},{"label":"latent","localized_name":"Latent","name":"latent","shape":7,"type":"LATENT","link":6}],"outputs":[{"label":"CONDITIONING","localized_name":"条件","name":"CONDITIONING","type":"CONDITIONING","links":[104]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"ReferenceLatent","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[],"color":"#223","bgcolor":"#335"},{"id":19,"type":"FluxGuidance","pos":[1420.0001707456386,-1350.0000465455873],"size":[310,110],"flags":{},"order":10,"mode":0,"inputs":[{"label":"条件","localized_name":"条件","name":"conditioning","type":"CONDITIONING","link":24},{"localized_name":"引导","name":"guidance","type":"FLOAT","widget":{"name":"guidance"},"link":null}],"outputs":[{"label":"条件","localized_name":"条件","name":"CONDITIONING","type":"CONDITIONING","slot_index":0,"links":[5]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"FluxGuidance","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":[1],"color":"#233","bgcolor":"#355"},{"id":2,"type":"ModelSamplingFlux","pos":[2130.000170745638,-1020.0000465455873],"size":[320,200],"flags":{},"order":19,"mode":0,"inputs":[{"label":"模型","localized_name":"模型","name":"model","type":"MODEL","link":2},{"localized_name":"最大移位","name":"max_shift","type":"FLOAT","widget":{"name":"max_shift"},"link":null},{"localized_name":"基础移位","name":"base_shift","type":"FLOAT","widget":{"name":"base_shift"},"link":null},{"label":"width","localized_name":"宽度","name":"width","type":"INT","widget":{"name":"width"},"link":3},{"label":"height","localized_name":"高度","name":"height","type":"INT","widget":{"name":"height"},"link":4}],"outputs":[{"label":"模型","localized_name":"模型","name":"MODEL","type":"MODEL","slot_index":0,"links":[1,25]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"ModelSamplingFlux","ue_properties":{"version":"7.7","widget_ue_connectable":{"width":true,"height":true},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":[1.15,0.5,1024,1024],"color":"#223","bgcolor":"#335"},{"id":16,"type":"UNETLoader","pos":[1010.0000351119579,-1390.0000465455873],"size":[310,150],"flags":{},"order":2,"mode":0,"inputs":[{"localized_name":"UNet名称","name":"unet_name","type":"COMBO","widget":{"name":"unet_name"},"link":null},{"localized_name":"数据类型","name":"weight_dtype","type":"COMBO","widget":{"name":"weight_dtype"},"link":null}],"outputs":[{"label":"模型","localized_name":"模型","name":"MODEL","type":"MODEL","slot_index":0,"links":[2]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"UNETLoader","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":["flux2.0/flux-2-klein-9b-fp8.safetensors","fp8_e4m3fn"],"color":"#223","bgcolor":"#335"},{"id":3,"type":"VAELoader","pos":[1010.0000351119579,-1250.0000465455873],"size":[310,110],"flags":{},"order":3,"mode":0,"inputs":[{"localized_name":"vae名称","name":"vae_name","type":"COMBO","widget":{"name":"vae_name"},"link":null}],"outputs":[{"label":"VAE","localized_name":"VAE","name":"VAE","type":"VAE","slot_index":0,"links":[15,18]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"VAELoader","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["flux2-vae.safetensors"],"color":"#223","bgcolor":"#335"},{"id":61,"type":"CLIPLoader","pos":[1000.0000351119579,-1110.0000465455873],"size":[350,180],"flags":{},"order":4,"mode":0,"inputs":[{"label":"clip_name","localized_name":"CLIP名称","name":"clip_name","type":"COMBO","widget":{"name":"clip_name"},"link":null},{"label":"type","localized_name":"类型","name":"type","type":"COMBO","widget":{"name":"type"},"link":null},{"label":"device","localized_name":"设备","name":"device","shape":7,"type":"COMBO","widget":{"name":"device"},"link":null}],"outputs":[{"label":"CLIP","localized_name":"CLIP","name":"CLIP","type":"CLIP","links":[92]}],"properties":{"cnr_id":"comfy-core","ver":"0.8.2","Node name for S&R":"CLIPLoader","ue_properties":{"version":"7.2.2","widget_ue_connectable":{},"input_ue_unconnectable":{}},"hasSecondTab":false,"models":[{"name":"qwen_3_4b.safetensors","directory":"text_encoders","url":"https://huggingface.co/Comfy-Org/flux2-klein-4B/resolve/main/split_files/text_encoders/qwen_3_4b.safetensors"}],"secondTabText":"Send Back","enableTabs":false,"secondTabOffset":80,"tabWidth":65,"secondTabWidth":65,"tabXOffset":10,"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"},"widget_ue_connectable":{"clip_name":true,"type":true,"device":true}},"widgets_values":["qwen_3_8b_fp8mixed.safetensors","flux2","default"],"color":"#223","bgcolor":"#335"},{"id":45,"type":"PreviewImage","pos":[710.0000351119579,-2120.000046545588],"size":[490,500],"flags":{},"order":16,"mode":0,"inputs":[{"label":"图像","localized_name":"图像","name":"images","type":"IMAGE","link":59}],"outputs":[],"properties":{"cnr_id":"comfy-core","ver":"0.3.43","Node name for S&R":"PreviewImage","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":[],"color":"#233","bgcolor":"#355"},{"id":53,"type":"Image Comparer (rgthree)","pos":[1804.9843155517362,-2156.5215467241615],"size":[650,550],"flags":{},"order":28,"mode":0,"inputs":[{"dir":3,"label":"图像_A","name":"image_a","type":"IMAGE","link":97},{"dir":3,"label":"图像_B","name":"image_b","type":"IMAGE","link":75}],"outputs":[],"properties":{"cnr_id":"rgthree-comfy","ver":"84a146fee39f7b3a8c6631dcac29bc13b077eb49","comparer_mode":"Slide","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":[[{"name":"A","selected":true,"url":"/api/view?filename=rgthree.compare._temp_nqvym_00029_.png&type=temp&subfolder=&rand=0.5791789168392755"},{"name":"B","selected":true,"url":"/api/view?filename=rgthree.compare._temp_nqvym_00030_.png&type=temp&subfolder=&rand=0.21946935876437912"}]],"color":"#2a363b","bgcolor":"#3f5159"},{"id":17,"type":"SaveImage","pos":[2480.000170745638,-2170.000046545588],"size":[570,580],"flags":{},"order":27,"mode":0,"inputs":[{"label":"图像","localized_name":"图片","name":"images","type":"IMAGE","link":96},{"localized_name":"文件名前缀","name":"filename_prefix","type":"STRING","widget":{"name":"filename_prefix"},"link":null}],"outputs":[],"properties":{"cnr_id":"comfy-core","ver":"0.3.41","Node name for S&R":"SaveImage","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}}},"widgets_values":["ComfyUI"],"color":"#2a363b","bgcolor":"#3f5159"},{"id":60,"type":"JjkText","pos":[1290.0001707456386,-2100.000046545588],"size":[410,320],"flags":{},"order":5,"mode":0,"inputs":[{"label":"text","localized_name":"text","name":"text","type":"STRING","widget":{"name":"text"},"link":null}],"outputs":[{"label":"text","localized_name":"text","name":"text","type":"STRING","links":[98]}],"properties":{"Node name for S&R":"JjkText","cnr_id":"ComfyUI-Jjk-Nodes","ver":"b3c99bb78a99551776b5eab1a820e1cd58f84f31","ue_properties":{"widget_ue_connectable":{},"input_ue_unconnectable":{},"version":"7.7"},"ttNbgOverride":{"color":"#223","bgcolor":"#335","groupcolor":"#88A"}},"widgets_values":["填充遮罩区域的头发,皮肤加一点磨皮"],"color":"#223","bgcolor":"#335"},{"id":26,"type":"LoadImage","pos":[20.000035111957914,-2120.000046545588],"size":[590,530],"flags":{},"order":6,"mode":0,"inputs":[{"localized_name":"图像","name":"image","type":"COMBO","widget":{"name":"image"},"link":null},{"localized_name":"选择文件上传","name":"upload","type":"IMAGEUPLOAD","widget":{"name":"upload"},"link":null}],"outputs":[{"label":"图像","localized_name":"图像","name":"IMAGE","type":"IMAGE","links":[75,100,101,102]},{"label":"遮罩","localized_name":"遮罩","name":"MASK","type":"MASK","links":[38]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.43","Node name for S&R":"LoadImage","ue_properties":{"version":"7.7","widget_ue_connectable":{},"input_ue_unconnectable":{}},"#sdppp_variant":"default","#sdppp_simple_content":"canvas","#sdppp_simple_mask":"canvas","#sdppp_simple_boundary":"canvas","#sdppp_label":"","image":"clipspace/clipspace-painted-masked-1784202952306.png [input]"},"widgets_values":["clipspace/clipspace-painted-masked-1784202952306.png [input]","image"],"color":"#2a363b","bgcolor":"#3f5159"}],"links":[[1,2,0,1,0,"MODEL"],[2,16,0,2,0,"MODEL"],[3,14,0,2,3,"INT"],[4,14,1,2,4,"INT"],[5,19,0,5,0,"CONDITIONING"],[6,13,0,5,1,"LATENT"],[7,14,0,7,0,"INT"],[8,14,1,7,1,"INT"],[9,6,0,9,0,"NOISE"],[10,20,0,9,1,"GUIDER"],[11,8,0,9,2,"SAMPLER"],[12,1,0,9,3,"SIGMAS"],[13,7,0,9,4,"LATENT"],[14,9,0,10,0,"LATENT"],[15,3,0,10,1,"VAE"],[18,3,0,13,1,"VAE"],[24,22,0,19,0,"CONDITIONING"],[25,2,0,20,0,"MODEL"],[38,26,1,33,0,"MASK"],[41,33,0,36,0,"MASK"],[44,36,0,39,0,"IMAGE"],[45,31,0,39,2,"INT"],[46,31,1,39,3,"INT"],[47,39,0,37,0,"IMAGE"],[55,31,0,32,3,"INT"],[56,31,1,32,4,"INT"],[57,32,0,44,0,"IMAGE"],[58,32,1,44,1,"MASK"],[59,44,0,45,0,"IMAGE"],[62,44,0,14,0,"IMAGE"],[63,44,0,13,0,"IMAGE"],[75,26,0,53,1,"IMAGE"],[79,37,0,32,1,"MASK"],[92,61,0,22,0,"CLIP"],[95,10,0,62,1,"IMAGE"],[96,62,0,17,0,"IMAGE"],[97,62,0,53,0,"IMAGE"],[98,60,0,22,1,"STRING"],[100,26,0,31,0,"IMAGE"],[101,26,0,32,0,"IMAGE"],[102,26,0,62,0,"IMAGE"],[104,5,0,20,1,"CONDITIONING"]],"groups":[{"id":2,"title":"图片上传(图片上右键open in maskeditor画遮罩范围,不用涂)","bounding":[-10,-2270,1249.2113037109375,726.7728881835938],"color":"#A88","font_size":45,"flags":{}},{"id":5,"title":"提示词【很重要】","bounding":[1260,-2260,481.13201904296875,714.9009399414062],"color":"#8A8","font_size":24,"flags":{}},{"id":6,"title":"最终效果区","bounding":[1760,-2260,1330.0355224609375,711.3678588867188],"color":"#3f789e","font_size":24,"flags":{}},{"id":7,"title":"核心工作区","bounding":[990,-1480,379.9303894042969,546.5068969726562],"color":"#3f789e","font_size":24,"flags":{}},{"id":9,"title":"Group","bounding":[310,-1470,635.491455078125,641.5743408203125],"color":"#3f789e","font_size":24,"flags":{}},{"id":10,"title":"Group","bounding":[-50,-1460,321.03936767578125,291.3662414550781],"color":"#3f789e","font_size":24,"flags":{}},{"id":11,"title":"Group","bounding":[1390,-1470,1745.5640869140625,621.2001342773438],"color":"#3f789e","font_size":24,"flags":{}}],"config":{},"extra":{"links_added_by_ue":[],"VHS_KeepIntermediate":true,"ue_links":[],"VHS_MetadataImage":true,"0246.VERSION":[0,0,4],"VHS_latentpreviewrate":0,"frontendVersion":"1.41.21","VHS_latentpreview":false,"ds":{"scale":0.45,"offset":[1726.6666011315049,2886.944475612862]},"workflowRendererVersion":"LG","favoritedWidgets":{"favorites":[{"nodeLocatorId":"26","widgetName":"$$canvas-image-preview"}]}},"version":0.4} \ No newline at end of file +{"id": "431f1189-2c6a-448d-925e-5f6c85416393", "revision": 0, "last_node_id": 63, "last_link_id": 104, "nodes": [{"id": 37, "type": "Image To Mask", "pos": [330.00017074563834, -900.0000465455873], "size": [280, 110], "flags": {}, "order": 13, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "image", "type": "IMAGE", "link": 47}, {"label": "方法", "localized_name": "方法", "name": "method", "type": "COMBO", "widget": {"name": "method"}, "link": null}], "outputs": [{"label": "遮罩", "localized_name": "遮罩", "name": "MASK", "type": "MASK", "links": [79]}], "properties": {"Node name for S&R": "Image To Mask", "cnr_id": "masquerade-nodes-comfyui", "ver": "432cb4d146a391b387a0cd25ace824328b5b61cf", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["intensity"], "color": "#223", "bgcolor": "#335"}, {"id": 33, "type": "Mask Fill Holes", "pos": [320.0000351119579, -1320.0000465455873], "size": [290, 80], "flags": {}, "order": 9, "mode": 0, "inputs": [{"label": "遮罩", "localized_name": "遮罩", "name": "masks", "type": "MASK", "link": 38}], "outputs": [{"label": "遮罩", "localized_name": "遮罩", "name": "MASKS", "type": "MASK", "links": [41]}], "properties": {"cnr_id": "was-node-suite-comfyui", "ver": "1cd8d304eda256c412b8589ce1f00be3c61cf9ec", "Node name for S&R": "Mask Fill Holes", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 32, "type": "LayerUtility: ImageScaleByAspectRatio V2", "pos": [650.0000351119579, -1399.9999109119071], "size": [320, 480], "flags": {}, "order": 14, "mode": 0, "inputs": [{"label": "图像", "localized_name": "image", "name": "image", "shape": 7, "type": "IMAGE", "link": 101}, {"label": "遮罩", "localized_name": "mask", "name": "mask", "shape": 7, "type": "MASK", "link": 79}, {"localized_name": "aspect_ratio", "name": "aspect_ratio", "type": "COMBO", "widget": {"name": "aspect_ratio"}, "link": null}, {"label": "proportional_width", "localized_name": "proportional_width", "name": "proportional_width", "type": "INT", "widget": {"name": "proportional_width"}, "link": 55}, {"label": "proportional_height", "localized_name": "proportional_height", "name": "proportional_height", "type": "INT", "widget": {"name": "proportional_height"}, "link": 56}, {"localized_name": "fit", "name": "fit", "type": "COMBO", "widget": {"name": "fit"}, "link": null}, {"localized_name": "method", "name": "method", "type": "COMBO", "widget": {"name": "method"}, "link": null}, {"localized_name": "round_to_multiple", "name": "round_to_multiple", "type": "COMBO", "widget": {"name": "round_to_multiple"}, "link": null}, {"localized_name": "scale_to_side", "name": "scale_to_side", "type": "COMBO", "widget": {"name": "scale_to_side"}, "link": null}, {"localized_name": "scale_to_length", "name": "scale_to_length", "type": "INT", "widget": {"name": "scale_to_length"}, "link": null}, {"localized_name": "background_color", "name": "background_color", "type": "STRING", "widget": {"name": "background_color"}, "link": null}], "outputs": [{"label": "图像", "localized_name": "image", "name": "image", "type": "IMAGE", "links": [57]}, {"label": "遮罩", "localized_name": "mask", "name": "mask", "type": "MASK", "links": [58]}, {"label": "原始大小", "localized_name": "original_size", "name": "original_size", "type": "BOX"}, {"label": "width", "localized_name": "width", "name": "width", "type": "INT"}, {"label": "height", "localized_name": "height", "name": "height", "type": "INT"}], "properties": {"cnr_id": "comfyui_layerstyle", "ver": "a46b1e6d26d45be9784c49f7065ba44700ef2b63", "Node name for S&R": "LayerUtility: ImageScaleByAspectRatio V2", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": ["custom", 1, 1, "letterbox", "lanczos", "8", "None", 1024, "#000000"], "color": "rgba(38, 73, 116, 0.7)"}, {"id": 14, "type": "GetImageSize+", "pos": [1400.0001707456386, -930.0000465455873], "size": [320, 120.15625], "flags": {}, "order": 17, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "image", "type": "IMAGE", "link": 62}], "outputs": [{"label": "宽度", "localized_name": "宽度", "name": "width", "type": "INT", "links": [3, 7]}, {"label": "高度", "localized_name": "高度", "name": "height", "type": "INT", "links": [4, 8]}, {"label": "count", "localized_name": "count", "name": "count", "type": "INT"}], "properties": {"cnr_id": "comfyui_essentials", "ver": "9d9f4bedfc9f0321c19faf71855e228c93bd0dc9", "Node name for S&R": "GetImageSize+", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 13, "type": "VAEEncode", "pos": [1409.9998994782773, -1100.0000465455873], "size": [320, 100], "flags": {}, "order": 18, "mode": 0, "inputs": [{"label": "图像", "localized_name": "像素", "name": "pixels", "type": "IMAGE", "link": 63}, {"label": "VAE", "localized_name": "vae", "name": "vae", "type": "VAE", "link": 18}], "outputs": [{"label": "Latent", "localized_name": "Latent", "name": "LATENT", "type": "LATENT", "links": [6]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "VAEEncode", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 9, "type": "SamplerCustomAdvanced", "pos": [2500.000170745638, -1220.0000465455873], "size": [270, 330], "flags": {}, "order": 24, "mode": 0, "inputs": [{"label": "噪波生成", "localized_name": "噪波", "name": "noise", "type": "NOISE", "link": 9}, {"label": "引导", "localized_name": "引导器", "name": "guider", "type": "GUIDER", "link": 10}, {"label": "采样器", "localized_name": "采样器", "name": "sampler", "type": "SAMPLER", "link": 11}, {"label": "Sigmas", "localized_name": "西格玛", "name": "sigmas", "type": "SIGMAS", "link": 12}, {"label": "Latent", "localized_name": "Latent图像", "name": "latent_image", "type": "LATENT", "link": 13}], "outputs": [{"label": "输出", "localized_name": "Latent", "name": "output", "type": "LATENT", "slot_index": 0, "links": [14]}, {"label": "降噪输出", "localized_name": "降噪Latent", "name": "denoised_output", "type": "LATENT"}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "SamplerCustomAdvanced", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 22, "type": "CLIPTextEncode", "pos": [1300.0001707456386, -1709.999910911907], "size": [390, 140], "flags": {}, "order": 7, "mode": 0, "inputs": [{"label": "CLIP", "localized_name": "clip", "name": "clip", "type": "CLIP", "link": 92}, {"label": "text", "localized_name": "文本", "name": "text", "type": "STRING", "widget": {"name": "text"}, "link": 98}], "outputs": [{"label": "条件", "localized_name": "条件", "name": "CONDITIONING", "type": "CONDITIONING", "slot_index": 0, "links": [24]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "CLIPTextEncode", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": ["The yellow part of the picture is replaced by a black bowl."], "color": "#232", "bgcolor": "#353"}, {"id": 10, "type": "VAEDecode", "pos": [2759.9998994782773, -1370.0000465455873], "size": [320, 100], "flags": {}, "order": 25, "mode": 0, "inputs": [{"label": "Latent", "localized_name": "Latent", "name": "samples", "type": "LATENT", "link": 14}, {"label": "VAE", "localized_name": "vae", "name": "vae", "type": "VAE", "link": 15}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "IMAGE", "type": "IMAGE", "slot_index": 0, "links": [95]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "VAEDecode", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 39, "type": "ImageScale", "pos": [320.0000351119579, -1150.0000465455873], "size": [290, 210], "flags": {}, "order": 12, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "image", "type": "IMAGE", "link": 44}, {"localized_name": "缩放算法", "name": "upscale_method", "type": "COMBO", "widget": {"name": "upscale_method"}, "link": null}, {"label": "width", "localized_name": "宽度", "name": "width", "type": "INT", "widget": {"name": "width"}, "link": 45}, {"label": "height", "localized_name": "高度", "name": "height", "type": "INT", "widget": {"name": "height"}, "link": 46}, {"localized_name": "裁剪", "name": "crop", "type": "COMBO", "widget": {"name": "crop"}, "link": null}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "IMAGE", "type": "IMAGE", "links": [47]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.43", "Node name for S&R": "ImageScale", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["nearest-exact", 512, 512, "disabled"], "color": "#223", "bgcolor": "#335"}, {"id": 36, "type": "Convert Masks to Images", "pos": [320.0000351119579, -1250.0000465455873], "size": [290, 80], "flags": {}, "order": 11, "mode": 0, "inputs": [{"label": "遮罩", "localized_name": "遮罩", "name": "masks", "type": "MASK", "link": 41}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "IMAGES", "type": "IMAGE", "links": [44]}], "properties": {"cnr_id": "was-node-suite-comfyui", "ver": "1cd8d304eda256c412b8589ce1f00be3c61cf9ec", "Node name for S&R": "Convert Masks to Images", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 44, "type": "ImageAndMaskPreview", "pos": [639.9998994782773, -990.0000465455873], "size": [290, 200], "flags": {}, "order": 15, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "image", "shape": 7, "type": "IMAGE", "link": 57}, {"label": "遮罩", "localized_name": "遮罩", "name": "mask", "shape": 7, "type": "MASK", "link": 58}, {"label": "遮罩不透明", "localized_name": "遮罩不透明", "name": "mask_opacity", "type": "FLOAT", "widget": {"name": "mask_opacity"}, "link": null}, {"label": "遮罩颜色", "localized_name": "遮罩颜色", "name": "mask_color", "type": "STRING", "widget": {"name": "mask_color"}, "link": null}, {"label": "穿透", "localized_name": "穿透", "name": "pass_through", "type": "BOOLEAN", "widget": {"name": "pass_through"}, "link": null}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "composite", "type": "IMAGE", "links": [59, 62, 63]}], "properties": {"cnr_id": "comfyui-kjnodes", "ver": "aeab1a7de581dc7253f48257392e8287bbeee4a9", "Node name for S&R": "ImageAndMaskPreview", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [1, "FFFF00", true], "color": "#223", "bgcolor": "#335"}, {"id": 7, "type": "EmptySD3LatentImage", "pos": [1789.9998994782773, -990.0000465455873], "size": [310, 170], "flags": {}, "order": 20, "mode": 0, "inputs": [{"label": "width", "localized_name": "宽度", "name": "width", "type": "INT", "widget": {"name": "width"}, "link": 7}, {"label": "height", "localized_name": "高度", "name": "height", "type": "INT", "widget": {"name": "height"}, "link": 8}, {"localized_name": "批量大小", "name": "batch_size", "type": "INT", "widget": {"name": "batch_size"}, "link": null}], "outputs": [{"label": "Latent", "localized_name": "Latent", "name": "LATENT", "type": "LATENT", "slot_index": 0, "links": [13]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "EmptySD3LatentImage", "ue_properties": {"version": "7.7", "widget_ue_connectable": {"width": true, "height": true}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [1024, 1024, 1], "color": "#223", "bgcolor": "#335"}, {"id": 62, "type": "ColorMatch", "pos": [2790.000170745638, -1210.0000465455873], "size": [270, 200], "flags": {}, "order": 26, "mode": 0, "inputs": [{"label": "参考图像", "localized_name": "参考图像", "name": "image_ref", "type": "IMAGE", "link": 102}, {"label": "目标图像", "localized_name": "目标图像", "name": "image_target", "type": "IMAGE", "link": 95}, {"label": "方法", "localized_name": "方法", "name": "method", "type": "COMBO", "widget": {"name": "method"}, "link": null}, {"label": "强度", "localized_name": "强度", "name": "strength", "shape": 7, "type": "FLOAT", "widget": {"name": "strength"}, "link": null}, {"label": "多线程", "localized_name": "多线程", "name": "multithread", "shape": 7, "type": "BOOLEAN", "widget": {"name": "multithread"}, "link": null}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "image", "type": "IMAGE", "links": [96, 97]}], "properties": {"cnr_id": "comfyui-kjnodes", "ver": "5b38397a6430fdb16c7bd14a6bd64c2b0e69a5f0", "Node name for S&R": "ColorMatch", "ue_properties": {"widget_ue_connectable": {}, "input_ue_unconnectable": {}, "version": "7.6.2"}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["mkl", 1, true], "color": "#223", "bgcolor": "#335"}, {"id": 1, "type": "BasicScheduler", "pos": [2150.000170745638, -1220.0000465455873], "size": [320, 180], "flags": {}, "order": 22, "mode": 0, "inputs": [{"label": "模型", "localized_name": "模型", "name": "model", "type": "MODEL", "link": 1}, {"localized_name": "调度器", "name": "scheduler", "type": "COMBO", "widget": {"name": "scheduler"}, "link": null}, {"localized_name": "步数", "name": "steps", "type": "INT", "widget": {"name": "steps"}, "link": null}, {"localized_name": "降噪", "name": "denoise", "type": "FLOAT", "widget": {"name": "denoise"}, "link": null}], "outputs": [{"label": "Sigmas", "localized_name": "Sigmas", "name": "SIGMAS", "type": "SIGMAS", "links": [12]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "BasicScheduler", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["simple", 6, 1], "color": "#223", "bgcolor": "#335"}, {"id": 6, "type": "RandomNoise", "pos": [1770.0001707456386, -1170.0000465455873], "size": [310, 110], "flags": {}, "order": 0, "mode": 0, "inputs": [{"localized_name": "噪波随机种", "name": "noise_seed", "type": "INT", "widget": {"name": "noise_seed"}, "link": null}], "outputs": [{"label": "噪波生成", "localized_name": "噪波", "name": "NOISE", "type": "NOISE", "links": [9]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "RandomNoise", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": [1109407891267066, "randomize"], "color": "#2a363b", "bgcolor": "#3f5159"}, {"id": 8, "type": "KSamplerSelect", "pos": [1750.0001707456386, -1290.0000465455873], "size": [320, 110], "flags": {}, "order": 1, "mode": 0, "inputs": [{"localized_name": "采样器名称", "name": "sampler_name", "type": "COMBO", "widget": {"name": "sampler_name"}, "link": null}], "outputs": [{"label": "采样器", "localized_name": "采样器", "name": "SAMPLER", "type": "SAMPLER", "links": [11]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "KSamplerSelect", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["euler"], "color": "#223", "bgcolor": "#335"}, {"id": 31, "type": "easy imageSize", "pos": [-29.999964888042086, -1380.0000465455873], "size": [290, 170], "flags": {}, "order": 8, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "image", "type": "IMAGE", "link": 100}], "outputs": [{"label": "宽度", "localized_name": "宽度", "name": "width_int", "type": "INT", "links": [45, 55]}, {"label": "高度", "localized_name": "高度", "name": "height_int", "type": "INT", "links": [46, 56]}], "properties": {"cnr_id": "comfyui-easy-use", "ver": "501d97bb5ca8d61b486d47379fb1f21a41b772d7", "Node name for S&R": "easy imageSize", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["Width: 767 , Height: 747"], "color": "#223", "bgcolor": "#335"}, {"id": 20, "type": "BasicGuider", "pos": [2170.000170745638, -1350.0000465455873], "size": [270, 100], "flags": {}, "order": 23, "mode": 0, "inputs": [{"label": "模型", "localized_name": "模型", "name": "model", "type": "MODEL", "link": 25}, {"label": "条件", "localized_name": "条件", "name": "conditioning", "type": "CONDITIONING", "link": 104}], "outputs": [{"label": "引导", "localized_name": "引导器", "name": "GUIDER", "type": "GUIDER", "slot_index": 0, "links": [10]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "BasicGuider", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 5, "type": "ReferenceLatent", "pos": [1409.9998994782773, -1220.0000465455873], "size": [310, 100], "flags": {}, "order": 21, "mode": 0, "inputs": [{"label": "conditioning", "localized_name": "条件", "name": "conditioning", "type": "CONDITIONING", "link": 5}, {"label": "latent", "localized_name": "Latent", "name": "latent", "shape": 7, "type": "LATENT", "link": 6}], "outputs": [{"label": "CONDITIONING", "localized_name": "条件", "name": "CONDITIONING", "type": "CONDITIONING", "links": [104]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "ReferenceLatent", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [], "color": "#223", "bgcolor": "#335"}, {"id": 19, "type": "FluxGuidance", "pos": [1420.0001707456386, -1350.0000465455873], "size": [310, 110], "flags": {}, "order": 10, "mode": 0, "inputs": [{"label": "条件", "localized_name": "条件", "name": "conditioning", "type": "CONDITIONING", "link": 24}, {"localized_name": "引导", "name": "guidance", "type": "FLOAT", "widget": {"name": "guidance"}, "link": null}], "outputs": [{"label": "条件", "localized_name": "条件", "name": "CONDITIONING", "type": "CONDITIONING", "slot_index": 0, "links": [5]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "FluxGuidance", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": [1], "color": "#233", "bgcolor": "#355"}, {"id": 2, "type": "ModelSamplingFlux", "pos": [2130.000170745638, -1020.0000465455873], "size": [320, 200], "flags": {}, "order": 19, "mode": 0, "inputs": [{"label": "模型", "localized_name": "模型", "name": "model", "type": "MODEL", "link": 2}, {"localized_name": "最大移位", "name": "max_shift", "type": "FLOAT", "widget": {"name": "max_shift"}, "link": null}, {"localized_name": "基础移位", "name": "base_shift", "type": "FLOAT", "widget": {"name": "base_shift"}, "link": null}, {"label": "width", "localized_name": "宽度", "name": "width", "type": "INT", "widget": {"name": "width"}, "link": 3}, {"label": "height", "localized_name": "高度", "name": "height", "type": "INT", "widget": {"name": "height"}, "link": 4}], "outputs": [{"label": "模型", "localized_name": "模型", "name": "MODEL", "type": "MODEL", "slot_index": 0, "links": [1, 25]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "ModelSamplingFlux", "ue_properties": {"version": "7.7", "widget_ue_connectable": {"width": true, "height": true}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": [1.15, 0.5, 1024, 1024], "color": "#223", "bgcolor": "#335"}, {"id": 16, "type": "UNETLoader", "pos": [1010.0000351119579, -1390.0000465455873], "size": [310, 150], "flags": {}, "order": 2, "mode": 0, "inputs": [{"localized_name": "UNet名称", "name": "unet_name", "type": "COMBO", "widget": {"name": "unet_name"}, "link": null}, {"localized_name": "数据类型", "name": "weight_dtype", "type": "COMBO", "widget": {"name": "weight_dtype"}, "link": null}], "outputs": [{"label": "模型", "localized_name": "模型", "name": "MODEL", "type": "MODEL", "slot_index": 0, "links": [2]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "UNETLoader", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": ["flux2.0/flux-2-klein-9b-fp8.safetensors", "fp8_e4m3fn"], "color": "#223", "bgcolor": "#335"}, {"id": 3, "type": "VAELoader", "pos": [1010.0000351119579, -1250.0000465455873], "size": [310, 110], "flags": {}, "order": 3, "mode": 0, "inputs": [{"localized_name": "vae名称", "name": "vae_name", "type": "COMBO", "widget": {"name": "vae_name"}, "link": null}], "outputs": [{"label": "VAE", "localized_name": "VAE", "name": "VAE", "type": "VAE", "slot_index": 0, "links": [15, 18]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "VAELoader", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["flux2-vae.safetensors"], "color": "#223", "bgcolor": "#335"}, {"id": 61, "type": "CLIPLoader", "pos": [1000.0000351119579, -1110.0000465455873], "size": [350, 180], "flags": {}, "order": 4, "mode": 0, "inputs": [{"label": "clip_name", "localized_name": "CLIP名称", "name": "clip_name", "type": "COMBO", "widget": {"name": "clip_name"}, "link": null}, {"label": "type", "localized_name": "类型", "name": "type", "type": "COMBO", "widget": {"name": "type"}, "link": null}, {"label": "device", "localized_name": "设备", "name": "device", "shape": 7, "type": "COMBO", "widget": {"name": "device"}, "link": null}], "outputs": [{"label": "CLIP", "localized_name": "CLIP", "name": "CLIP", "type": "CLIP", "links": [92]}], "properties": {"cnr_id": "comfy-core", "ver": "0.8.2", "Node name for S&R": "CLIPLoader", "ue_properties": {"version": "7.2.2", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "hasSecondTab": false, "models": [{"name": "qwen_3_4b.safetensors", "directory": "text_encoders", "url": "https://huggingface.co/Comfy-Org/flux2-klein-4B/resolve/main/split_files/text_encoders/qwen_3_4b.safetensors"}], "secondTabText": "Send Back", "enableTabs": false, "secondTabOffset": 80, "tabWidth": 65, "secondTabWidth": 65, "tabXOffset": 10, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}, "widget_ue_connectable": {"clip_name": true, "type": true, "device": true}}, "widgets_values": ["qwen_3_8b_fp8mixed.safetensors", "flux2", "default"], "color": "#223", "bgcolor": "#335"}, {"id": 45, "type": "PreviewImage", "pos": [710.0000351119579, -2120.000046545588], "size": [490, 500], "flags": {}, "order": 16, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图像", "name": "images", "type": "IMAGE", "link": 59}], "outputs": [], "properties": {"cnr_id": "comfy-core", "ver": "0.3.43", "Node name for S&R": "PreviewImage", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": [], "color": "#233", "bgcolor": "#355"}, {"id": 53, "type": "Image Comparer (rgthree)", "pos": [1804.9843155517362, -2156.5215467241615], "size": [650, 550], "flags": {}, "order": 28, "mode": 0, "inputs": [{"dir": 3, "label": "图像_A", "name": "image_a", "type": "IMAGE", "link": 97}, {"dir": 3, "label": "图像_B", "name": "image_b", "type": "IMAGE", "link": 75}], "outputs": [], "properties": {"cnr_id": "rgthree-comfy", "ver": "84a146fee39f7b3a8c6631dcac29bc13b077eb49", "comparer_mode": "Slide", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": [[{"name": "A", "selected": true, "url": "/api/view?filename=rgthree.compare._temp_nqvym_00029_.png&type=temp&subfolder=&rand=0.5791789168392755"}, {"name": "B", "selected": true, "url": "/api/view?filename=rgthree.compare._temp_nqvym_00030_.png&type=temp&subfolder=&rand=0.21946935876437912"}]], "color": "#2a363b", "bgcolor": "#3f5159"}, {"id": 17, "type": "SaveImage", "pos": [2480.000170745638, -2170.000046545588], "size": [570, 580], "flags": {}, "order": 27, "mode": 0, "inputs": [{"label": "图像", "localized_name": "图片", "name": "images", "type": "IMAGE", "link": 96}, {"localized_name": "文件名前缀", "name": "filename_prefix", "type": "STRING", "widget": {"name": "filename_prefix"}, "link": null}], "outputs": [], "properties": {"cnr_id": "comfy-core", "ver": "0.3.41", "Node name for S&R": "SaveImage", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}}, "widgets_values": ["ComfyUI"], "color": "#2a363b", "bgcolor": "#3f5159"}, {"id": 60, "type": "JjkText", "pos": [1290.0001707456386, -2100.000046545588], "size": [410, 320], "flags": {}, "order": 5, "mode": 0, "inputs": [{"label": "text", "localized_name": "text", "name": "text", "type": "STRING", "widget": {"name": "text"}, "link": null}], "outputs": [{"label": "text", "localized_name": "text", "name": "text", "type": "STRING", "links": [98]}], "properties": {"Node name for S&R": "JjkText", "cnr_id": "ComfyUI-Jjk-Nodes", "ver": "b3c99bb78a99551776b5eab1a820e1cd58f84f31", "ue_properties": {"widget_ue_connectable": {}, "input_ue_unconnectable": {}, "version": "7.7"}, "ttNbgOverride": {"color": "#223", "bgcolor": "#335", "groupcolor": "#88A"}}, "widgets_values": ["填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜"], "color": "#223", "bgcolor": "#335"}, {"id": 26, "type": "LoadImage", "pos": [20.000035111957914, -2120.000046545588], "size": [590, 530], "flags": {}, "order": 6, "mode": 0, "inputs": [{"localized_name": "图像", "name": "image", "type": "COMBO", "widget": {"name": "image"}, "link": null}, {"localized_name": "选择文件上传", "name": "upload", "type": "IMAGEUPLOAD", "widget": {"name": "upload"}, "link": null}], "outputs": [{"label": "图像", "localized_name": "图像", "name": "IMAGE", "type": "IMAGE", "links": [75, 100, 101, 102]}, {"label": "遮罩", "localized_name": "遮罩", "name": "MASK", "type": "MASK", "links": [38]}], "properties": {"cnr_id": "comfy-core", "ver": "0.3.43", "Node name for S&R": "LoadImage", "ue_properties": {"version": "7.7", "widget_ue_connectable": {}, "input_ue_unconnectable": {}}, "#sdppp_variant": "default", "#sdppp_simple_content": "canvas", "#sdppp_simple_mask": "canvas", "#sdppp_simple_boundary": "canvas", "#sdppp_label": "", "image": "clipspace/clipspace-painted-masked-1784202952306.png [input]"}, "widgets_values": ["clipspace/clipspace-painted-masked-1784202952306.png [input]", "image"], "color": "#2a363b", "bgcolor": "#3f5159"}], "links": [[1, 2, 0, 1, 0, "MODEL"], [2, 16, 0, 2, 0, "MODEL"], [3, 14, 0, 2, 3, "INT"], [4, 14, 1, 2, 4, "INT"], [5, 19, 0, 5, 0, "CONDITIONING"], [6, 13, 0, 5, 1, "LATENT"], [7, 14, 0, 7, 0, "INT"], [8, 14, 1, 7, 1, "INT"], [9, 6, 0, 9, 0, "NOISE"], [10, 20, 0, 9, 1, "GUIDER"], [11, 8, 0, 9, 2, "SAMPLER"], [12, 1, 0, 9, 3, "SIGMAS"], [13, 7, 0, 9, 4, "LATENT"], [14, 9, 0, 10, 0, "LATENT"], [15, 3, 0, 10, 1, "VAE"], [18, 3, 0, 13, 1, "VAE"], [24, 22, 0, 19, 0, "CONDITIONING"], [25, 2, 0, 20, 0, "MODEL"], [38, 26, 1, 33, 0, "MASK"], [41, 33, 0, 36, 0, "MASK"], [44, 36, 0, 39, 0, "IMAGE"], [45, 31, 0, 39, 2, "INT"], [46, 31, 1, 39, 3, "INT"], [47, 39, 0, 37, 0, "IMAGE"], [55, 31, 0, 32, 3, "INT"], [56, 31, 1, 32, 4, "INT"], [57, 32, 0, 44, 0, "IMAGE"], [58, 32, 1, 44, 1, "MASK"], [59, 44, 0, 45, 0, "IMAGE"], [62, 44, 0, 14, 0, "IMAGE"], [63, 44, 0, 13, 0, "IMAGE"], [75, 26, 0, 53, 1, "IMAGE"], [79, 37, 0, 32, 1, "MASK"], [92, 61, 0, 22, 0, "CLIP"], [95, 10, 0, 62, 1, "IMAGE"], [96, 62, 0, 17, 0, "IMAGE"], [97, 62, 0, 53, 0, "IMAGE"], [98, 60, 0, 22, 1, "STRING"], [100, 26, 0, 31, 0, "IMAGE"], [101, 26, 0, 32, 0, "IMAGE"], [102, 26, 0, 62, 0, "IMAGE"], [104, 5, 0, 20, 1, "CONDITIONING"]], "groups": [{"id": 2, "title": "图片上传(图片上右键open in maskeditor画遮罩范围,不用涂)", "bounding": [-10, -2270, 1249.2113037109375, 726.7728881835938], "color": "#A88", "font_size": 45, "flags": {}}, {"id": 5, "title": "提示词【很重要】", "bounding": [1260, -2260, 481.13201904296875, 714.9009399414062], "color": "#8A8", "font_size": 24, "flags": {}}, {"id": 6, "title": "最终效果区", "bounding": [1760, -2260, 1330.0355224609375, 711.3678588867188], "color": "#3f789e", "font_size": 24, "flags": {}}, {"id": 7, "title": "核心工作区", "bounding": [990, -1480, 379.9303894042969, 546.5068969726562], "color": "#3f789e", "font_size": 24, "flags": {}}, {"id": 9, "title": "Group", "bounding": [310, -1470, 635.491455078125, 641.5743408203125], "color": "#3f789e", "font_size": 24, "flags": {}}, {"id": 10, "title": "Group", "bounding": [-50, -1460, 321.03936767578125, 291.3662414550781], "color": "#3f789e", "font_size": 24, "flags": {}}, {"id": 11, "title": "Group", "bounding": [1390, -1470, 1745.5640869140625, 621.2001342773438], "color": "#3f789e", "font_size": 24, "flags": {}}], "config": {}, "extra": {"links_added_by_ue": [], "VHS_KeepIntermediate": true, "ue_links": [], "VHS_MetadataImage": true, "0246.VERSION": [0, 0, 4], "VHS_latentpreviewrate": 0, "frontendVersion": "1.41.21", "VHS_latentpreview": false, "ds": {"scale": 0.45, "offset": [1726.6666011315049, 2886.944475612862]}, "workflowRendererVersion": "LG", "favoritedWidgets": {"favorites": [{"nodeLocatorId": "26", "widgetName": "$$canvas-image-preview"}]}}, "version": 0.4} \ No newline at end of file diff --git a/add_hair.json b/add_hair.json index da8d33a..2a6c7e0 100644 --- a/add_hair.json +++ b/add_hair.json @@ -1 +1,450 @@ -{"1": {"inputs": {"scheduler": "simple", "steps": 4, "denoise": 1, "model": ["2", 0]}, "class_type": "BasicScheduler", "_meta": {"title": "基本调度器"}}, "2": {"inputs": {"max_shift": 1.15, "base_shift": 0.5, "width": ["14", 0], "height": ["14", 1], "model": ["16", 0]}, "class_type": "ModelSamplingFlux", "_meta": {"title": "采样算法(Flux)"}}, "3": {"inputs": {"vae_name": "flux2-vae.safetensors"}, "class_type": "VAELoader", "_meta": {"title": "加载VAE"}}, "5": {"inputs": {"conditioning": ["19", 0], "latent": ["13", 0]}, "class_type": "ReferenceLatent", "_meta": {"title": "参考Latent"}}, "6": {"inputs": {"noise_seed": 217742615722421}, "class_type": "RandomNoise", "_meta": {"title": "随机噪波"}}, "7": {"inputs": {"width": ["14", 0], "height": ["14", 1], "batch_size": 1}, "class_type": "EmptySD3LatentImage", "_meta": {"title": "空Latent图像(SD3)"}}, "8": {"inputs": {"sampler_name": "euler"}, "class_type": "KSamplerSelect", "_meta": {"title": "K采样器选择"}}, "9": {"inputs": {"noise": ["6", 0], "guider": ["20", 0], "sampler": ["8", 0], "sigmas": ["1", 0], "latent_image": ["7", 0]}, "class_type": "SamplerCustomAdvanced", "_meta": {"title": "自定义采样器(高级)"}}, "10": {"inputs": {"samples": ["9", 0], "vae": ["3", 0]}, "class_type": "VAEDecode", "_meta": {"title": "VAE解码"}}, "13": {"inputs": {"pixels": ["44", 0], "vae": ["3", 0]}, "class_type": "VAEEncode", "_meta": {"title": "VAE编码"}}, "14": {"inputs": {"image": ["44", 0]}, "class_type": "GetImageSize+", "_meta": {"title": "🔧 Get Image Size"}}, "16": {"inputs": {"unet_name": "flux-2-klein-4b-fp8.safetensors", "weight_dtype": "fp8_e4m3fn"}, "class_type": "UNETLoader", "_meta": {"title": "UNet加载器"}}, "17": {"inputs": {"filename_prefix": "ComfyUI", "images": ["62", 0]}, "class_type": "SaveImage", "_meta": {"title": "保存图像"}}, "19": {"inputs": {"guidance": 1, "conditioning": ["22", 0]}, "class_type": "FluxGuidance", "_meta": {"title": "Flux引导"}}, "20": {"inputs": {"model": ["2", 0], "conditioning": ["5", 0]}, "class_type": "BasicGuider", "_meta": {"title": "基本引导器"}}, "22": {"inputs": {"text": ["60", 0], "clip": ["61", 0]}, "class_type": "CLIPTextEncode", "_meta": {"title": "CLIP文本编码"}}, "26": {"inputs": {"image": "clipspace/clipspace-painted-masked-1781655058499.png [input]"}, "class_type": "LoadImage", "_meta": {"title": "加载图像"}}, "31": {"inputs": {"image": ["26", 0]}, "class_type": "easy imageSize", "_meta": {"title": "图像尺寸"}}, "32": {"inputs": {"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", "image": ["26", 0], "mask": ["37", 0]}, "class_type": "LayerUtility: ImageScaleByAspectRatio V2", "_meta": {"title": "LayerUtility: ImageScaleByAspectRatio V2"}}, "33": {"inputs": {"masks": ["26", 1]}, "class_type": "Mask Fill Holes", "_meta": {"title": "Mask Fill Holes"}}, "36": {"inputs": {"masks": ["33", 0]}, "class_type": "Convert Masks to Images", "_meta": {"title": "Convert Masks to Images"}}, "37": {"inputs": {"method": "intensity", "image": ["39", 0]}, "class_type": "Image To Mask", "_meta": {"title": "Image To Mask"}}, "39": {"inputs": {"upscale_method": "nearest-exact", "width": ["31", 0], "height": ["31", 1], "crop": "disabled", "image": ["36", 0]}, "class_type": "ImageScale", "_meta": {"title": "缩放图像"}}, "44": {"inputs": {"mask_opacity": 1, "mask_color": "FFFF00", "pass_through": true, "image": ["32", 0], "mask": ["32", 1]}, "class_type": "ImageAndMaskPreview", "_meta": {"title": "ImageAndMaskPreview"}}, "45": {"inputs": {"images": ["44", 0]}, "class_type": "PreviewImage", "_meta": {"title": "预览图像"}}, "53": {"inputs": {"rgthree_comparer": {"images": [{"name": "A", "selected": true, "url": "/api/view?filename=rgthree.compare._temp_zuixa_00119_.png&type=temp&subfolder=&rand=0.7926013627811991"}, {"name": "B", "selected": true, "url": "/api/view?filename=rgthree.compare._temp_zuixa_00120_.png&type=temp&subfolder=&rand=0.43692946883795813"}]}, "image_a": ["62", 0], "image_b": ["26", 0]}, "class_type": "Image Comparer (rgthree)", "_meta": {"title": "Image Comparer (rgthree)"}}, "60": {"inputs": {"text": "补充遮罩区补充遮罩区域内的头发,头发填满遮罩区域。发际线往下挡住额头"}, "class_type": "JjkText", "_meta": {"title": "Text"}}, "61": {"inputs": {"clip_name": "qwen_3_4b.safetensors", "type": "flux2", "device": "default"}, "class_type": "CLIPLoader", "_meta": {"title": "加载CLIP"}}, "62": {"inputs": {"method": "mkl", "strength": 1, "multithread": true, "image_ref": ["26", 0], "image_target": ["10", 0]}, "class_type": "ColorMatch", "_meta": {"title": "Color Match"}}} \ No newline at end of file +{ + "1": { + "inputs": { + "scheduler": "simple", + "steps": 4, + "denoise": 1, + "model": [ + "2", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "基本调度器" + } + }, + "2": { + "inputs": { + "max_shift": 1.15, + "base_shift": 0.5, + "width": [ + "14", + 0 + ], + "height": [ + "14", + 1 + ], + "model": [ + "16", + 0 + ] + }, + "class_type": "ModelSamplingFlux", + "_meta": { + "title": "采样算法(Flux)" + } + }, + "3": { + "inputs": { + "vae_name": "flux2-vae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "加载VAE" + } + }, + "5": { + "inputs": { + "conditioning": [ + "19", + 0 + ], + "latent": [ + "13", + 0 + ] + }, + "class_type": "ReferenceLatent", + "_meta": { + "title": "参考Latent" + } + }, + "6": { + "inputs": { + "noise_seed": 217742615722421 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "随机噪波" + } + }, + "7": { + "inputs": { + "width": [ + "14", + 0 + ], + "height": [ + "14", + 1 + ], + "batch_size": 1 + }, + "class_type": "EmptySD3LatentImage", + "_meta": { + "title": "空Latent图像(SD3)" + } + }, + "8": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "K采样器选择" + } + }, + "9": { + "inputs": { + "noise": [ + "6", + 0 + ], + "guider": [ + "20", + 0 + ], + "sampler": [ + "8", + 0 + ], + "sigmas": [ + "1", + 0 + ], + "latent_image": [ + "7", + 0 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "自定义采样器(高级)" + } + }, + "10": { + "inputs": { + "samples": [ + "9", + 0 + ], + "vae": [ + "3", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE解码" + } + }, + "13": { + "inputs": { + "pixels": [ + "44", + 0 + ], + "vae": [ + "3", + 0 + ] + }, + "class_type": "VAEEncode", + "_meta": { + "title": "VAE编码" + } + }, + "14": { + "inputs": { + "image": [ + "44", + 0 + ] + }, + "class_type": "GetImageSize+", + "_meta": { + "title": "🔧 Get Image Size" + } + }, + "16": { + "inputs": { + "unet_name": "flux-2-klein-4b-fp8.safetensors", + "weight_dtype": "fp8_e4m3fn" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "UNet加载器" + } + }, + "17": { + "inputs": { + "filename_prefix": "ComfyUI", + "images": [ + "62", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "保存图像" + } + }, + "19": { + "inputs": { + "guidance": 1, + "conditioning": [ + "22", + 0 + ] + }, + "class_type": "FluxGuidance", + "_meta": { + "title": "Flux引导" + } + }, + "20": { + "inputs": { + "model": [ + "2", + 0 + ], + "conditioning": [ + "5", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "基本引导器" + } + }, + "22": { + "inputs": { + "text": [ + "60", + 0 + ], + "clip": [ + "61", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP文本编码" + } + }, + "26": { + "inputs": { + "image": "clipspace/clipspace-painted-masked-1781655058499.png [input]" + }, + "class_type": "LoadImage", + "_meta": { + "title": "加载图像" + } + }, + "31": { + "inputs": { + "image": [ + "26", + 0 + ] + }, + "class_type": "easy imageSize", + "_meta": { + "title": "图像尺寸" + } + }, + "32": { + "inputs": { + "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", + "image": [ + "26", + 0 + ], + "mask": [ + "37", + 0 + ] + }, + "class_type": "LayerUtility: ImageScaleByAspectRatio V2", + "_meta": { + "title": "LayerUtility: ImageScaleByAspectRatio V2" + } + }, + "33": { + "inputs": { + "masks": [ + "26", + 1 + ] + }, + "class_type": "Mask Fill Holes", + "_meta": { + "title": "Mask Fill Holes" + } + }, + "36": { + "inputs": { + "masks": [ + "33", + 0 + ] + }, + "class_type": "Convert Masks to Images", + "_meta": { + "title": "Convert Masks to Images" + } + }, + "37": { + "inputs": { + "method": "intensity", + "image": [ + "39", + 0 + ] + }, + "class_type": "Image To Mask", + "_meta": { + "title": "Image To Mask" + } + }, + "39": { + "inputs": { + "upscale_method": "nearest-exact", + "width": [ + "31", + 0 + ], + "height": [ + "31", + 1 + ], + "crop": "disabled", + "image": [ + "36", + 0 + ] + }, + "class_type": "ImageScale", + "_meta": { + "title": "缩放图像" + } + }, + "44": { + "inputs": { + "mask_opacity": 1, + "mask_color": "FFFF00", + "pass_through": true, + "image": [ + "32", + 0 + ], + "mask": [ + "32", + 1 + ] + }, + "class_type": "ImageAndMaskPreview", + "_meta": { + "title": "ImageAndMaskPreview" + } + }, + "45": { + "inputs": { + "images": [ + "44", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "预览图像" + } + }, + "53": { + "inputs": { + "rgthree_comparer": { + "images": [ + { + "name": "A", + "selected": true, + "url": "/api/view?filename=rgthree.compare._temp_zuixa_00119_.png&type=temp&subfolder=&rand=0.7926013627811991" + }, + { + "name": "B", + "selected": true, + "url": "/api/view?filename=rgthree.compare._temp_zuixa_00120_.png&type=temp&subfolder=&rand=0.43692946883795813" + } + ] + }, + "image_a": [ + "62", + 0 + ], + "image_b": [ + "26", + 0 + ] + }, + "class_type": "Image Comparer (rgthree)", + "_meta": { + "title": "Image Comparer (rgthree)" + } + }, + "60": { + "inputs": { + "text": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜" + }, + "class_type": "JjkText", + "_meta": { + "title": "Text" + } + }, + "61": { + "inputs": { + "clip_name": "qwen_3_4b.safetensors", + "type": "flux2", + "device": "cpu" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "加载CLIP" + } + }, + "62": { + "inputs": { + "method": "mkl", + "strength": 1, + "multithread": true, + "image_ref": [ + "26", + 0 + ], + "image_target": [ + "10", + 0 + ] + }, + "class_type": "ColorMatch", + "_meta": { + "title": "Color Match" + } + } +} diff --git a/app.py b/app.py index db27d6e..f2542b3 100644 --- a/app.py +++ b/app.py @@ -718,7 +718,7 @@ async def hair_grow( hair_style: Optional[str] = Form(default=None, description="发型序号逗号分隔(必填),如 1,2,3。female:1-5 male:1-4"), beauty_enabled: bool = Form(default=False, description="是否开启美颜(本期不生效)"), use_mask: bool = Form(default=True, description="是否启用 inpaint 遮罩(测试对比用)。false 时用干净原图生成(空遮罩,不烧模板线)"), - prompt: str = Form(default="补充遮罩区域的头发,加一点美颜", description="ComfyUI 提示词,会替换工作流节点60的文本"), + prompt: str = Form(default="填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", description="ComfyUI 提示词,会替换工作流节点60的文本"), ): # 1. gender 必填校验(非法/缺失 → 1004) if gender not in ("male", "female"): @@ -771,117 +771,15 @@ async def hair_grow( # --------------------------------------------------------------------------- -# 接口 7:C 端生发 v2(add_hair2.json 工作流) +# 接口 7:C 端生发 v2 —— 已弃用(add_hair2.json 用 Klein-9b 大模型,会把常驻的 +# Klein-4b/Flux 挤出显存,导致接口2/3/5 耗时抖动;且业务已不再调用)。 +# 保留路由返回明确错误,避免老客户端拿到裸 404。 # --------------------------------------------------------------------------- -_WORKFLOW2_PATH = os.path.join(os.path.dirname(__file__), "add_hair2.json") - - -@app.post( - "/api/v1/hair/grow-v2", - summary="接口7 C端生发 v2(add_hair2 工作流)", - tags=["生发"], - description=f""" -输入用户正面照 + **性别** + **发型序号**,使用 add_hair2.json 工作流生成指定发际线类型的预览图与生发图。 -功能与接口2 完全一致,仅 ComfyUI 工作流不同。 - -{_image_fields_desc} - -图片同时支持 `multipart/form-data` 文件上传(字段名 `image_file`)。 - ---- - -- **gender**(必填):`male` / `female`。决定返回的贴图集合(female 5 张 / male 4 张)。 - 非法或缺失返回 `1004`。 -- **hair_style**(必填):`int`,发型序号。`female`:1=ellipse, 2=flower, 3=heart, 4=straight, 5=wave; - `male`:1=ellipse, 2=inverse_arc, 3=m, 4=straight。越界返回 `1007`。 -- **beauty_enabled**:本期保留但不生效。 - -`hairline_type` 取值:`ellipse` / `flower` / `heart` / `straight` / `wave`(female), -`ellipse` / `m` / `straight` / `inverse_arc`(male)。 -""", - responses={ - 200: { - "description": "成功", - "content": { - "application/json": { - "example": { - "code": 0, - "message": "success", - "request_id": "mock-request-id", - "data": { - "results": [ - {"image_base64": "iVBORw0KGgo...", "hairline_type": "ellipse", "order": 1}, - ] - }, - } - } - }, - }, - 400: { - "description": "参数错误 / 图片识别失败", - "content": { - "application/json": { - "examples": { - "图片参数错误": {"value": {"code": 1007, "message": "图片参数错误:必须且只能传 image_file / image_url / image_base64 其中一个", "request_id": "x", "data": None}}, - "非正面照": {"value": {"code": 1003, "message": "角度问题,请上传正面照", "request_id": "x", "data": None}}, - } - } - }, - }, - }, -) -async def hair_grow_v2( - image_file: Optional[UploadFile] = File(default=None, description="上传图片文件(JPG/PNG)"), - image_url: Optional[str] = Form(default=None, description="图片 URL"), - image_base64: Optional[str] = Form(default=None, description="图片 base64(需带 data:image/...;base64, 前缀)"), - gender: Optional[str] = Form(default=None, description="性别 male/female(必填)"), - hair_style: Optional[str] = Form(default=None, description="发型序号逗号分隔(必填),如 1,2,3。female:1-5 male:1-4"), - beauty_enabled: bool = Form(default=False, description="是否开启美颜(本期不生效)"), - use_mask: bool = Form(default=True, description="是否启用 inpaint 遮罩(测试对比用)。false 时用干净原图生成(空遮罩,不烧模板线)"), - prompt: str = Form(default="补充遮罩区域的头发,加一点美颜", description="ComfyUI 提示词,会替换工作流节点60的文本"), -): - # 1. gender 必填校验(非法/缺失 → 1004) - if gender not in ("male", "female"): - return err(1004, "gender 必填且只能为 male / female") - - # 2. hair_style 必填校验(解析逗号分隔,越界 → 1007) - max_styles = {"female": 5, "male": 4}[gender] - hair_styles = _parse_hair_styles(hair_style, max_styles) - if hair_styles is None: - return err(1007, f"hair_style 必填且为 1..{max_styles} 的整数(逗号分隔),收到 {hair_style!r}") - - # 3. 三选一取图 - raw, e = await resolve_image_bytes(image_file, image_url, image_base64) - if e is not None: - return e - - image = cv2.imdecode(np.frombuffer(raw, np.uint8), cv2.IMREAD_COLOR) - if image is None: - return err(1008, "图片格式不支持(仅 JPG / PNG)") - - try: - from fastapi.concurrency import run_in_threadpool - from hairline.service import generate_grow_results - - # 预览 + 生发(ComfyUI) 都是阻塞且较慢,放线程池避免卡住事件循环 - items = await run_in_threadpool(generate_grow_results, image, gender, use_mask, prompt, hair_styles, _WORKFLOW2_PATH) - if items is None: - return err(1001, "无法识别人像") - - results = [] - for p in items: - results.append({ - "image_base64": _jpg_b64(p["image_bgr"]), # 预览图 JPG - "grown_image_base64": (_png_to_jpg_b64(p["grown_png"]) # 生发图 JPG - if p["grown_png"] else None), - "hairline_type": p["hairline_type"], - "order": p["order"], - }) - return ok({"results": results}) - except Exception as ex: # noqa: BLE001 - logger.exception("接口7 处理异常") - return err(1007, f"处理失败:{ex}") +@app.post("/api/v1/hair/grow-v2", include_in_schema=False, deprecated=True) +async def hair_grow_v2(): + """接口7 已弃用:请改用 /api/v1/hair/grow(接口2)。""" + return err(1007, "接口7(/api/v1/hair/grow-v2)已弃用,请使用 /api/v1/hair/grow") # --------------------------------------------------------------------------- @@ -931,7 +829,7 @@ async def hair_grow_b( marked_image_url: Optional[str] = Form(default=None, description="划线图片 URL"), marked_image_base64: Optional[str] = Form(default=None, description="划线图片 base64"), use_mask: bool = Form(default=True, description="是否画发际线(测试对比用)。false 时跳过划线检测、直接送划线图"), - prompt: str = Form(default="补充遮罩区域的头发,加一点美颜", description="ComfyUI 提示词,会替换工作流节点60的文本"), + prompt: str = Form(default="填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", description="ComfyUI 提示词,会替换工作流节点60的文本"), ): # 划线图三选一取图(只需这一张) marked_raw, e = await resolve_image_bytes(marked_image_file, marked_image_url, marked_image_base64) @@ -1139,7 +1037,7 @@ async def hairline_generate( gender: Optional[str] = Form(default=None, description="性别 male/female(必填)"), hair_style: Optional[str] = Form(default=None, description="发型序号逗号分隔(必填,如 1,2,3)。female:1-5 male:1-4"), use_mask: bool = Form(default=True, description="生发是否启用 inpaint 遮罩(同接口2,测试对比用)"), - prompt: str = Form(default="补充遮罩区域的头发,加一点美颜", description="ComfyUI 提示词(同接口2),会替换工作流节点60的文本"), + prompt: str = Form(default="填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", description="ComfyUI 提示词(同接口2),会替换工作流节点60的文本"), ): if gender not in ("male", "female"): return err(1004, "gender 必填且只能为 male / female") @@ -1531,7 +1429,7 @@ async def hairline_grow_v2( inpainting_fill: int = Form(default=1, description="change_hair服务端重绘填充:0=保留原图 | 1=噪声 | 2=纯色 | 3=潜变量。默认 1"), mask_blur: int = Form(default=11, description="change_hair服务端遮罩边缘模糊像素,默认 11"), mask_dilate_scale: float = Form(default=1.0, description="change_hair服务端遮罩膨胀缩放,默认 1.0"), - comfyui_prompt: Optional[str] = Form(default=None, description="Flux-2 重绘提示词,None 用默认「补充遮罩区域的头发,加一点美颜」"), + comfyui_prompt: Optional[str] = Form(default=None, description="Flux-2 重绘提示词,None 用默认「填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜」"), beauty_alpha: float = Form(default=0.6, description="redraw_band 版 band 外的全脸美颜融入强度(0=band外无美颜纯用final,1≈整帧版),默认 0.6"), band_lo_mult: float = Form(default=0.5, description="重绘带外推倍率下限(相对 hairline_push_cm,内轮廓=0×、原外推线=1.0×),默认 0.5"), band_hi_mult: float = Form(default=1.5, description="重绘带外推倍率上限(相对 hairline_push_cm),默认 1.5"), @@ -1697,7 +1595,7 @@ async def hairline_grow_v2_final_v2( async def api_redraw( image_file: UploadFile = File(..., description="人物图片(JPG/PNG)"), mask_file: UploadFile = File(..., description="遮罩图片(PNG,支持红/白/alpha 格式)"), - prompt: str = Form(default="填充遮罩区域的头发,皮肤加一点磨皮", + prompt: str = Form(default="填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", description="ComfyUI 提示词"), ): image_bytes = await image_file.read() diff --git a/benchmark_9b_vs_4b.py b/benchmark_9b_vs_4b.py index 34ba8d8..5148080 100644 --- a/benchmark_9b_vs_4b.py +++ b/benchmark_9b_vs_4b.py @@ -58,7 +58,7 @@ def call_iface2(image_path, hair_style): with open(image_path, "rb") as f: img_data = f.read() fields = {"gender": "female", "hair_style": str(hair_style), - "prompt": "填充遮罩区域的头发,皮肤加一点磨皮"} + "prompt": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜"} body, boundary = _multipart( fields, {"image_file": (os.path.basename(image_path), img_data, "image/jpeg")}) req = urllib.request.Request(f"{API_BASE}/api/v1/hair/grow", data=body, method="POST") diff --git a/benchmark_iface2_female.py b/benchmark_iface2_female.py index 47e45cb..c36aa9f 100644 --- a/benchmark_iface2_female.py +++ b/benchmark_iface2_female.py @@ -56,7 +56,7 @@ def call_iface2_female(image_path, hair_style): with open(image_path, "rb") as f: img_data = f.read() fields = {"gender": "female", "hair_style": str(hair_style), - "prompt": "填充遮罩区域的头发,皮肤加一点磨皮"} + "prompt": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜"} body, boundary = _multipart( fields, {"image_file": (os.path.basename(image_path), img_data, "image/jpeg")}) req = urllib.request.Request(f"{API_BASE}/api/v1/hair/grow", data=body, method="POST") diff --git a/benchmark_rotation.py b/benchmark_rotation.py index 4512ef6..fc1ee21 100644 --- a/benchmark_rotation.py +++ b/benchmark_rotation.py @@ -89,7 +89,7 @@ def call_api2(image_path, gender, hair_style="1"): with open(image_path, "rb") as f: img_data = f.read() fields = {"gender": gender, "hair_style": hair_style, "use_mask": "0", - "prompt": "填充遮罩区域的头发,皮肤加一点磨皮"} + "prompt": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜"} body, boundary = _multipart(fields, {"image_file": (os.path.basename(image_path), img_data, "image/jpeg")}) req = urllib.request.Request(f"{API_BASE}/api/v1/hair/grow", data=body, method="POST") req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}") @@ -107,7 +107,7 @@ def call_api3(image_path): """接口3:B端生发(use_mask=False,直接送图)""" with open(image_path, "rb") as f: img_data = f.read() - fields = {"use_mask": "true", "prompt": "补充遮罩区域的头发,加一点美颜"} + fields = {"use_mask": "true", "prompt": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜"} body, boundary = _multipart(fields, {"marked_image_file": (os.path.basename(image_path), img_data, "image/jpeg")}) req = urllib.request.Request(f"{API_BASE}/api/v1/hair/grow-b", data=body, method="POST") req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}") diff --git a/face_analysis/hairline_grow.py b/face_analysis/hairline_grow.py index 32065b9..6b32fe5 100644 --- a/face_analysis/hairline_grow.py +++ b/face_analysis/hairline_grow.py @@ -1107,7 +1107,7 @@ def generate_hairline_redraw(image_bgr, hairline_id, is_hr=False, seg_model="seg "hairline_id": hairline_id, "blend_method": blend_method, "hairline_push_cm": round(float(hairline_push_cm), 2), - "comfyui_prompt": comfyui_prompt or "补充遮罩区域的头发,加一点美颜", + "comfyui_prompt": comfyui_prompt or "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", "beauty_alpha": beauty_alpha, "px_per_cm": round(float(px_per_cm), 4), "mask_pixels": mask_viz["mask_pixels"], diff --git a/hair_repaint.json b/hair_repaint.json index 624b4c9..bd46388 100644 --- a/hair_repaint.json +++ b/hair_repaint.json @@ -410,7 +410,7 @@ }, "60": { "inputs": { - "text": "补充遮罩区域的头发,加一点美颜" + "text": "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜" }, "class_type": "JjkText", "_meta": { diff --git a/hairline/comfyui.py b/hairline/comfyui.py index 0a2a23f..9f68b7b 100644 --- a/hairline/comfyui.py +++ b/hairline/comfyui.py @@ -85,11 +85,13 @@ def _get_output_node(workflow_path: str | None = None) -> str: def run(rgba_png_bytes: bytes, timeout: float = COMFY_TIMEOUT, prompt: str = None, - workflow_path: str | None = None) -> bytes: + workflow_path: str | None = None, front: bool = False) -> bytes: """提交一次生发任务,返回输出 PNG 字节。失败抛异常。 prompt:非 None 时替换工作流节点60(JjkText)的文本;None 时用工作流内置默认提示词。 workflow_path:工作流 JSON 路径,None 则用默认 add_hair.json。 + front:True 时任务插到 ComfyUI 队列最前(server 端 "front" 字段,队列号取负)。 + 接口2 对时延敏感用 True,避免排在接口3/5 的批量任务后面;其余接口保持 False。 """ path = workflow_path or _WORKFLOW_DEFAULT output_node = _get_output_node(path) @@ -125,8 +127,11 @@ def run(rgba_png_bytes: bytes, timeout: float = COMFY_TIMEOUT, prompt: str = Non except Exception: # noqa: BLE001 pass - # 3. 提交 - r = cli.post("/prompt", json={"prompt": wf, "client_id": client_id}) + # 3. 提交(front=True 时插队到队列最前) + payload = {"prompt": wf, "client_id": client_id} + if front: + payload["front"] = True + r = cli.post("/prompt", json=payload) r.raise_for_status() prompt_id = r.json()["prompt_id"] diff --git a/hairline/redraw.py b/hairline/redraw.py index a32f155..e367380 100644 --- a/hairline/redraw.py +++ b/hairline/redraw.py @@ -16,7 +16,7 @@ from . import comfyui logger = logging.getLogger("hair.worker") -_DEFAULT_PROMPT = "填充遮罩区域的头发,皮肤加一点磨皮" +_DEFAULT_PROMPT = "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜" _REPO = os.path.dirname(os.path.dirname(__file__)) _REPAINT_WORKFLOW = os.path.join(_REPO, "0716add-hair-api.json") @@ -55,14 +55,16 @@ def _process_mask_to_rgba(image_bytes: bytes, mask_bytes: bytes) -> bytes: def run_redraw(image_bytes: bytes, mask_bytes: bytes, - prompt: str | None = None, timeout: float = 300.0) -> bytes: + prompt: str | None = None, timeout: float = 300.0, + front: bool = False) -> bytes: """直接调 ComfyUI 重绘 — 替代 local_test /api/generate。 Args: image_bytes: 人物图片字节(JPG/PNG) mask_bytes: 遮罩图片字节(支持红/白/alpha 遮罩格式) - prompt: 提示词,None 用默认 "填充遮罩区域的头发,皮肤加一点磨皮" + prompt: 提示词,None 用默认 "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜" timeout: ComfyUI 超时秒数 + front: True 时任务插到 ComfyUI 队列最前(接口2 时延敏感路径用) Returns: 重绘后的 PNG 图片字节 @@ -73,4 +75,4 @@ def run_redraw(image_bytes: bytes, mask_bytes: bytes, """ rgba_png = _process_mask_to_rgba(image_bytes, mask_bytes) return comfyui.run(rgba_png, timeout=timeout, prompt=prompt, - workflow_path=_REPAINT_WORKFLOW) + workflow_path=_REPAINT_WORKFLOW, front=front) diff --git a/hairline/service.py b/hairline/service.py index 548f292..ed47300 100644 --- a/hairline/service.py +++ b/hairline/service.py @@ -47,7 +47,8 @@ def _call_local_redraw(image_png_bytes, mask_png_bytes, timeout=300.0): 失败抛异常(调用方负责 try/except 跳过)。 """ from .redraw import run_redraw - return run_redraw(image_png_bytes, mask_png_bytes, timeout=timeout) + # front=True:接口2 时延敏感,插到 ComfyUI 队列最前,避免排在接口3/5 的批量任务后面 + return run_redraw(image_png_bytes, mask_png_bytes, timeout=timeout, front=True) # 发际线贴图档位:middle=默认(hairline_texture/),high/low 各自独立文件夹。 _TEXTURE_DIRS = { @@ -192,7 +193,9 @@ def generate_grow_results(image_bgr: np.ndarray, gender: str, use_mask: bool = T h, w = image_bgr.shape[:2] buf = io.BytesIO() compose_comfy_rgba(image_bgr, np.zeros((h, w), np.uint8)).save(buf, format="PNG") - shared_grown = comfyui.run(buf.getvalue(), prompt=prompt, workflow_path=workflow_path) + # front=True:接口2 时延敏感,插到 ComfyUI 队列最前 + shared_grown = comfyui.run(buf.getvalue(), prompt=prompt, + workflow_path=workflow_path, front=True) except Exception as e: # noqa: BLE001 logger.warning("接口2 生发图失败(无遮罩):%s", e) @@ -212,7 +215,9 @@ def generate_grow_results(image_bgr: np.ndarray, gender: str, use_mask: bool = T image_bgr, ctx["landmarks"], ctx["parse_map"], ctx["points"], black) buf = io.BytesIO() compose_comfy_rgba(marked, mask).save(buf, format="PNG") - grown_png = comfyui.run(buf.getvalue(), prompt=prompt, workflow_path=workflow_path) + # front=True:接口2 时延敏感,插到 ComfyUI 队列最前 + grown_png = comfyui.run(buf.getvalue(), prompt=prompt, + workflow_path=workflow_path, front=True) except Exception as e: # noqa: BLE001 单张失败不拖垮整请求 logger.warning("接口2 生发图失败 type=%s:%s", key, e) diff --git a/local_test/app.py b/local_test/app.py index aec326e..f7f1079 100644 --- a/local_test/app.py +++ b/local_test/app.py @@ -206,7 +206,7 @@ def generate(): return jsonify({"error": msg}), 400 image_file = request.files["image"] mask_file = request.files["mask"] - prompt_text = request.form.get("prompt", "填充遮罩区域的头发,皮肤加一点磨皮") + prompt_text = request.form.get("prompt", "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜") log.info( "收到请求: image=%s mask=%s prompt=%r", image_file.filename, mask_file.filename, prompt_text, diff --git a/local_test/bench.py b/local_test/bench.py index 0526ec3..db82cf1 100644 --- a/local_test/bench.py +++ b/local_test/bench.py @@ -27,7 +27,7 @@ def prep_and_upload(): def run_once(fname, model, dtype, steps): - wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮") + wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜") wf["16"]["inputs"]["unet_name"] = model wf["16"]["inputs"]["weight_dtype"] = dtype wf["1"]["inputs"]["steps"] = steps diff --git a/local_test/bench2.py b/local_test/bench2.py index aa72174..379ae88 100644 --- a/local_test/bench2.py +++ b/local_test/bench2.py @@ -33,7 +33,7 @@ def upload(scale=1.0): def run(fname, steps): - wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮") + wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜") wf["16"]["inputs"]["unet_name"] = MODEL wf["16"]["inputs"]["weight_dtype"] = DTYPE wf["1"]["inputs"]["steps"] = steps diff --git a/local_test/bench_quality.py b/local_test/bench_quality.py index 953b0d9..70af6f7 100644 --- a/local_test/bench_quality.py +++ b/local_test/bench_quality.py @@ -30,7 +30,7 @@ SEED = 123456789 imgs = [] labels = [] for steps in [2, 3, 4, 6]: - wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮", seed=SEED) + wf = A.build_workflow(fname, "填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜", seed=SEED) wf["16"]["inputs"]["unet_name"] = MODEL wf["16"]["inputs"]["weight_dtype"] = DTYPE wf["1"]["inputs"]["steps"] = steps diff --git a/local_test/index.html b/local_test/index.html index 61c5504..51d0382 100644 --- a/local_test/index.html +++ b/local_test/index.html @@ -55,7 +55,7 @@ button { padding: 10px 24px; border: none; border-radius: 6px; cursor: pointer;