Inpainting and Outpainting
This guide covers the Inpainting and Outpainting workflows: sample ComfyUI workflows from LTX that fill or extend regions of an existing video using IC-LoRA conditioning. Outpainting generates new content beyond the original frame boundaries (making a video wider or taller); inpainting fills masked regions within the frame (removing or replacing objects). Both use the same In-Outpainting IC-LoRA with different mask configurations, and both run a two-stage pipeline that blends generated content seamlessly with the original.
Prerequisites
This guide assumes you’re familiar with ComfyUI basics and IC-LoRA workflows. If you’re new to IC-LoRAs, start with the IC-LoRA Guide.
Model Files
Download the LTX-2.5 weights from the LTX-2.5 HuggingFace repository (click Agree and Access on first download). The In-Outpainting IC-LoRA and the spatial upscaler are reused from LTX-2.3.
The same IC-LoRA checkpoint is used for both inpainting and outpainting — the difference is how the mask is configured. LTX-2.5 ships them as two separate workflow files.
How It Works
Each workflow loads a source video, defines a mask for the region to generate, and runs a two-stage pipeline. Each stage does mask-aware preprocessing and blends the generated result back into the original:
- Preprocess (Stage 1) — Masks the frames (
LTXVInpaintPreprocess), builds the empty audio-video latent at the reference video’s size and length, optionally conditions on a start image, injects the IC-LoRA guide, and adds frozen audio (VAEEncodeAudio→SetAudioRefTokens) so the result stays consistent with the source’s sound. - Generate — Low Res (8 steps) — Generates at the base resolution with the IC-LoRA conditioning; a Laplacian pyramid blend merges the output with the original content.
- Preprocess — Stage 2 — VAE-encodes the blended Stage-1 result, re-conditions on the high-res start image, and re-attaches the frozen audio.
- Generate — High Res (2 steps) — Refines the upscaled video, again blending to keep clean mask boundaries.
Frozen audio keeps the generated region consistent with the original sound. If you don’t want that guidance — for example, when replacing a section of the frame, or to keep off-frame sound off-frame — remove the audio stream from the generation and/or adjust the conditioning.
These workflows use LTXAddVideoICLoRAGuideAdvanced (not the standard LTXAddVideoICLoRAGuide) for mask-aware conditioning.
Outpainting
Outpainting extends the video canvas beyond its original boundaries, generating new content in the padded region while preserving the original footage in the center.
Step-by-Step
- Download and load the outpainting workflow and drag it into ComfyUI. Install any missing custom nodes / models via the Workflow Overview panel.
- Load your source video in the LoadVideo node.
- Set the target canvas size — the source is centered in the target canvas and the surrounding pad becomes the mask (the region the model generates).
- Write your prompt (optional) — with no prompt, the model extends the canvas to match the surrounding scene. With a prompt, write a regular T2V-style description of the scene; it is not an edit tool. Enable the Gemma 4 enhancer to expand a short prompt.
- Generate. Runs the two-stage process above.
- Review and iterate — if the boundary between original and generated content shows issues, tune the blend dilation (see Customization).
Inpainting
Inpainting fills masked regions within the frame (removing or replacing objects) while preserving everything outside the mask.
Step-by-Step
- Download and load the inpainting workflow and drag it into ComfyUI. Install any missing nodes / models via the Workflow Overview panel.
- Load your source video in the LoadVideo node.
- Load your mask video — a black-and-white mask (white = inpaint, black = keep) that matches the source video’s frame count and aspect ratio. For object replacement, a looser mask works better than a tight silhouette. Create masks with a segmentation model (e.g. SAM), manual painting, or a bounding box.
- Write your prompt (optional) — with no prompt, the model fills the masked area to match the surroundings (usually removing the masked object). With a prompt, describe the full scene you want, not the edit (Right: “a horse walking down an empty country road, sunny afternoon”; Wrong: “replace the car with a horse”).
- (Optional) I2V mode for replacement — for object replacement, generate the first frame separately with the replacement composited in, then set bypass_i2v off to use that frame via LoadImage.
- Generate, then review and iterate — tune mask dilation and blend dilation at the boundaries (see Customization).
For replacement, size the mask for the new object, not the old one — a car-sized mask won’t give the model room to generate a truck. Increase dilation or use a bounding-box mask.
Key Nodes
LTXAddVideoICLoRAGuideAdvanced— mask-aware version of the IC-LoRA guide node; passes mask info through so the model knows which regions to generate vs. preserve. Use the workflow defaults.LTXVInpaintPreprocess— prepares the masked video input for each stage (no configurable parameters).LTXVDilateVideoMask(inpainting) — expands the mask before processing so the model has room to blend beyond the exact edge (spatial_radius;temporal_radiusdefault 0).LTXVLaplacianPyramidBlend— blends generated output with the original at mask boundaries; dilation (mask_low_res_dilation) is the key parameter for seam quality.
Customization
Dilation
Mask dilation (LTXVDilateVideoMask, inpainting) expands the mask itself — increase it if edges are unclean or the mask is tight. Blend dilation (mask_low_res_dilation in LTXVLaplacianPyramidBlend) controls how far blending extends past the mask edge — the most impactful setting for seam quality; raise it when the boundary contains low-frequency content (sky, smooth gradients).
Prompting
Describe the full scene, not the region or the edit — the model uses the prompt as context for the whole frame. Outpainting prompts are optional (the model extends from context); inpainting with no prompt usually removes the masked object.
CFG
Both stages use CFG 1. Raising it adds overhead and can oversaturate; if experimenting, stay in the 1.0–1.5 range.
Tips & Troubleshooting
- Prompts describe the scene, not the edit — write a regular T2V-style prompt for the region; this isn’t an editing tool.
- Boundary seam visible — adjust the blend
dilationinLTXVLaplacianPyramidBlend. - Green artifacts at mask edges — the pipeline composites green under the mask before diffusion, and traces can leak through. Try a bigger dilation, a different seed, or re-encode the mask losslessly; the blending parameter matters a lot.
- Inpainted object doesn’t match — describe the full scene, not the edit; for complex replacements use I2V mode with a composited first frame.
- Tight mask leaves artifacts — increase
spatial_radiusinLTXVDilateVideoMaskor use a looser mask.
Technical Notes
- The IC-LoRA loader’s
latent_downscale_factoris intentionally unused — the In-Outpainting LoRA was trained atreference_downscale_factor = 1, so the reference is processed at the output resolution. - Two-stage: Low Res (8 steps) → High Res (2 steps), with Laplacian pyramid blending at each stage.
- Audio is guided by frozen audio reference tokens (
VAEEncodeAudio→SetAudioRefTokens) rather than generated fresh, keeping the result consistent with the source’s sound.