A workflow JSON file consists of three main collections and an edges list:
references: Input nodes (e.g., uploaded files, editable text, literal values).operators: Processing steps (e.g., Spaces, models, datasets, or Python functions).subjects: Output nodes (the results being created).
Operator Kinds
kind | Description |
|---|
"space" | A Gradio Space on the Hub via gradio_client. Requires space_id and endpoint. |
"model" | A Hugging Face model via InferenceClient. Requires model_id and a supported endpoint (e.g., text_to_image). |
"dataset" | A Hub dataset. Requires dataset_id, dataset_config, and dataset_split. |
"fn" | A Python function whose fn value matches a key in bind=. |
Supported Port Types
image, audio, video, text, number, boolean, gallery, file, json, model3d, any (fallback).
{
"schema_version": "2",
"name": "My Pipeline",
"references": [
{
"id": "ref_prompt", "label": "Prompt", "role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}]
}
],
"operators": [
{
"id": "op_flux", "label": "FLUX.1", "role": "operator",
"kind": "model",
"model_id": "black-forest-labs/FLUX.1-schnell",
"endpoint": "text_to_image",
"pipeline_tag": "text-to-image",
"inputs": [{"id": "prompt", "label": "Prompt", "type": "text", "required": true}],
"outputs": [{"id": "out_0", "label": "Image", "type": "image", "output_index": 0}]
}
],
"subjects": [
{
"id": "sub_img", "label": "Output Image", "role": "subject",
"asset_type": "image",
"inputs": [{"id": "in", "label": "Image", "type": "image"}],
"outputs": [{"id": "out", "label": "Image", "type": "image"}]
}
],
"edges": [
{
"id": "e1",
"from_node_id": "ref_prompt", "from_port_id": "out",
"to_node_id": "op_flux", "to_port_id": "prompt",
"type": "text"
},
{
"id": "e2",
"from_node_id": "op_flux", "from_port_id": "out_0",
"to_node_id": "sub_img", "to_port_id": "in",
"type": "image"
}
]
}