Generated reference · ComfyUI workflow · Avatar & identity

Face Swap Avatar Generator

Swap faces between a source face and target avatar body/scene

Avatar & identity13nodesGPU A5000out image~55sv1.0.0

On this page
13Graph nodes
11Node classes
11Inputs
3Models

Tags: face_swapidentitypersonalizationcompositeavatar

Inputs (11)#

The typed parameter surface callers bind when they request this workflow. Enum options and numeric bounds are the values the workflow document declares.

source_faceimagerequired
Source image containing the face to use
target_imageimagerequired
Target image containing the body/scene to receive the face
blend_strengthfloatdefault 0.85min 0.0max 1.0
How strongly to apply the face swap (0.0-1.0)
preserve_expressionbooleandefault false
Try to preserve target expression rather than source expression
match_lightingbooleandefault true
Match lighting between source and target
match_skin_tonebooleandefault true
Blend skin tones for better integration
enhancement_levelenumdefault moderate
Post-swap face enhancement level
options: nonesubtlemoderatestrong
upscale_outputbooleandefault false
Upscale the final output
output_formatenumdefault png
Output image format
options: pngjpgwebp
seedintegerdefault -1
Random seed (-1 for random)
checkpointenumdefault dreamshaper_8
SD1.5 checkpoint: DreamShaper 8 finetune (default, baked VAE) or base 1.5
options: dreamshaper_8sd15_base

ComfyUI node graph (13)#

The executable ComfyUI prompt graph: 13 nodes across 11 distinct node classes, wired by 17 data dependencies. Nodes tinted green come from a custom node pack this workflow declares; the rest are ComfyUI core / baked-community classes.

flowchart TD n0["1: LoadImage"] n1["2: LoadImage"] n2["3: ReActorFaceSwap"] n3["4: ColorMatch"] n4["5: CheckpointLoaderSimple"] n5["6: VAEEncode"] n6["7: CLIPTextEncode"] n7["8: CLIPTextEncode"] n8["9: KSampler"] n9["10: VAEDecode"] n10["11: UpscaleModelLoader"] n11["12: ImageUpscaleWithModel"] n12["13: SaveImage"] n0 -->|source_image| n2 n1 -->|target_image| n2 n2 -->|image| n3 n1 -->|reference| n3 n3 -->|pixels| n5 n4 -->|vae| n5 n4 -->|clip| n6 n4 -->|clip| n7 n4 -->|model| n8 n6 -->|positive| n8 n7 -->|negative| n8 n5 -->|latent_image| n8 n8 -->|samples| n9 n4 -->|vae| n9 n10 -->|upscale_model| n11 n9 -->|image| n11 n11 -->|images| n12 classDef custom fill:#12b886,stroke:#0b6b4f,color:#04110c; class n2,n3 custom;
Data-flow DAG — scroll to zoom, drag to pan.

Nodes (13)#

1LoadImagecore
image = {{source_face}} tmpl
outputs: IMAGEMASK
2LoadImagecore
image = {{target_image}} tmpl
outputs: IMAGEMASK
3ReActorFaceSwapcustom pack
source_image = ◂ node 1 · out[0]target_image = ◂ node 2 · out[0]swap_model = inswapper_128.onnxfacedetection = retinaface_resnet50face_restore_model = codeformer-v0.1.0.pthface_restore_visibility = {{blend_strength}} tmplcodeformer_weight = 0.5detect_gender_source = falsedetect_gender_target = falsesource_faces_index = 0target_faces_index = 0console_log_level = 1
outputs: IMAGE
4ColorMatchcustom pack
image = ◂ node 3 · out[0]reference = ◂ node 2 · out[0]blur = 8
outputs: IMAGE
5CheckpointLoaderSimplecore
ckpt_name = {{checkpoint_files[checkpoint]}} tmpl
outputs: MODELCLIPVAE
6VAEEncodecore
pixels = ◂ node 4 · out[0]vae = ◂ node 5 · out[2]
outputs: LATENT
7CLIPTextEncodecore
text = high quality portrait, detailed face, natural skin, professional photography, {{enhancement_prompts[enhancement_level]}} tmplclip = ◂ node 5 · out[1]
outputs: CONDITIONING
8CLIPTextEncodecore
text = ugly, deformed, blurry, artifacts, glitches, seams, mismatched skin, wrong proportionsclip = ◂ node 5 · out[1]
outputs: CONDITIONING
9KSamplercore
model = ◂ node 5 · out[0]positive = ◂ node 7 · out[0]negative = ◂ node 8 · out[0]latent_image = ◂ node 6 · out[0]seed = {{seed}} tmplsteps = 20cfg = 5.0sampler_name = eulerscheduler = normaldenoise = 0.25
outputs: LATENT
10VAEDecodecore
samples = ◂ node 9 · out[0]vae = ◂ node 5 · out[2]
outputs: IMAGE
11UpscaleModelLoadercore
model_name = RealESRGAN_x4plus.pth
outputs: UPSCALE_MODEL
12ImageUpscaleWithModelcore
upscale_model = ◂ node 11 · out[0]image = ◂ node 10 · out[0]
outputs: IMAGE
13SaveImagecore
images = ◂ node 12 · out[0]filename_prefix = face_swap

Parameter banks (2)#

The prompt / configuration lookup tables this workflow keys into from its inputs — the vocabulary that turns a style / palette / preset selection into graph parameters.

enhancement_prompts (4)#

none
subtle
slightly enhanced, minor refinements, subtle improvements
moderate
moderately enhanced, improved clarity, better detail, refined features
strong
strongly enhanced, significant improvement, very clear, highly refined

workflow_notes (3)#

ethics
This workflow should only be used with proper consent from individuals whose faces are being used. Never use for deepfakes, harassment, or any malicious purpose.
requirements
ReActor extension installedInsightFace models availableCodeFormer face restoration model
best_practices
Use high quality source images with clear face visibilitySource and target should have similar head angles for best resultsLighting match works best when scenes have similar lighting conditions

Models & dependencies#

Custom node packs (2)#

The non-core ComfyUI node classes this graph requires; the RunPod worker image the workflow runs on must bake or install a pack that provides every one of them.

ColorMatchReActorFaceSwap

Checkpoint aliases (2)#

dreamshaper_8
DreamShaper_8_pruned.safetensors
sd15_base
v1-5-pruned-emaonly.safetensors

Models required (3)#

DreamShaper_8_pruned.safetensors
RealESRGAN_x4plus.pth
v1-5-pruned-emaonly.safetensors

Output contract#

What a successful run of this workflow returns.

type
image
format
{{output_format}}
channels
4

Taxonomy & routing#

How the control plane classifies this workflow — from the committed workflow-taxonomy-registry.json. It drives the consistency / control surface the agentic director can exercise over the workflow.

assetFamily
social-avatar-banner-identity-pack
outputPackageProfile
image-single-profile
controlModalities
controlnet-inpaintcontrolnet-segmentationfaceididentity-lockipadapter-facemodel-lockprompt-template-locksampler-scheduler-lockseed-lockstyle-lock
consistencyDimensions
identitylightingcolor-script
notes
Auto-mapped from avatar defaults