Skip to content

Backend API

APIs available to nodes for model loading, file I/O, uploads, and audio processing.


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/models

Response:

[
{
"id": "yolox_s",
"name": "YOLOX S",
"category": "Object Detection",
"source": { "type": "huggingface", "url": "Megvii-BaseDetection/YOLOX" },
"installed": true
}
]

Lists installed model files in a specific category folder. Used by loader nodes (e.g., LoadYOLOXModelNode) to populate dropdowns.

GET /api/models/:category

Example:

GET /api/models/Object Detection

Response:

[
{ "name": "yolox_s", "path": "Object Detection/yolox_s.pth" }
]

Triggers a background download job for a registered model. Returns a job_id for polling status.

POST /api/models/download/:id

Poll for status:

GET /api/downloads/status/:job_id

Status response:

{
"status": "running",
"progress": 42,
"message": "Downloading... 42%"
}

Status values: running, completed, error.


Use these to persist data a node generates (e.g., custom workflows, presets, config files) to the libs directory.

POST /api/files/save
{ "path": "my_node/config.json", "content": { "key": "value" } }
GET /api/files/read?path=my_node/config.json
GET /api/files/list?path=my_node

Handles chunked file uploads from widgets. When a node’s frontend uploads a file, it uses this endpoint.

POST /api/upload

Form Data fields:

FieldDescription
fileChunk blob
filenameFull filename
chunkIndexCurrent chunk index
totalChunksTotal chunk count
sessionIdSession ID for file isolation
nodeId / nodeNameUsed to scope upload folder to the node

On success (final chunk):

{
"success": true,
"completed": true,
"filePath": "/temp/uploads/session_id/NodeName_nodeId/file.mp4"
}

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"
}