The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
{
"1": {
"inputs": {
"unet_name": "qwen_image_2.1_int8_convrot.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "Load Diffusion Model"
}
},
"2": {
"inputs": {
"clip_name": "qwen3vl_8b_int8_convrot.safetensors",
"type": "qwen_image",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "Load CLIP (Qwen3-VL 8B)"
}
},
"3": {
"inputs": {
"vae_name": "qwen_image_2.1_vae_bf16.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE"
}
},
"4": {
"inputs": {
"lora_name": "bfs_head_v1.1_qwen_2.1.safetensors",
"strength_model": 1,
"model": [
"1",
0
]
},
"class_type": "LoraLoaderModelOnly",
"_meta": {
"title": "BFS head swap LoRA V1.1"
}
},
"10": {
"inputs": {
"image": "image_1.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "Load Image (the shot to keep)"
}
},
"11": {
"inputs": {
"image": "image_2.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "Load Image (the head)"
}
},
"20": {
"inputs": {
"upscale_method": "lanczos",
"largest_size": 2048,
"image": [
"10",
0
]
},
"class_type": "ImageScaleToMaxDimension",
"_meta": {
"title": "Scale image 1 to 2048"
}
},
"21": {
"inputs": {
"upscale_method": "lanczos",
"largest_size": 2048,
"image": [
"11",
0
]
},
"class_type": "ImageScaleToMaxDimension",
"_meta": {
"title": "Scale image 2 to 2048"
}
},
"30": {
"inputs": {
"prompt": "head_swap: start with <image1> as the base image, keeping its lighting, environment, and background. remove the head from <image1> completely and replace it with the head from <image2>, strictly preserving the hair, eye color, nose structure from <image2>. copy the direction of the eye, head rotation, micro expressions from <image1>, high quality, sharp details, 4k",
"negative_prompt": "",
"resolution": 0,
"clip": [
"2",
0
],
"vae": [
"3",
0
],
"images.image_1": [
"20",
0
],
"images.image_2": [
"21",
0
]
},
"class_type": "TextEncodeQwenImage21",
"_meta": {
"title": "Text Encode Qwen Image 2.1 (body first, head second)"
}
},
"31": {
"inputs": {
"device": "auto",
"dtype": "default",
"model": [
"4",
0
]
},
"class_type": "QwenImage21Cache",
"_meta": {
"title": "Qwen Image 2.1 Cache"
}
},
"32": {
"inputs": {
"seed": 0,
"steps": 25,
"cfg": 1,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"31",
0
],
"positive": [
"30",
0
],
"negative": [
"30",
1
],
"latent_image": [
"30",
2
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"33": {
"inputs": {
"samples": [
"32",
0
],
"vae": [
"3",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"34": {
"inputs": {
"image": [
"33",
0
]
},
"class_type": "SplitImageWithAlpha",
"_meta": {
"title": "Drop the alpha (the swap)"
}
},
"40": {
"inputs": {
"image": [
"34",
0
]
},
"class_type": "GetImageSize",
"_meta": {
"title": "Size of the swap"
}
},
"41": {
"inputs": {
"upscale_method": "lanczos",
"width": [
"40",
0
],
"height": [
"40",
1
],
"crop": "disabled",
"image": [
"20",
0
]
},
"class_type": "ImageScale",
"_meta": {
"title": "The shot at the swap's size"
}
},
"42": {
"inputs": {
"ckpt_name": "sam3.1_multiplex_fp16.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load SAM 3.1"
}
},
"43": {
"inputs": {
"text": "head",
"clip": [
"42",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "What to keep from the swap"
}
},
"44": {
"inputs": {
"threshold": 0.4,
"refine_iterations": 2,
"individual_masks": false,
"model": [
"42",
0
],
"image": [
"34",
0
],
"conditioning": [
"43",
0
]
},
"class_type": "SAM3_Detect",
"_meta": {
"title": "New head and hair"
}
},
"45": {
"inputs": {
"threshold": 0.4,
"refine_iterations": 2,
"individual_masks": false,
"model": [
"42",
0
],
"image": [
"41",
0
],
"conditioning": [
"43",
0
]
},
"class_type": "SAM3_Detect",
"_meta": {
"title": "Old head and hair"
}
},
"46": {
"inputs": {
"mask": [
"44",
0
]
},
"class_type": "MaskToImage",
"_meta": {
"title": "New head as an image"
}
},
"47": {
"inputs": {
"mask": [
"45",
0
]
},
"class_type": "MaskToImage",
"_meta": {
"title": "Old head as an image"
}
},
"48": {
"inputs": {
"x": 0,
"y": 0,
"resize_source": false,
"destination": [
"47",
0
],
"source": [
"46",
0
],
"mask": [
"44",
0
]
},
"class_type": "ImageCompositeMasked",
"_meta": {
"title": "Both heads (union)"
}
},
"49": {
"inputs": {
"channel": "red",
"image": [
"48",
0
]
},
"class_type": "ImageToMask",
"_meta": {
"title": "Union as a mask"
}
},
"50": {
"inputs": {
"expand": 32,
"incremental_expandrate": 0,
"tapered_corners": true,
"flip_input": false,
"blur_radius": 16,
"lerp_alpha": 1,
"decay_factor": 1,
"fill_holes": false,
"mask": [
"49",
0
]
},
"class_type": "GrowMaskWithBlur",
"_meta": {
"title": "Soft paste edge"
}
},
"51": {
"inputs": {
"x": 0,
"y": 0,
"resize_source": false,
"destination": [
"41",
0
],
"source": [
"34",
0
],
"mask": [
"50",
0
]
},
"class_type": "ImageCompositeMasked",
"_meta": {
"title": "New head on the untouched shot"
}
},
"52": {
"inputs": {
"switch": true,
"on_true": [
"51",
0
],
"on_false": [
"34",
0
]
},
"class_type": "ComfySwitchNode",
"_meta": {
"title": "Paste back (off: the whole swap)"
}
},
"90": {
"inputs": {
"filename_prefix": "fuobe/head-swap-qwen-image-21",
"images": [
"52",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}