A Green-Screen Keying and Compositing Workflow
Green-screen keying — removing a solid-color background to composite a subject onto a generated or sourced environment — has traditionally required professional video editing software and significant technical skill. An AI keying workflow in Floniks automates the chroma removal, edge refinement, background generation, and final compositing in a single pipeline. This guide walks through building the complete workflow: preprocessing the source footage, configuring the keying node for clean edges, generating matched replacement backgrounds, compositing with correct lighting integration, and exporting the finished composite for broadcast or social delivery.
How AI Changes the Green-Screen Keying Process
Traditional chroma keying in professional video software requires the editor to manually set color tolerance ranges, feather edge boundaries, deal with green spill (the green cast from the background reflecting onto the subject), handle hair and fine detail separately, and work through every problematic frame individually. For a 60-second clip with complex subject motion, this process can take several hours even for an experienced editor. Minor issues in the original shoot — inconsistent green lighting, shadows on the screen, subject wearing colors adjacent to the key color — compound the difficulty.
AI-driven keying approaches the problem differently. Rather than selecting a color range and trying to cleanly separate it from everything else, the AI model uses semantic understanding of the scene to identify what constitutes the foreground subject (typically a person or object) and what constitutes the background, independent of color. This means it handles green spill, semi-transparent hair, and motion blur at edges substantially better than color tolerance-based keying — because it is not actually looking at the color range, it is understanding the scene content.
Building this AI keying capability as a Floniks workflow rather than using it as a standalone one-shot tool gives you the additional benefit of integration: the keying output flows directly into background generation, compositing, lighting adjustment, and export without any manual file handling between steps. A shoot that requires 10 different background environments for 10 variants of a product demo video generates all 10 composites in a single workflow run rather than 10 separate editing sessions.
Preprocessing Source Footage for Clean Keying
Clean keying starts with clean source footage. Before the AI Keying node receives the video, route it through a Source Prep node that addresses the most common shooting problems. First, run a Denoise pass to reduce digital noise in the green background region — noise in the background creates noisy key edges because the AI model sees slightly different color values in adjacent pixels and edges the key mask accordingly. Set denoise strength to 0.3; higher values can soften the subject's face or fine detail.
Second, run a Green Spill Correction pass. Green spill is the green cast reflected from the bright green screen onto the near edges of the subject — hair edges, shoulder edges, any surface close to the screen. Spill correction desaturates green from pixels in the foreground edge region. In Floniks, configure the Spill Correction node to target the green channel (or blue if using a blue screen) and apply suppression at 0.6 strength in the edge transition zone. Too aggressive suppression desaturates the entire foreground; the targeted edge-zone approach preserves natural skin tone and fabric color while removing the unnatural green cast.
Third, check the frame rate of the source footage and note any motion blur present. Fast subject motion creates motion-blurred frame edges that are the most challenging region for any keying system. The AI keying model handles motion blur better than traditional color tolerance keying, but if the source footage was shot at a very slow shutter speed producing very heavy motion blur, the edge quality in those frames will be lower than in sharp frames. Note this in the workflow configuration for the QC step later.
Configuring the AI Keying Node for Edge Quality
After preprocessing, connect the source footage to the AI Keying node. This node produces a binary alpha mask — white for foreground (subject to keep), black for background (region to replace), and grayscale values for semi-transparent transitions. The quality of the edge is controlled by three parameters: detection sensitivity, edge feather radius, and hair detail mode.
Detection sensitivity controls how aggressively the model separates foreground from background. At high sensitivity (0.9), the model is decisive in its separation but may clip some fine hair strands or semi-transparent fabric. At medium sensitivity (0.7), the model is more conservative and preserves fine edge detail at the cost of occasionally leaving some background color visible near the edges. Start at 0.75 for most footage and adjust based on the review.
Edge feather radius controls the softness of the alpha mask edge. A hard edge (radius 0) looks artificial against any replacement background. A feather radius of 3–5 pixels at 1080p is standard for realistic compositing. For subjects with very fine hair or fly-away strands, increase the feather radius to 7–8 pixels and enable Hair Detail Mode. Hair Detail Mode switches the model to a higher-resolution edge analysis pass specifically for regions detected as hair, producing significantly better alpha coverage in fine strands at the cost of somewhat longer processing time. For commercial work where subject hair is visible, Hair Detail Mode is worth enabling for every job.
Generating Lighting-Matched Replacement Backgrounds
The most common reason a composite looks unconvincing is not the keying quality — it is the lighting mismatch between the subject and the replacement background. If the subject was lit from the left with a warm key light and the replacement background shows a scene lit from the right with a cool overhead, the composite will read as obviously false even if the key edge is pixel-perfect. Generating replacement backgrounds that match the subject lighting is the primary quality lever in compositing work.
In Floniks, connect the source footage to a Lighting Analysis node before the background generation step. This node analyzes the subject illumination: detecting key light direction, estimating color temperature, measuring shadow position, and identifying any practical light sources visible in the source. It outputs these parameters as metadata: "key light: upper left, color temperature: 5600K daylight, shadow direction: lower right, ambient fill ratio: 0.4."
Pass this lighting metadata to the Background Generation node alongside the scene description prompt. Structure the prompt to encode the lighting analysis: "modern open-plan office interior, natural daylight from large windows on the left, warm afternoon sunlight, shadows falling to the right, clean contemporary design, shallow depth of field, editorial photography aesthetic." The lighting direction, color temperature, and shadow placement in the prompt match the analysis from the source footage, producing a generated background that integrates naturally with the keyed subject. This analysis-driven background generation is what separates professional-grade compositing from obvious greenscreen replacement.
Compositing, Color Integration, and Final Export
With the cleaned key and the lighting-matched background, compositing is the final assembly step. In Floniks, connect the alpha mask output from the Keying node, the source footage, and the generated background to a Composite node. This node layers the keyed foreground over the background using the alpha mask and applies an Edge Integration pass that blends the fine edge zone to prevent any visible halo or hard boundary between subject and background.
After the geometric composite, add a Color Grade node that unifies the color response of the foreground and background. Even with careful lighting-matched background generation, the camera's color response to the original green-screen lighting differs subtly from the color characteristics of the AI-generated scene. A Light Unification grade — reducing the saturation differential between the two layers, matching the shadow warmth, and bringing the midtone contrast into alignment — is the detail that makes professional compositors note that something looks right even when they cannot immediately identify why.
For video delivery, connect the composited output to a Video Export node at the required delivery specification: ProRes 422 HQ for broadcast and post-production delivery, H.264 MP4 at 16 Mbps for online distribution, and H.265 at 8 Mbps for streaming platform delivery. For composite outputs that will be used as source footage in a further editing session, export with an alpha channel (ProRes 4444) rather than over a background — this preserves the keying work for any future background change without requiring a re-key. Save the complete workflow from source preprocessing through composite and export as a reusable template that can be applied to any new green-screen shoot.
Batch Compositing Multiple Background Variants
One of the most powerful applications of the Floniks keying workflow is batch compositing — taking a single keyed foreground clip and compositing it over multiple generated backgrounds in a single run. This is valuable for product demos that need to be localized for different markets (office environment for corporate, home setting for consumer, outdoor setting for lifestyle), for A/B testing which background environment drives higher conversion in paid ads, and for producing multiple regional versions of the same spokesperson video.
To configure batch compositing, connect the keyed foreground output to a Batch Background node. This node accepts a list of background generation prompts — one per desired variant — and generates each background independently while passing the same keyed foreground through the composite node for each. The Lighting Analysis output feeds all background generation branches, ensuring every variant background matches the subject lighting regardless of the scene content.
Connect all composite outputs to a Batch Export node that names each variant with a structured convention including the scene descriptor and the variant index. For 8 background variants of a 60-second spokesperson clip, the batch run produces 8 fully composited deliverable video files in a single pipeline execution. This compresses what would be 8 individual compositing sessions into one automated batch, and because all 8 use the same key and the same lighting analysis, the composite quality is consistent across all variants without any session-to-session variation.
Step by step
- 1
Import the green-screen footage into a Source Prep node
Navigate to /editor and add a Source Prep node. Import the source footage and configure a Denoise pass at strength 0.3 followed by a Green Spill Correction pass at strength 0.6 targeting the edge transition zone. Preview the preprocessed output at 1080p to confirm that background noise is reduced and any green cast on the subject edges is corrected before proceeding.
- 2
Connect a Lighting Analysis node to extract subject illumination parameters
Add a Lighting Analysis node receiving the source footage. This node outputs key light direction, color temperature, shadow direction, and ambient fill ratio as metadata. Review the analysis output panel to confirm the detected lighting matches what you observed during the shoot. These parameters will be used to generate the replacement background with matching illumination.
- 3
Configure the AI Keying node with edge feather and Hair Detail Mode
Connect the preprocessed footage to an AI Keying node. Set detection sensitivity to 0.75. Set edge feather radius to 4 to 5 pixels at 1080p. Enable Hair Detail Mode if the subject has visible hair or fine edge strands. Review the alpha mask output carefully at 200% zoom on a few representative frames including any fast-motion frames before proceeding.
- 4
Generate a lighting-matched replacement background
Add a Background Generation node. Write the scene description prompt incorporating the Lighting Analysis metadata: key light direction, color temperature, and shadow position from the analysis output. Confirm that the generated background scene illumination matches the subject lighting direction before connecting to the Composite node.
- 5
Composite the keyed foreground over the background and apply color integration
Connect the alpha mask, the source foreground, and the generated background to a Composite node. Enable the Edge Integration pass at default settings. Connect a Color Grade node after the composite and apply a Light Unification grade that matches shadow warmth, midtone contrast, and saturation balance between the foreground and background layers.
- 6
Export in required delivery formats and save the workflow template
Connect the composited output to a Video Export node. Configure presets for ProRes 422 HQ for broadcast, H.264 MP4 at 16 Mbps for online, and ProRes 4444 with alpha if further compositing is anticipated. For batch background variants, connect the Composite node to a Batch Export node with structured naming. Save the complete workflow as a template for future green-screen shoots.
FAQ
Why does my composite look fake even though the key edge looks clean?+
The most common cause of a convincing key edge but an unconvincing composite is lighting mismatch between the subject and the replacement background. If the subject was lit from the left and the background scene shows light coming from the right, the composite reads as false even with a pixel-perfect edge. Use the Lighting Analysis node to extract the subject illumination parameters and incorporate them explicitly into the background generation prompt. Also check that the shadow warmth and color temperature of the background match the subject using the Color Grade Light Unification pass after compositing.
How do I handle hair and fine edge strands in the key?+
Enable Hair Detail Mode in the AI Keying node. This switches to a higher-resolution edge analysis pass specifically in regions detected as hair, producing significantly better alpha mask coverage in fine strands. Set edge feather radius to 6 to 8 pixels in the hair region rather than the 3 to 5 pixels appropriate for solid-edge regions. Also ensure the Spill Correction pass has been applied before keying, as green spill in hair edges causes the model to partially exclude hair strands that are contaminated with background color from the alpha mask.
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