Aller au contenu

Repair Frame Node

By Kriss Norde

The Repair Frame node repairs damaged frames or areas with scratches / transient temporal artifacts. It uses three frames (the target + two neighbors) and computes its own optical flow internally (no need for a separate Optical Flow node). Essential for film archive cleanup, dust busting and scratch retouching.

Overview

Repair Frame rebuilds the current frame by interpolating from the neighboring frames through motion vectors. If a defect (scratch, dust) appears only on frame N and not on N-1 or N+1, the node can replace it based on the neighbors.

Advantage: optical flow built into the node, no complex chain needed. Drawback: a heavy computation on every frame (vs an external OF that can be cached).

Where to find this node

  • Effects Library: Tools > Optical Flow > Repair Frame
  • Quick add: right-click in the Node Editor → Add Tool > Optical Flow > Repair Frame

Inputs

  • Input (orange) - the primary 2D image to repair.
  • Effect Mask (blue) - optional. Limits the repair to specific areas (e.g. only the identified scratch).

Setup

Repairing an isolated scratch:
MediaIn → Effect Mask (scratch area) → Repair Frame
                                     → MediaOut

General dust busting cleanup:
MediaIn → Repair Frame (Source Frame = Prev/Next blended)
       → MediaOut
   = removes one-off defects on a few frames

With an animated mask:
MediaIn → Roto/Mask Paint (defect areas animated per frame)
       → Repair Frame (mask applied)
       → MediaOut

Multi-pass repair:
MediaIn → Repair Frame (1st pass)
       → Repair Frame (2nd pass for remaining defects)
       → MediaOut

Controls tab

Depth Ordering (Fastest On Top / Slowest On Top)
Sets the render priority based on the speed of the motion vectors. Fastest On Top brings fast elements to the front.
Clamp Edges
Removes transparent edge gaps in interpolated frames. Can introduce stretching artifacts. Use it sparingly for minor gaps.
Edge Softness (0.01-0.03 recommended)
Reduces the stretching artifacts from Clamp Edges. ~0.01 with multiple sources, ~0.03 with a single source.
Source Frame & Warp Direction
Four options: Prev Forward, Next Forward, Prev Backward, Next Backward. They can be blended to interpolate from multiple sources.
Optical Flow Options
Parameters mirroring the Optical Flow node (Classic / Advanced controls). Smoothness, Search Range, etc.

Settings tab

The Settings tab is shared with the other Optical Flow nodes and exposes common blending and masking controls:

Blend (0.0 - 1.0)
Mix between the original input image and the repaired result. 0 = pass-through, 1 = full repair. Useful to tone down a repair that is too aggressive.
Process When Blend Is 0.0
Processes the node even when Blend = 0. Useful for scripted operations.
RGBA Channel Selectors
Limit the repair to specific channels (e.g. repair only the Alpha of a damaged key).
Apply Mask Inverted / Multiply by Mask
Options for the Effect mask. Inversion or multiplication by the mask channel.
Use Object / Use Material
Enables the Object ID / Material ID channels of EXR files as masks to target the repair by ID.
Correct Edges
Edge handling toggle for multi-object images.
Object ID / Material ID Sliders
Selectors for a specific ID value, with a Sample picker button.
Hide Incoming Connections
Hides the input wires for a cleaner node tree.
Comments
Node annotation, shown through a tooltip.
Scripts
3 fields for render-time operations (pre/render/post).

Use cases

  • Removing scratches from film archives - historical film scans with scratches: Repair Frame masks the scratch and rebuilds it from the neighboring frames.
  • Dust busting - isolated dust particles: Repair Frame with a mask on the defect area.
  • Temporarily damaged frame - a capture problem on a single frame (camera glitch): rebuilt from the neighbors.
  • Live action cleanup without complex roto - a few isolated defects: a fast alternative to roto + manual paint.
  • Archive restoration - an automated cleanup pipeline for old, degraded footage.

Tips

  • Mask the defect area - without an Effect Mask, the node changes the whole frame (not ideal). Always mask to target it.
  • It destroys auxiliary channels - the node destroys AOVs (Z, normals, etc.) after processing. If you need to keep them, do the repair in parallel and then use Channel Booleans.
  • Use Clamp Edges sparingly - only for minor edge gaps. Too much = visible stretching.
  • Balanced Edge Softness - 0.01 minimum, 0.03 max. Beyond that the softness becomes too visible.
  • Multiple Source/Warp for robustness - blending several warp directions = a more stable reconstruction, but it amplifies the edge softness.
  • Heavy on CPU/GPU - built-in OF = recalculated on every frame. For long pipelines, an alternative: a cacheable external OF + manual Vector Distortion.
  • For persistent defects (scratches over several consecutive frames), Repair Frame can fail because the neighbors have the defect too. Prefer manual paint or a specialized AI tool.