Skip to content

Introduction to Workflows

Workflows let you chain together multiple jobs into a single convenient call to Prodia’s API. This helps minimise latency, reduce code complexity, and save bandwidth.

Use Cases

Workfows are great for:

  • Generating an image and then checking whether it’s safe for work
  • Creating an initial generation with one model then transforming it with another
  • Using an image model with better prompt following and then using it as the basis for a video generation

Example

Workflows are themselves jobs like any other on Prodia’s v2 platform.

Here’s an example of a workflow that only calls one job:

{
"type": "workflow.serial.v1",
"jobs": [
{
"type": "inference.flux.schnell.txt2img.v1",
"config": {
"prompt": "A beautiful image of a cat"
}
}
]
}

This job can be expanded to also do a moderation check as well:

{
"type": "workflow.serial.v1",
"jobs": [
{
"type": "inference.flux.schnell.txt2img.v1",
"config": {
"prompt": "A beautiful image of a cat"
}
},
{
"type": "workflow.moderate.v1",
"config": {
"threshold": 0.95
}
}
]
}