A Face-Swap and Identity-Lock Workflow
Face swapping in AI video and image work is only useful when the replacement face stays consistent across every generated frame and asset. This guide explains how to build a Floniks workflow that ingests a reference portrait, extracts a stable identity embedding, and routes that embedding as a locked input into every downstream generation node — ensuring the subject's face doesn't drift between shots, scenes, or output formats. You'll learn which nodes to chain, how to pass reference images without re-uploading them each time, and how to verify identity fidelity before the pipeline exits.
Why Identity Drift Is the Core Problem
When you run multiple generation steps without locking a face reference, the AI model treats each node as a stateless request. The face it produces in shot one may share broad features with shot two, but the exact bone structure, skin tone, and eye spacing will subtly shift. Over a sequence of five or more shots this drift accumulates into a character that looks like several different people. The result destroys continuity for any content that needs a recognizable protagonist — ads, short drama, educational explainers, or social media series. Identity lock is not just a cosmetic concern; it is the difference between a usable pipeline and one that requires manual correction after every run.
Architecture of the Identity-Lock Workflow
The workflow follows a three-stage topology. Stage one is the identity extraction node, which receives a single high-quality portrait image and outputs a stable reference artifact — either a face embedding, a processed reference image, or a ControlNet conditioning map depending on the model family you are targeting. Stage two is a fanout: the reference artifact is wired as a shared upstream input to every generation node in the graph. Because Floniks nodes can accept multiple inputs and the editor draws explicit dependency edges, the reference is guaranteed to arrive before any downstream node executes. Stage three is a validation node that runs a similarity score between the reference portrait and each generated output, flagging any frame whose score falls below a configurable threshold. Frames that fail validation are routed to a retry branch rather than passed to the final output collector.
This three-stage structure keeps the reference management logic in a single upstream node. If you swap the reference portrait — for example, to generate a variant campaign with a different talent — you update only the first node's input and re-run the entire pipeline without touching downstream configuration.
Configuring the Reference Node in Floniks
In the Floniks workflow editor at /editor, add an Image Input node and connect it to a Face Reference Processor node. The processor node accepts parameters including face crop padding (how much background to retain around the detected face), detection confidence threshold (discard low-confidence detections before they pollute the embedding), and output format (embedding vector, masked crop, or full-resolution crop). Set the output format based on what your downstream generation model accepts — face-conditioned image models typically accept a cropped reference image, while avatar and video models may require an embedding vector.
Wire the processor's output port to the reference image input port on every generation node in the canvas. In the editor, you can hold Shift and click multiple destination ports to draw batch connections from a single source output. Once wired, those edges appear as a distinct color in the canvas, making it visually obvious which nodes are identity-locked and which are free-form. Save this wiring as a reusable template so future campaigns only need a new portrait to launch a full locked sequence.
Handling Edge Cases: Occlusion, Angles, and Makeup
Identity lock works well when the reference portrait is a clean, front-facing shot with neutral lighting. It degrades when the generated shot requires a steep three-quarter angle, heavy character makeup, or significant occlusion by props or clothing. To handle these cases, build a secondary reference input node that holds an alternate portrait shot at the target angle. Use a conditional branch node — available in the Floniks editor — to detect whether the generation prompt contains angle keywords like "profile", "rear", or "dutch angle", and if so, route the angled reference into the generation node instead of the primary front-facing portrait. This branch-based reference swapping keeps identity fidelity high without requiring a separate template for each camera angle.
For makeup and costume variants, the recommended approach is to retain the underlying face structure reference but reduce its influence weight, allowing the model more latitude to render cosmetic changes while still preserving bone structure and eye spacing. Most face-conditioning models expose a reference strength or influence parameter; values between 0.6 and 0.8 typically balance identity stability with costume flexibility.
Validation and Quality Gate Before Output
Before the workflow routes outputs to storage or downstream editing steps, insert a Face Similarity Scorer node. This node compares each generated frame against the original reference portrait using a lightweight embedding comparison and returns a scalar similarity score between 0 and 1. Configure the node's pass threshold — 0.75 is a reasonable starting point for most use cases — and connect the pass port to the output collector and the fail port to a retry or discard branch. In the retry branch, you can add a prompt augmentation node that appends identity-reinforcing language before sending the frame back for regeneration. Cap retries at two or three to avoid infinite loops, and route persistent failures to a human review queue or a flagged output folder so they are not silently discarded.
Log the similarity scores in the workflow task record so you can analyze which prompt patterns or camera angles produce the lowest fidelity and tune your prompts accordingly over time.
Reusing the Template Across Campaigns
Once the face-swap and identity-lock workflow is validated, save it as a named template in Floniks. The template captures the full node graph, all parameter defaults, and all wiring. When a new campaign starts, open the template, replace the portrait in the Image Input node, update the generation prompts, and run. Because the identity lock logic is embedded in the graph structure rather than in prompt text, new team members do not need to remember to include reference images manually — the workflow enforces it structurally. This is the principal advantage of the node-based editor over single-prompt approaches: constraints become architectural rather than procedural.
Step by step
- 1
Upload the reference portrait
In /editor, add an Image Input node. Upload a clean, front-facing portrait with good lighting. Set the node label to "Identity Reference" for clarity in the canvas.
- 2
Add and configure the Face Reference Processor node
Connect the Image Input node to a Face Reference Processor node. Set face crop padding to 20 px, detection confidence to 0.85, and output format to match your downstream model's expected input type.
- 3
Wire the reference output to every generation node
Hold Shift in the editor and click the reference image input port on each generation node in turn, then drag from the processor's output port to create batch connections. Verify the colored edges appear on all generation nodes.
- 4
Add a conditional branch for angle variants
Insert a Conditional Branch node downstream of the prompt input. Define the condition as: prompt contains "profile" OR "rear" OR "dutch angle". Wire the true branch to an alternate angled reference node; wire the false branch to the primary front-facing reference.
- 5
Insert the Face Similarity Scorer node
Place a Face Similarity Scorer node between the generation nodes and the output collector. Set the pass threshold to 0.75. Wire the fail port to a retry branch capped at two retries, and the persistent-fail port to a flagged output folder.
- 6
Save as a reusable template
Click Save as Template in the editor toolbar. Name the template "Identity-Lock Sequence". Future campaigns only need a new portrait in the Image Input node to run the full locked pipeline.
FAQ
Does the face-swap workflow work with video output as well as images?+
Yes. The identity lock architecture is model-agnostic. Wire the same Face Reference Processor output to video generation nodes exactly as you would image nodes. Some video models accept the reference as a first-frame conditioning image; others accept an embedding vector. Check the model's accepted input ports in the Floniks node configuration panel and set the processor output format accordingly.
What similarity score threshold should I use for high-stakes commercial content?+
For commercial advertising content where brand talent recognition is critical, set the threshold between 0.80 and 0.85. For social media content where some variation is acceptable, 0.70 to 0.75 is sufficient. Always validate the threshold against a sample of approved outputs before locking it into your production template, as different model families produce different baseline score distributions.
Can I lock multiple different faces in the same workflow for a multi-character scene?+
Yes. Add a separate Image Input and Face Reference Processor node for each character. Each generation node that contains a specific character should be wired to that character's processor output, not to a shared single reference. Use clear node labels and color coding in the editor canvas to keep the wiring readable as the graph grows.
Related guides
Build it on Floniks
Image, video, digital humans, and reusable workflows on one canvas. Sign up gets you starter credits — no card required.
Explore Floniks