Nodes/ComfyUI-LTXVideo/πŸ…›πŸ…£πŸ…§ LTXV Inpaint Preprocess
ComfyUI Node Runs on cloud

πŸ…›πŸ…£πŸ…§ LTXV Inpaint Preprocess

Green-screen the region you want regenerated

By LightricksΒ·Created 2 years agoΒ·Updated about a month agoΒ· 3,956
πŸ…›πŸ…£πŸ…§ LTXV Inpaint Preprocess
  • images
  • mask
  • image

Small node, single job, and if you're inpainting with LTX you need it. It takes your images and a mask and paints the masked region a flat green, producing the exact input the LTX inpaint conditioning expects. That green fill is the convention - it's how you tell the model "everything green is the hole; regenerate it, leave the rest alone."

How it works

Per its description, it composites your images with a green background wherever the mask is active. So the untouched parts of the frame come through as-is, and the region you want changed is replaced with a solid green marker. The model, conditioned on this, treats green as the area to fill and reconstructs it from your prompt and the surrounding context. It's the video equivalent of the green-screen trick, and it's deliberately dumb in the best way - one clear signal, no ambiguity about what's being edited. Green specifically because it's a saturated color the model rarely needs to reconstruct as real content, so there's little chance of confusing "fill this" with "this is actually green." This is the frame-prep step; the actual regeneration happens downstream in your sampler, so on its own this node changes nothing you'd see in a final render - it's setting up the input for the inpaint conditioning that follows.

The inputs and output

There are only two inputs, which is the whole appeal:

  • images - the frames you're inpainting.
  • mask - where the green goes. White (active) becomes the regenerate region.

The output is a single image - your frames with the masked area greened out, ready to feed into the inpaint conditioning path.

Installing it

  • ComfyUI Manager - search LTXVideo, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Lightricks/ComfyUI-LTXVideo, then restart.

Common issues

Green bleeds into the result, or the edit leaks past where you wanted. Your mask is the culprit, not this node. It faithfully greens whatever the mask marks, so a loose or hard-edged mask gives a loose or hard-edged edit. Run your mask through LTXV Preprocess Masks (to get it into latent space cleanly) and Dilate Video Mask (to grow and feather it) before it reaches here.

The regenerated region ignores the surrounding video. That's a conditioning/prompt issue downstream, not the preprocess. Give the model enough context in the prompt to know what belongs in the hole - LTX punishes thin prompts, and an inpaint with no guidance just invents something.

Mask and image sizes don't match. They have to align frame-for-frame and pixel-for-pixel. A mask that's a different resolution or frame count than your images will composite wrong; resize the mask to match before this node.

CategoryLightricks/image_processing

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEVideo frames to composite onto the green background.
maskMASKMask indicating regions to replace with green. Single-frame masks are broadcast.

Outputs (1)

NameTypeDescription
imageIMAGEβ€”