disposeVideoMattingModel()v4.0.523
Releases the memory used by initialized video matting models. Persistent cached model files are not deleted.
Use await using with loadVideoMattingModel() for cleanup at the end of a scope; call disposeVideoMattingModel() when you want to release a model loaded automatically.
dispose.tsimport {disposeVideoMattingModel } from '@remotion/video-matting'; awaitdisposeVideoMattingModel ({model : 'modnet'});
Options
model?
Only dispose this model. Default: all loaded video matting models.
If the model is in use, disposal waits until active separations using it have finished.
Return value
A Promise<void> that resolves after the selected models have been disposed.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||