Backend API
APIs available to nodes for model loading, file I/O, uploads, and audio processing.
Model API
Section titled “Model API”List Registered Models
Section titled “List Registered Models”Returns all models in the registry with their install status. Useful for checking if a required model is available before a node runs.
GET /api/modelsResponse:
[ { "id": "yolox_s", "name": "YOLOX S", "category": "Object Detection", "source": { "type": "huggingface", "url": "Megvii-BaseDetection/YOLOX" }, "installed": true }]List Models by Category
Section titled “List Models by Category”Lists installed model files in a specific category folder. Used by loader nodes (e.g., LoadYOLOXModelNode) to populate dropdowns.
GET /api/models/:categoryExample:
GET /api/models/Object DetectionResponse:
[ { "name": "yolox_s", "path": "Object Detection/yolox_s.pth" }]Download a Model
Section titled “Download a Model”Triggers a background download job for a registered model. Returns a job_id for polling status.
POST /api/models/download/:idPoll for status:
GET /api/downloads/status/:job_idStatus response:
{ "status": "running", "progress": 42, "message": "Downloading... 42%"}Status values: running, completed, error.
File API
Section titled “File API”Use these to persist data a node generates (e.g., custom workflows, presets, config files) to the libs directory.
Save a File
Section titled “Save a File”POST /api/files/save{ "path": "my_node/config.json", "content": { "key": "value" } }Read a File
Section titled “Read a File”GET /api/files/read?path=my_node/config.jsonList Files
Section titled “List Files”GET /api/files/list?path=my_nodeUpload API
Section titled “Upload API”Handles chunked file uploads from widgets. When a node’s frontend uploads a file, it uses this endpoint.
POST /api/uploadForm Data fields:
| Field | Description |
|---|---|
file | Chunk blob |
filename | Full filename |
chunkIndex | Current chunk index |
totalChunks | Total chunk count |
sessionId | Session ID for file isolation |
nodeId / nodeName | Used to scope upload folder to the node |
On success (final chunk):
{ "success": true, "completed": true, "filePath": "/temp/uploads/session_id/NodeName_nodeId/file.mp4"}Audio API
Section titled “Audio API”Trim Audio
Section titled “Trim Audio”Trim an audio file server-side using FFmpeg. Typically called from an audio node that has an AudioTrimmerModal in its widget.
POST /api/audio/trim{ "filePath": "/temp/uploads/.../audio.mp3", "start": 10.5, "end": 25.0, "sessionId": "abc123"}Response:
{ "success": true, "filePath": "/temp/AudioTrim/audio_trimmed_1712345.mp3"}