ComfyUI / workflows /api /faceswapnew-klein-base.json
aleph65's picture
Add faceswapnew-* head-swap experiment workflows (klein quickwins/nolora/base/res2s/cropstitch, qwen2511 bfsv5/lightning8) + research notes
690ad30 verified
Raw
History Blame Contribute Delete
6.29 kB
{
"1": {
"class_type": "LoadImage",
"inputs": {
"image": "body.jpg"
}
},
"10": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "flux2/klein/bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors",
"model": [
"9",
0
],
"strength_model": 1.0
}
},
"11": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "lissie_flux2_klein.safetensors",
"model": [
"10",
0
],
"strength_model": 0.6
}
},
"12": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"8",
0
],
"text": [
"32",
0
]
}
},
"13": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"8",
0
],
"text": "bad quality, noise, blurry, worst quality, low resolution, blur, distortion, unnatural blending, cartoon, illustration, painting"
}
},
"14": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
}
},
"15": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"4",
0
],
"vae": [
"14",
0
]
}
},
"16": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"5",
0
],
"vae": [
"14",
0
]
}
},
"17": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"12",
0
],
"latent": [
"15",
0
]
}
},
"18": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"17",
0
],
"latent": [
"16",
0
]
}
},
"19": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"13",
0
],
"latent": [
"15",
0
]
}
},
"2": {
"class_type": "LoadImage",
"inputs": {
"image": "face.jpg"
}
},
"20": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"19",
0
],
"latent": [
"16",
0
]
}
},
"21": {
"class_type": "CFGGuider",
"inputs": {
"cfg": 4.5,
"model": [
"11",
0
],
"negative": [
"20",
0
],
"positive": [
"18",
0
]
}
},
"22": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
}
},
"23": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"6",
1
],
"steps": 20,
"width": [
"6",
0
]
}
},
"24": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 42
}
},
"25": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"21",
0
],
"latent_image": [
"7",
0
],
"noise": [
"24",
0
],
"sampler": [
"22",
0
],
"sigmas": [
"23",
0
]
}
},
"26": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"25",
0
],
"vae": [
"14",
0
]
}
},
"27": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "faceswapnew-klein-base",
"images": [
"26",
0
]
}
},
"3": {
"class_type": "RMBG",
"inputs": {
"background": "Alpha",
"image": [
"2",
0
],
"invert_output": false,
"mask_blur": 0,
"mask_offset": 0,
"model": "RMBG-2.0",
"process_res": 1024,
"refine_foreground": false,
"sensitivity": 1
}
},
"30": {
"class_type": "ImageResizeKJv2",
"inputs": {
"crop_position": "center",
"device": "cpu",
"divisible_by": 2,
"height": 512,
"image": [
"1",
0
],
"keep_proportion": "resize",
"pad_color": "0, 0, 0",
"upscale_method": "lanczos",
"width": 512
}
},
"31": {
"class_type": "AILab_QwenVL",
"inputs": {
"attention_mode": "sdpa",
"custom_prompt": "Describe the facial expression.",
"image": [
"30",
0
],
"keep_model_loaded": false,
"max_tokens": 512,
"model_name": "Qwen3-VL-4B-Instruct",
"preset_prompt": "\ud83d\uddbc\ufe0f Tags",
"quantization": "None (FP16)",
"seed": 42
}
},
"32": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": "\n\n",
"string_a": "head_swap: start with Picture 1 as the base image, keeping its lighting, environment, and background. remove the head from Picture 1 completely and replace it with the head from Picture 2, strictly preserving the hair, eye color, nose structure of Picture 2. copy the direction of the eye, head rotation, micro expressions from Picture 1, high quality, sharp details, 4k.",
"string_b": [
"31",
0
]
}
},
"4": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"1",
0
],
"resize_type": "scale total pixels",
"resize_type.megapixels": 1.0,
"scale_method": "lanczos"
}
},
"5": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"3",
0
],
"resize_type": "scale total pixels",
"resize_type.megapixels": 1.0,
"scale_method": "lanczos"
}
},
"6": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"4",
0
]
}
},
"7": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"6",
1
],
"width": [
"6",
0
]
}
},
"8": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_3_8b.safetensors",
"device": "default",
"type": "flux2"
}
},
"9": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux-2-klein-base-9b.safetensors",
"weight_dtype": "default"
}
}
}