logo
RunComfy
  • ComfyUI
  • TrainerNew
  • Models
  • API
  • Pricing
discord logo
ComfyUI>Workflows>Z Image Turbo Headswap for Characters | Fast Swap Tool

Z Image Turbo Headswap for Characters | Fast Swap Tool

Workflow Name: RunComfy/Z-Image-Turbo-Headswap
Workflow ID: 0000...1365
This workflow helps you create flawless head swaps for your character images in seconds. It maintains perfect lighting, natural expressions, and consistent style for photoreal results. You can efficiently customize portraits or convert existing images with precise head alignment. Built for ease of use, it streamlines image editing and reduces tedious manual adjustments. Ideal for designers and content creators seeking high-quality, stylistically coherent transformations.

Z Image Turbo Headswap for Characters: Fast, precise head replacement for character portraits

Z Image Turbo Headswap for Characters is a focused ComfyUI workflow for swapping a character’s head while preserving the original lighting, pose, and style. It guides Z-Image Turbo to edit only the head region, producing seamless, photoreal results that avoid the halos and plastic textures typical of generic swaps.

Built for creators, character artists, and portrait editors, this Z Image Turbo Headswap for Characters workflow uses automatic captioning for smart prompts, SAM‑style segmentation for robust face and hair masks, and an inpaint crop-and-stitch pass that keeps backgrounds untouched. Optional character LoRAs let you steer identity and styling with precision.

Key models in Comfyui Z Image Turbo Headswap for Characters workflow

  • Z-Image Turbo (bf16). The diffusion backbone that performs the actual inpainting and reconstruction, prized for speed and photoreal fidelity. Model card
  • Z-Image Turbo VAE. Paired VAE used for encoding and decoding latents in and out of Z-Image Turbo for crisp reconstructions. Included with the Z-Image Turbo release.
  • Qwen3‑4B Z‑Image Engineer V4 (GGUF). High‑quality text encoder for prompt conditioning; improves semantic steering of attributes like hair, expression, and accessories. Model card
  • Z‑Image AbliteratedV1 (GGUF). Alternative text encoder with a slightly different prompt “feel,” useful when you want a stronger push toward descriptive prompts. Model card
  • SAM‑style segmentation checkpoint (sam3.pt). Provides robust, promptable segmentation to isolate face and hair for targeted edits via the ComfyUI‑SAM3 extension. Repository
  • Optional character LoRA adapters. Lightweight adapters to reinforce identity or style within Z-Image Turbo; use them when you need a consistent character look across edits.

How to use Comfyui Z Image Turbo Headswap for Characters workflow

The workflow isolates the head with strong masks, crops for a high‑resolution inpaint, diffuses only inside that region, then stitches the result back into the original. A separate Test Lora group runs independently for quick LoRA/prompt trials.

Prepare the source and prompt

  • Load your base image in Source Image (#958). This is the portrait whose head you want to replace.
  • Auto Prompt (#1018) analyzes the image and generates a descriptive prompt. Add any critical notes in Text Multiline (#1071) such as hair color, head angle, or accessories you want to keep or change.
  • The workflow merges these into a single prompt with Text Concatenate (#1070) and encodes it using your chosen GGUF text encoder via CLIPLoaderGGUF (#164) and CLIPTextEncode (#944).
  • A curated CLIP Text Encode (Negative Prompt) (#1082) counterbalances unwanted traits, nudging Z Image Turbo Headswap for Characters toward clean, realistic outputs.

Build precise head masks

  • The resized image passes to two SAM‑style segmenters: Face Mask (#939) and Hair Mask (#1078). Using grounded textual hints, they isolate facial features and hair with high recall.
  • Masks Combine Regions (#1079) fuses these regions so the swap operates across face and hairlines together, reducing visible seams.
  • Dedicated previews (Preview Mask for Face (#954), Preview Mask for Hair (#1080), and the combined mask view) help you confirm the target area before any diffusion occurs.
  • This dual‑mask approach is central to Z Image Turbo Headswap for Characters, keeping skin, hair, and edge detail coherent.

Crop for inpainting and condition the model

  • InpaintCropImproved (#1024) crops to the masked region and ensures a minimum working resolution so the diffusion pass has enough pixels to model pores, strands, and edges.
  • InpaintModelConditioning (#943) prepares positive and negative conditioning tied to the cropped image and mask, plus latent inputs aligned with the selected VAE.
  • At this stage the workflow fully constrains the edit to the head region while letting the prompt and optional LoRAs define the new identity or attributes.

Head swap diffusion pass

  • The LoRA‑augmented Z‑Image Turbo model flows through DifferentialDiffusion (#949) so the edit concentrates inside the mask and preserves unmasked context.
  • Head Swap Sampler (#1022) performs the inpaint. For stronger changes, increase denoise; for better pose and lighting retention, keep it moderate. Higher CFG tightens adherence to the prompt and source but can over‑sharpen; lower CFG looks softer and can blend more naturally.
  • Because this is Z Image Turbo Headswap for Characters, the model respects your prompt wording and LoRA selection, letting you dial in identity, hairstyle, and expression without disturbing the scene.

Stitch and save

  • The inpainted patch is decoded with VAEDecode (#947) and seamlessly merged back using InpaintStitchImproved (#950), preserving original resolution and background integrity.
  • SaveImage (#1084) writes the final image. Use Image Comparer (rgthree) (#1092) to slide between before and after for quick QA and iteration.
  • This final stage completes the Z Image Turbo Headswap for Characters pipeline, yielding a cohesive portrait without telltale swap artifacts.

Test Lora (independent)

  • The Test Lora group lets you preview LoRA influence without touching your source. Load adapters in Character Lora (#1083 and #1057), provide a short positive prompt with CLIPTextEncode (#1088), and a matching negative with CLIPTextEncode (#1087).
  • The auxiliary Head Swap Sampler (#1091) generates quick portraits into VAEDecode (#1089) so you can judge identity lock and styling before running the main swap.
  • When you like the look, reuse the same LoRA weights and wording in the main flow for a predictable Z Image Turbo Headswap for Characters result.

Key nodes in Comfyui Z Image Turbo Headswap for Characters workflow

Face Mask (#939)

Generates a precise face region using SAM‑style grounding so the model knows exactly where to replace features. Adjusting the textual hint strengthens detection of the correct facial area, which directly improves blending at cheeks, jawline, and ears.

Hair Mask (#1078)

Targets the hair region to capture fringes, flyaways, and hairlines that typically betray swaps. Including hair with the face mask greatly reduces seam visibility and prevents mismatched shading around the forehead and temples.

Masks Combine Regions (#1079)

Fuses face and hair masks into one edit region. This combined mask ensures consistent texture and lighting where skin meets hair, avoiding the “cutout” look during inpainting.

InpaintCropImproved (#1024)

Crops around the combined mask and upscales the working area so the sampler has adequate pixel density. Use context expansion when needed to include hats, bangs, or accessories that interact with the head region.

InpaintModelConditioning (#943)

Builds positive/negative conditioning tied to the cropped patch and mask. This ensures the sampler reads both your descriptive prompt and the local image context, aligning identity changes with scene lighting and camera angle.

DifferentialDiffusion (#949)

Focuses changes within the masked area while protecting unmasked content. It is especially helpful when the backdrop is detailed or when small lighting shifts outside the head would be noticeable.

Head Swap Sampler (#1022)

Runs the inpaint diffusion. Two controls matter most: denoise strength and CFG guidance. Higher denoise increases transformation but can drift from the original pose; higher CFG enforces the prompt and LoRA at the risk of a harsher, more stylized finish. Tune both together for natural swaps.

InpaintStitchImproved (#950)

Re‑integrates the edited crop at full resolution using the stitcher from the crop stage. This maintains global sharpness and color continuity across boundaries for a seamless final portrait.

Optional extras

  • Prefer front or three‑quarter angles when possible; match the target description or LoRA to the source angle for the cleanest Z Image Turbo Headswap for Characters results.
  • If the fringe or hat blends poorly, expand the combined mask slightly before the inpaint pass.
  • Keep denoise moderate on first runs, then inch up only as needed to reach the new identity.
  • Use the Auto Prompt baseline and add just a few decisive tokens (hair color, expression, accessories) rather than long lists.
  • The ComfyUI‑SAM3 and Crop‑and‑Stitch extensions are powerful; updating to their latest releases can improve mask quality and stitching in complex scenes. ComfyUI‑SAM3 • ComfyUI‑Inpaint‑CropAndStitch

Acknowledgements

This workflow implements and builds upon the following works and resources. We gratefully acknowledge @RetroGazzaSpurs and r/StableDiffusion for Z Image Turbo Headswap for Characters Workflow Source for their contributions and maintenance. For authoritative details, please refer to the original documentation and repositories linked below.

Resources

  • r/StableDiffusion/Z Image Turbo Headswap for Characters Workflow Source
    • Docs / Release Notes: Z Image Turbo Headswap for Characters Workflow Source

Note: Use of the referenced models, datasets, and code is subject to the respective licenses and terms provided by their authors and maintainers.

Want More ComfyUI Workflows?

Consistent Character Creator

Create consistent, high-resolution character designs from multiple angles with full control over emotions, lighting, and environments.

Flux Consistent Characters | Input Image

Flux Consistent Characters | Input Image

Create consistent characters and ensure they look uniform using your images.

ReActor | Fast Face Swap

With ComfyUI ReActor, you can easily swap the faces of one or more characters in images or videos.

ReActor | Fast Face Swap

Professional face swapping toolkit for ComfyUI that enables natural face replacement and enhancement.

Flux PuLID for Face Swapping

Flux PuLID for Face Swapping

Take your face swapping projects to new heights with Flux PuLID.

Wan 2.2 Animate | Character Swap & Lip-Sync

Transforms any face to speak and move like the original with ease.

MultiTalk | Photo to Talking Video

Millisecond lip sync + Wan2.1 = 15s ultra-detailed talking videos!

FLUX LoRA Training

FLUX LoRA Training

Guide you through the entire process of training FLUX LoRA models using your custom datasets.

Follow us
  • LinkedIn
  • Facebook
  • Instagram
  • Twitter
Support
  • Discord
  • Email
  • System Status
  • Affiliate
Resources
  • Free ComfyUI Online
  • ComfyUI Guides
  • RunComfy API
  • ComfyUI Tutorials
  • ComfyUI Nodes
  • Learn More
Legal
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
RunComfy
Copyright 2026 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.