
ANR Matte Creator
Draw a box, click a point or type a word on one frame, and the AI model mattes that subject through the whole shot, with clean hair and soft edges.
- Masking
- Masking pack
- Masking models
- 3 inputs
- 68 controls
Overview
Matte Creator makes a matte from a prompt instead of a roto. On one frame, the Init Frame, you draw a box round the subject, click it, or type what to find ("person", "red car"). The tracking model cuts the subject out on that frame and carries it forward and backward through the shot as you play.
Each prompt is its own object, with its own colour in the viewer, up to eight objects. Where the AI gets a frame wrong, you click Add FG Refine Point on something missing or Add BG Refine Point on something that leaked in, on that frame; the track runs again from there.
The edge is then refined at full resolution by a matting model (ViTMatte or MEMatte in Edge Refiner), which recovers hair, fur and motion blur in a band round the edge. The Cleanup section removes specks, fills holes, shrinks, grows or feathers the matte, and the Holdout input adds or cuts away another matte.
When the matte is right, Freeze and Bake to Disk writes it to 16-bit PNG files and plays them back, so the comp opens with no AI engine running and no graphics memory used.
Inputs
- Sourcerequired
The plate to matte. The AI sees its picture; the output keeps its colour.
- Maskoptional
An optional matte (its alpha). With Mask Input set to Track It, the mask on the Init Frame becomes an object the AI follows, for example a quick roto of one part. With Refine Only, there is no tracking: this matte is refined and cleaned on every frame.
- Holdoutoptional
An optional matte (its alpha) applied to the finished matte as set by Holdout Mode: added to it, cut out of it, or intersected with it.
Output. The Source with the finished matte in alpha. Display sets the RGB: the picture tinted per object (Matte Overlay), the matte in black and white, the picture premultiplied by the matte, or the picture untouched (Straight (RGB + alpha)).
Quick start
- Add ANR Matte Creator under the plate and view it. Go to a frame where the subject is clearly visible.
- With Tool on Add Box Object, drag a box round the subject in the viewer. Or set Tool to Add Point Object and click it, or type a word in Text Prompt and press Add Objects by Text. This frame becomes the Init Frame.
- Play forward from the Init Frame. Each frame is tracked from the one before; to get the frames before the Init Frame, play or step backward from it.
- Where the matte is wrong on a frame, pick Add FG Refine Point or Add BG Refine Point and click on that frame. The track runs again from there.
- For hair and soft edges keep Edge Refiner on ViTMatte or MEMatte. Raise Refine Band Outside for long or wispy hair; lower it for a clean skin or cloth edge.
- Set Display to Straight (RGB + alpha) or Premultiplied before you use the node in the comp.
- Set a Cache Folder (or press Generate Autofill), then press Bake Frames to write the whole shot to disk and play it back from there.
The panel
The node's panel as Nuke shows it, with the values of a new node. Click any control to see what it does; tabs and sections work as in Nuke.
No control matches.
All controls
ANR Matte Creator68 controls
- StatusStatus
status What the node is doing: loading models, tracking, baking, or what it needs from you next.
- Freeze and Bake to DiskCheckbox
bake Write every frame that renders as a 16-bit RGBA PNG (the matte in rgb and alpha) and play them back from disk. With this on, opening the comp starts no AI engine and uses no graphics memory. Turn it off to edit. Matte Creator asks for confirmation; freezing again refreshes each rendered frame, and Bake Frames replaces the selected range.
- Import Baked FootageButton
importBaked Creates a Read node for the baked sequence right under this node (through Nuke's own Python). If the host cannot do that, the Read goes on the clipboard instead: hover the node graph and press Ctrl+V.
Bake Settings
- Generate AutofillButton
anrCacheAutoFill Create a new node-type/footage_letter_4digits folder on every click, then stop. Previous caches are kept. Enter a folder to choose a custom base.
Makes a new, empty folder for this node each time you click it and puts it in Cache Folder. It goes next to the saved script by default (ANR > Cache Folders > Location in Nuke's menu bar can put it next to the footage); a folder you typed into Cache Folder is used as the base instead. Save the script first.
- Cache FolderFile
bakeDir Each node writes //.####.png. Read the sequence back with an ordinary Read node.
Each node writes into a subfolder named after Name Prefix: with the default prefix,
anr_matte/anr_matte.####.pnginside this folder. Two nodes with the same folder and prefix write over each other, so give each node its own folder (Generate Autofill does) or its own prefix.- Name PrefixText
bakePrefix Prefix for the subfolder and the file names; #### sets the frame padding. Empty uses the node's own id.
- Limit to Frame RangeCheckbox
bakeRange Only bake (and matte) frames inside the range below; the rest pass through. Off: Bake Frames bakes the Source's whole range.
- Bake FromSlider
bakeFrom First frame to bake.
- Bake ToSlider
bakeTo Last frame to bake.
- Bake FramesButton
bakeFrames Bake now, without playing through the shot: every frame from Bake From to Bake To when Limit to Frame Range is on, otherwise the Source's whole range. Each frame is matted again and written as a 16-bit RGBA PNG (the matte in rgb and alpha) into the Cache Folder; Freeze and Bake to Disk turns on, so they play back from disk. Cancel on the progress bar stops it.
- ToolMenu
selectionTool Select objects with boxes or points. Add foreground/background refine points to correct the selected object on a frame.
- Point DetailMenu
pointLevel How big a piece one click grabs. Auto lets the model choose; Small, Medium and Large pick the smallest, middle or largest of its three candidates -- a hand, an arm, the whole person. Remembered per point.
- Text PromptText
textPrompt What to find, e.g. "person" or "red car". Press Add by Text; every instance found on the init frame becomes its own object. Comma-separate several phrases.
- Add Objects by TextButton
textSubmit What to find, e.g. "person" or "red car". Press Add by Text; every instance found on the init frame becomes its own object. Comma-separate several phrases.
- Init FrameSlider
initFrame The frame the objects were created on. Tracking runs forward and backward from here.
- Go to Init FrameButton
goToInit Jump the timeline to the init frame.
- Reset SceneButton
resetScene Remove every object. The next object starts a fresh scene on the frame you are on.
- Reset TrackButton
resetTrack Throw away the tracked masks and the model's memory, keep the objects. Go to the init frame and play to track again.
- Clear Refine PointsButton
clearRefines Remove every FG / BG refine point from every object.
- Delete SelectedButton
deleteSelected Remove the object selected in the viewer.
- Edge RefinerMenu
refiner Raw: the soft mask straight from the tracker, shaped by Edge Softness. Hard: thresholded, no refiner. MEMatte / ViTMatte: AI edge matting for hair, fur and soft edges -- the best quality, a little slower. MEMatte is lighter on a 4K plate.
- Edge StabilitySlider
edgeStability Reduce flicker using motion-aligned neighbouring frames. 0 is off. Higher values use more temporal averaging. Rejects unreliable motion and large changes; requires additional frame processing.
- Binarize ThresholdSlider
binarize Where the tracker's probability is cut into foreground and background. Drives Hard output, the centre of the refiner's band, and the cleanup. SAM's own midpoint is 0.5, but that sits about 2 pixels inside the edge a commercial matte draws on a 4K plate; 0.3 matched it. Lower is bigger.
- Refine Band InsideSlider
trimapErode How far inside the edge is definitely foreground, in pixels. Small keeps the edge where the tracker put it; large lets the refiner move it further inward.
- Refine Band OutsideSlider
trimapDilate How far outside the edge the refiner may grow detail, in pixels. The main quality knob: 8 for a clean cloth or skin edge, 30 or more for long wispy hair. Wider is softer, and slower.
- Edge SmoothingSlider
edgeSmooth Rounds the edge, in pixels. With a matting model it is a blur applied only inside the refiner's band, removing the model's grain; with Hard or Raw output it rounds the cut through the scaled-up tracker probability. 1.5 matches a clean commercial matte; 0 is off.
- Edge SoftnessSlider
edgeSoftness Raw only. How wide the soft band around the threshold is, in model confidence. 0.10 gives a crisp antialiased edge; larger lets more of the model's uncertainty through.
- DisplayMenu
display Matte Overlay: the picture with each object tinted, alpha carries the matte. Matte Only: black and white. Premultiplied: the picture cut out by the matte. Straight: the picture untouched with the matte in alpha.
- Overlay OpacitySlider
overlayMix How strongly each object is tinted in Matte Overlay.
Crop
- Crop ModeMenu
cropMode Which part of the frame the model sees. It always works on a fixed 1008x1008 picture, so a crop around the objects gives them more pixels and a sharper edge. Off sends the whole frame (most context, least detail on a 4K plate). Union crops round all objects together. Manual is a rectangle you draw and can animate. Per object gives each tracked instance its own crop and refinement region. It preserves detail on separated subjects but uses more inference and memory.
- Crop Padding %Slider
cropPadding Margin around the objects inside the crop, as a percentage of their size. More padding is more room to move between frames and more context; less is more detail.
- Crop Follows ObjectsCheckbox
cropFollow Slide the crop to keep the tracked objects inside it as they move.
- Crop Aspect LimitSlider
cropAspect How elongated the crop may be before it is padded toward a square. The model squashes the crop to a square, so a long thin one distorts; 1.5 is safe.
- Manual Crop Bottom-LeftPosition
cropBL The rectangle the model sees, in Manual crop mode. Drag its handles in the viewer, or press Set Manual Crop From Auto to start from the crop the tracker chose. Animate it (set keys) to follow the subject; frames already tracked with a different crop are tracked again.
- Manual Crop Top-RightPosition
cropTR The rectangle the model sees, in Manual crop mode. Drag its handles in the viewer, or press Set Manual Crop From Auto to start from the crop the tracker chose. Animate it (set keys) to follow the subject; frames already tracked with a different crop are tracked again.
- Set Manual Crop From AutoButton
cropFromAuto Copy the crop the tracker used on this frame into the Manual Crop, and switch to Manual.
Cleanup
- Close GapsSlider
closeGaps Smooth the tracked mask before it is cut: creases, notches and thin slits narrower than this many pixels are closed, so the edge does not chase a shadow between an arm and the body. 0 is off. It also closes real gaps of that size (between fingers), so keep it small.
- Fill Holes Before RefineCheckbox
refineFillHoles Close every enclosed hole in the hard matte before it goes to the matting model, so the refiner only solves the outer edge. Off when the subject has real gaps (between an arm and the body).
- Remove SprinklesSlider
removeSprinkles Drop disconnected islands up to this area, in full-resolution pixels. 0 is off.
- Fill HolesSlider
fillHoles Fill enclosed holes up to this area, in pixels. 0 is off.
- Shrink / GrowSlider
shrinkGrow Contract (negative) or expand (positive) the matte, in pixels.
- FeatherSlider
feather Soften the matte edge with a blur, in pixels.
- Holdout ModeMenu
holdoutMode How the Holdout input is applied to the finished matte. Add is a union, Subtract cuts it out, Intersect keeps only the overlap.
Tracking
- Tracking ModeMenu
trackMode Locked Init Frame: create objects on the init frame, press play, the mask propagates by memory. Per Frame: no memory at all -- every frame is segmented from the prompts as drawn, for the rare shot where tracking will not hold.
- Enrich First FrameCheckbox
enrichFirst Run the init frame through the model's memory twice, so the starting mask is as clean as a tracked one. One extra pass on the seed frame only.
- Mask InputMenu
maskUse What the Mask input is for. Track It: the mask on the init frame becomes an object the AI follows -- a roto of one part, a luma key, anything. Refine Only: no tracking; the mask is refined and cleaned up on every frame, so this node polishes a matte made elsewhere.
- Score ThresholdSlider
textScore Minimum confidence to keep a detection. Raise it if wrong things are found, lower it if the right one is missed.
- Overlap ThresholdSlider
textIou How much two detections may overlap before the weaker one is dropped.
Edge (expert)
- Solve Uncertain AreasCheckbox
trimapAdaptive Where the tracker itself is unsure (fingers, hair, thin edges: probabilities well away from 0 and 1), no Binarize Threshold is right, so those pixels go to the matting model instead of being cut. Where the tracker is sure, the threshold and the trimap band apply as usual.
- Solve Existing Soft EdgeCheckbox
trimapSoft Pixels that are already partly transparent (a keyer, a blurred roto, a soft mask input) join the uncertain band as well.
- Edge ContrastSlider
edgeContrast Tighten the refined edge. 1 keeps the matting model's answer, including motion blur and hair; 2 halves the width of every transition and also hardens motion blur, so use it only on a sharp, static edge that came out soft.
- Trimap Pre-BlurSlider
trimapPreblur Smooth the mask before building the trimap, to soften the upscale staircase.
- Show TrimapCheckbox
showTrimap Paint the trimap in the viewer: green inside, cyan outside, grey the band the refiner solves. View only.
Shows only when Display is Matte Overlay, and only with ViTMatte or MEMatte as Edge Refiner.
- Refiner Tile SizeSlider
tileSize How much of the edge goes to the matting model at a time, in pixels. The edge is never reduced: a bigger subject is more tiles. Lower this if you run out of graphics memory.
Levels
- Input BlackSlider
inBlack Shape the raw soft mask before it is cut: black, white and gamma.
- Input WhiteSlider
inWhite Shape the raw soft mask before it is cut: black, white and gamma.
- Input GammaSlider
inGamma Shape the raw soft mask before it is cut: black, white and gamma.
- Output BlackSlider
outBlack Remap the finished matte. A white point of 0.99 snaps a nearly solid interior to a clean 1.0.
- Output WhiteSlider
outWhite Remap the finished matte. A white point of 0.99 snaps a nearly solid interior to a clean 1.0.
- Output GammaSlider
outGamma Remap the finished matte. A white point of 0.99 snaps a nearly solid interior to a clean 1.0.
Viewer
- Show Viewer ControlsCheckbox
showOverlay Show or hide the boxes, points and panel in the viewer.
- Show Object PanelCheckbox
showPanel Show the object list in the viewer.
- Viewer Controls SizeSlider
overlayScale Size of the viewer controls; try 1.5 on a 4K monitor.
System
- DeviceMenu
device Automatic uses the GPU and compiles the encoder for it once (about a minute the first time). GPU skips the compile. CPU is many times slower and only for machines without an NVIDIA card.
- Apply sRGB to InputCheckbox
srgbInput The models were trained on display-referred pictures. On, for a linear working space (Nuke's default): the plate is converted to sRGB before the model sees it. Off when the input is already display-referred or you colour-manage upstream. Only the picture the AI sees changes.
- Mask Cache (MB)Slider
cacheBudget How much memory tracked masks may take per node before the oldest are dropped. Bake to disk for long shots.
- Load ModelsButton
loadModel Start the inference helper and load SAM 3 now. Otherwise it happens on the first render.
- UnloadButton
unloadModel Stop the helper and give every byte of graphics memory back.
Tips
- In the viewer's object panel, S solos an object, On / Off turns it off without deleting it, and the cross deletes it. An object the tracking model thinks has gone shows a low percentage, and the panel lists the frames worth checking.
- Point Detail sets how much one click grabs: Small, Medium or Large pick a hand, an arm or the whole person; Auto lets the model choose.
- Shift-click a point to delete it. With the viewer in focus, Delete or Backspace removes the point under the cursor or the selected object.
- On a 4K plate, keep Crop Mode on Per object (recommended): the model works on a fixed-size picture, so a crop round each subject gives it more pixels. If the automatic crop cuts off part of the subject, press Set Manual Crop From Auto and drag the rectangle in the viewer; set keys on it to follow the subject.
- Show Trimap paints the band the matting model solves (grey) in the viewer, with Display on Matte Overlay. Use it to judge Refine Band Inside and Refine Band Outside.
- If the matte sits slightly inside the subject's edge, lower Binarize Threshold a little; raise it if the matte grabs background.
- Edge Stability steadies a flickering edge using the neighbouring frames, at the cost of extra processing per frame.
- Mask Input > Refine Only turns the node into an edge refiner for a matte made elsewhere (a roto or a key on the Mask input).
- For a fringe of the old background in the edge colours, follow this node (Display Premultiplied) with ANR Edge Detail Extension.
Good to know
- The node needs an NVIDIA graphics card for practical speeds. Device > CPU works on machines without one but is many times slower. Automatic compiles the model for your card the first time, which takes about a minute.
- If the Masking models were not installed with ANR Tools, Nuke offers to download them the first time you add the node in a session (Download models or Not now). After the download, render the frame again.
- In Locked Init Frame mode, objects are created only on the Init Frame. To start somewhere else, press Reset Scene and draw again on the new frame.
- Nothing is baked until Cache Folder is set. With Limit to Frame Range on, frames outside the range pass the Source through untouched.
- Turning Freeze and Bake to Disk off asks for confirmation: freezing or baking again replaces the cached matte with your edits. Press Generate Autofill first if you want to keep the old version in a separate folder.
- After about ten minutes without work (sooner when the graphics card is nearly full), the node gives its graphics memory back. The next frame loads the model again, which takes a moment.
- Long shots: tracked masks are kept in memory up to Mask Cache (MB); older ones are dropped and tracked again when needed. Bake the shot to avoid that.
Something unclear or missing? Write to [email protected].