# AIVectorGenerator

> Generate runs optical flow (SEA-RAFT, BSD-3) in the AI worker and caches vectors per frame.

Generate runs optical flow (SEA-RAFT, BSD-3) in the AI worker and caches vectors per frame. Adds layers motion (forward u,v + backward u,v in pixels, v up), forward, backward and occlusion; SmartVector layers add frame distances 2-16 for VectorDistort. Model Auto picks the best flow model that fits the free GPU memory. Resolution auto runs the flow at about 1024 px on the long side. Viewing a generated frame never blocks the app: the vectors of the last frames you looked at stay in memory.

| Node | AIVectorGenerator |
|---|---|
| Menu | AI › AIVectorGenerator |
| **Names in each format** | |
| .oink comp (JSON) | `"type": "OC_N_aivectorgenerator"` |
| .nk script | none: written as an Oink node |
| Python | `nuke.createNode("OC_N_aivectorgenerator")` |
| Assistant (MCP) | `create_node(type="AIVectorGenerator")` |
| Tab search | `aivectorgenerator`, or its initials `aivg` |

![AIVectorGenerator properties](/shots/nodes/aivectorgenerator@2x.webp)

## Inputs and outputs

| Port | Name | Type |
|---|---|---|
| input 0 | Source | image |
| output 0 | Image | image |

## Knobs

Panel tab **Aivectorgenerator**, in panel order.

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `model` | model | menu | `AUTO` | AUTO (Auto (by free GPU memory)), sea-raft-m (SEA-RAFT M), sea-raft-s (SEA-RAFT S (fast)) |  |  |
| `smartvector` | SmartVector layers | bool | `false` |  |  | Also compute frame distances 2, 4, 8, 16 (smartvector_fNN_v01) for VectorDistort |
| `scale_mode` | resolution | menu | `auto` | auto, custom |  |  |
| `proc_scale` | scale | float | `0.5` | 0.1 to 1 |  |  |
| `check_input` | check input | bool | `true` |  |  | Only use vectors made from exactly this input (content hash) |
| `cache_path` | cache folder | text |  |  |  | Empty = ~/.cache/opencomp/ai-results/vectors/<key> |
| `keep_other_frames` | keep other frames | bool | `true` |  |  |  |
| `keep_loaded` | keep model loaded | bool | `false` |  |  |  |

### Other knobs (Python, .nk and the assistant; not on the panel)

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `gl_color` | Viewer Controls Color | float ×3 | `0, 0, 0` | 0 to 1 |  |  |
| `postage_stamp_frame` | Static Frame | int | `1` | -2147483648 to 2147483647 |  |  |
| `lifetimeStart` | Lifetime Start | int | `0` | -2147483648 to 2147483647 |  |  |
| `lifetimeEnd` | Lifetime End | int | `100` | -2147483648 to 2147483647 |  |  |
| `useLifetime` | Use Lifetime | boolean | `false` |  |  |  |
| `cached` | Cached | boolean | `false` |  |  |  |
| `bookmark` | Bookmark | boolean | `false` |  |  |  |
| `dope_sheet` | Dope Sheet | boolean | `false` |  |  |  |
| `clone_group` | Clone Group | string |  |  |  |  |
| `link_source` | Link Source | string |  |  |  |  |
| `link_overrides` | Link Overrides | string |  |  |  |  |
| `split_views` | Split Views | string |  |  |  |  |
| `generation` | Generation | int | `0` | -2147483648 to 2147483647 |  |  |
| `generated_first` | Generated First | int | `0` | -2147483648 to 2147483647 |  |  |
| `generated_last` | Generated Last | int | `-1` | -2147483648 to 2147483647 |  |  |


---
Sources: opencomp_core/nodes/ai/aimotion.py, opencomp_electron/src/components/properties/knobSchema.ts, opencomp_core/nodes/help/aivectorgenerator.md
