# prodia > Prodia's v2 API documentation --- # Getting Started Source: https://docs.prodia.com/ Generate images and video through a single API. Create a token in the [API Dashboard](https://app.prodia.com/api), then try this request. ## Your first request With cURL installed, run these commands in a Bash-compatible terminal: ```bash export PRODIA_TOKEN=your-token-here curl --fail-with-body --silent --show-error \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ --json '{ "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "puppies in a cloud, 4k" } }' \ --output puppies.jpg \ https://inference.prodia.com/v2/job ``` On success, open `puppies.jpg` to see the generated image. Keep your token on the server, in an environment variable; do not put it in browser code. For JavaScript and Python setup, follow the steps below. To use these docs with a coding assistant, select **Copy for AI** above. The [documentation index](https://docs.prodia.com/llms.txt) and [full markdown export](https://docs.prodia.com/llms-full.txt) are also available. ## API Token If you don't already have an account navigate to the [app.prodia.com](https://app.prodia.com/) and click *Sign Up*. > note: > > You'll need a Pro subscription in order to generate a v2 token. Make sure to > [upgrade](https://app.prodia.com/) your account to Pro if you haven't > already! Go to the [API Dashboard](https://app.prodia.com/api) to generate a token. You should see a token management screen similar to this: ![Prodia API Dashboard v2 Token Management](https://docs.prodia.com/llms/assets/1b41ea0ddd58-prodia-app-v2-tokens.png) If the token management interface isn't showing up please check that you have an active Pro subscription. Give the token a meaningful label like `getting started` and click *Create API Key*: ![Prodia API Dashboard v2 Token Create API Key](https://docs.prodia.com/llms/assets/e0ac509e15b5-prodia-app-v2-tokens-create.png) Next copy the key to a safe location. We will use this key for the remainder of the tutorial. ![Prodia API Dashboard v2 Token Copy API Key](https://docs.prodia.com/llms/assets/e31dc66bfdcb-prodia-app-v2-tokens-copy.png) > caution: > > Make sure to copy the API Key to a safe place (e.g. a password manager). The > API Key will only be visible in the dashboard once. Now that we have an API key we are ready to set up the project. ## Project Setup ```bash # Create a project directory. mkdir prodia-getting-started cd prodia-getting-started ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ## Text to Image Add the following to the main file: ### prodia-js ```js const fs = require("node:fs/promises"); const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); (async () => { // run a flux schnell generation const job = await prodia.job({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", } }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); })(); ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ### curl ```bash set -euo pipefail job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate an image ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { // run a flux schnell generation const job = await prodia.job({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/png', } job = { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Transform an image to an image Here we will convert a picture of a sunny day to one of a rainy day. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); // v2 :) const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { // get input image const sunnyDay = await (await fetch("https://docs.prodia.com/sunny-day.jpg")).arrayBuffer(); // run a klein generation const job = await prodia.job({ type: "inference.flux-2.klein.img2img.v1", config: { prompt: "rainy landscape, 4k", }, }, { inputs: [ sunnyDay ] }); const rainyDay = await job.arrayBuffer(); await fs.writeFile("rainy-day.jpg", new Uint8Array(rainyDay)); // open rainy-day.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('sunny-day.jpg', 'rb') as f: sunny_day = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/sunny-day.jpg') sunny_day = BytesIO(res.content) with open('sunny-day.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.flux-2.klein.img2img.v1', 'config': { 'prompt': 'rainy landscape, 4k', }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('sunny-day.jpg', sunny_day, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('rainy-day.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.flux-2.klein.img2img.v1", "config": { "prompt": "rainy landscape, 4k" } } EOF if ! [[ -f sunny-day.jpg ]]; then curl -Lo sunny-day.jpg 'https://docs.prodia.com/sunny-day.jpg' fi curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@sunny-day.jpg \ --output rainy-day.jpg \ --retry 3 \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open rainy-day.jpg ``` ### Linux ```bash xdg-open rainy-day.jpg ``` ### Windows ```bash start rainy-day.jpg ``` --- # Combining Multiple Images Source: https://docs.prodia.com/guides/combining-multiple-images/ Several Prodia models accept more than one input image in a single job. This is the model to reach for when you need to combine a subject from one photo with a setting from another, swap an element across images, or carry style and identity from a reference into a new scene — all without writing custom compositing code. This guide walks through the multipart shape used to send multiple inputs and shows it end-to-end with [Nano Banana](https://docs.prodia.com/models/nano-banana/) and [FLUX.2 \[flex\]](https://docs.prodia.com/models/flux-2/). The same pattern works with every job type listed under [Models that support multiple inputs](https://docs.prodia.com/guides/combining-multiple-images/#models-that-support-multiple-inputs) below. We'll combine these two inputs — a product shot of a ceramic mug and an empty kitchen scene: ![multi-input-product.jpg](https://docs.prodia.com/llms/assets/6492551e04a1-multi-input-product.jpg) product.jpg — a white ceramic mug on a neutral grey background ![multi-input-scene.jpg](https://docs.prodia.com/llms/assets/3552b2de05f5-multi-input-scene.jpg) scene.jpg — an empty wooden kitchen table in warm morning light ### Project Setup ```bash # Create a project directory. mkdir prodia-combining-images cd prodia-combining-images ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### How multi-image inputs work A multi-image job has two parts: 1. The `config.images` array lists the **filenames** of the inputs in the order your prompt refers to them — for example `["product.jpg", "scene.jpg"]`. 2. Each filename must be sent as a separate `input` part in the multipart `POST /v2/job` request, with the same name the config refers to. The server matches the `images` filenames to the `input` parts. Send too few parts, or use a different filename than the config references, and you'll get a `400 Bad Request` such as `filename 'product.jpg' not found in request`. > tip: > > Refer to inputs by position in your prompt — *"the subject from the first image, in the setting from the second image"*. The model sees them in the order you sent them. ### Compose with Nano Banana [`inference.nano-banana.img2img.v2`](https://docs.prodia.com/job-types/inference-nano-banana-img2img-v2/) accepts up to 3 input images for $0.039 per job, regardless of resolution. ### prodia-js The JS SDK uses `File` objects to preserve the filename — the config's `images` array must match these names exactly. ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // download the two reference images on first run for (const name of ["product.jpg", "scene.jpg"]) { try { await fs.access(name); } catch { const res = await fetch(`https://docs.prodia.com/multi-input-${name}`); await fs.writeFile(name, new Uint8Array(await res.arrayBuffer())); } } const product = new File( [await fs.readFile("product.jpg")], "product.jpg", { type: "image/jpeg" }, ); const scene = new File( [await fs.readFile("scene.jpg")], "scene.jpg", { type: "image/jpeg" }, ); const job = await prodia.job({ type: "inference.nano-banana.img2img.v2", config: { prompt: "Place the white ceramic mug from the first image onto the wooden table in the second image. Match the warm morning lighting and the shallow depth of field of the kitchen scene. Keep the mug's matte finish and proportions exactly the same.", images: ["product.jpg", "scene.jpg"], aspect_ratio: "1:1", }, }, { inputs: [product, scene], }); const composed = await job.arrayBuffer(); await fs.writeFile("composed.jpg", new Uint8Array(composed)); })(); ``` ```bash node main.js ``` ### requests Send each input as its own `('input', (filename, bytes, mime))` tuple in the `files` list. The filename in the tuple must match the entry in `config.images`. ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) inputs = {} for name in ('product.jpg', 'scene.jpg'): try: with open(name, 'rb') as f: inputs[name] = f.read() except FileNotFoundError: res = requests.get(f'https://docs.prodia.com/multi-input-{name}') inputs[name] = res.content with open(name, 'wb') as f: f.write(res.content) headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.nano-banana.img2img.v2', 'config': { 'prompt': "Place the white ceramic mug from the first image onto the wooden table in the second image. Match the warm morning lighting and the shallow depth of field of the kitchen scene. Keep the mug's matte finish and proportions exactly the same.", 'images': ['product.jpg', 'scene.jpg'], 'aspect_ratio': '1:1', }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('product.jpg', inputs['product.jpg'], 'image/jpeg')), ('input', ('scene.jpg', inputs['scene.jpg'], 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('composed.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl Repeat `-F input=@` once per image. `curl` uses each file's basename as the multipart filename, so the `images` array in `job.json` should reference those basenames. ```bash set -euo pipefail for name in product scene; do if [[ ! -f $name.jpg ]]; then curl -Lo $name.jpg "https://docs.prodia.com/multi-input-$name.jpg" fi done cat < job.json { "type": "inference.nano-banana.img2img.v2", "config": { "prompt": "Place the white ceramic mug from the first image onto the wooden table in the second image. Match the warm morning lighting and the shallow depth of field of the kitchen scene. Keep the mug's matte finish and proportions exactly the same.", "images": ["product.jpg", "scene.jpg"], "aspect_ratio": "1:1" } } EOF curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@product.jpg \ -F input=@scene.jpg \ --output composed.jpg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open composed.jpg ``` ### Linux ```bash xdg-open composed.jpg ``` ### Windows ```bash start composed.jpg ``` The mug is placed on the wooden table with the warm window light wrapping around it, and the depth of field from the kitchen scene is preserved: ![multi-input-output-nano-banana.jpg](https://docs.prodia.com/llms/assets/11dac47aef18-multi-input-output-nano-banana.jpg) ### Compose with FLUX.2 \[flex] The same shape works with [`inference.flux-2.flex.img2img.v1`](https://docs.prodia.com/job-types/inference-flux-2-flex-img2img-v1/), which accepts up to 10 input images and exposes `width`, `height`, `steps`, and `guidance` knobs. Only two things change from the Nano Banana request: the `type` and the FLUX-specific config fields. ### prodia-js ```javascript const job = await prodia.job({ type: "inference.flux-2.flex.img2img.v1", config: { prompt: "Place the white ceramic mug from the first image onto the wooden kitchen table in the second image. Match the warm morning lighting, scale the mug realistically for a kitchen table, and preserve the matte finish. Photorealistic.", images: ["product.jpg", "scene.jpg"], width: 1024, height: 1024, steps: 50, }, }, { inputs: [product, scene], }); ``` ### requests ```python job = { 'type': 'inference.flux-2.flex.img2img.v1', 'config': { 'prompt': "Place the white ceramic mug from the first image onto the wooden kitchen table in the second image. Match the warm morning lighting, scale the mug realistically for a kitchen table, and preserve the matte finish. Photorealistic.", 'images': ['product.jpg', 'scene.jpg'], 'width': 1024, 'height': 1024, 'steps': 50, }, } ``` ### curl ```bash cat < job.json { "type": "inference.flux-2.flex.img2img.v1", "config": { "prompt": "Place the white ceramic mug from the first image onto the wooden kitchen table in the second image. Match the warm morning lighting, scale the mug realistically for a kitchen table, and preserve the matte finish. Photorealistic.", "images": ["product.jpg", "scene.jpg"], "width": 1024, "height": 1024, "steps": 50 } } EOF ``` FLUX.2 \[flex] returns a similar composite — the diffusion path adds slightly more variance to the mug's silhouette but resolves the lighting on the wood with sharper highlights: ![multi-input-output-flux-2.jpg](https://docs.prodia.com/llms/assets/6bde2083724f-multi-input-output-flux-2.jpg) ### Models that support multiple inputs | Job type | Max inputs | Notes | | --------------------------------------------------------------------------------------------------------------------- | ---------: | -------------------------------------------------------- | | [`inference.nano-banana.img2img.v2`](https://docs.prodia.com/job-types/inference-nano-banana-img2img-v2/) | 3 | Flat-rate, \~8s, natural-language editing | | [`inference.gemini-3-pro.img2img.v1`](https://docs.prodia.com/job-types/inference-gemini-3-pro-img2img-v1/) | 3 | Up to 4K resolution, \~12s | | [`inference.gemini-3-1-flash.img2img.v1`](https://docs.prodia.com/job-types/inference-gemini-3-1-flash-img2img-v1/) | 14 | Cheaper Gemini variant, optional Google Search grounding | | [`inference.flux-2.dev.img2img.v1`](https://docs.prodia.com/job-types/inference-flux-2-dev-img2img-v1/) | 8 | Open-weight variant with style presets | | [`inference.flux-2.pro.img2img.v1`](https://docs.prodia.com/job-types/inference-flux-2-pro-img2img-v1/) | 8 | Up to 4096px, 9MP combined input limit | | [`inference.flux-2.flex.img2img.v1`](https://docs.prodia.com/job-types/inference-flux-2-flex-img2img-v1/) | 10 | Highest input count in the FLUX.2 family | | [`inference.flux-2.max.img2img.v1`](https://docs.prodia.com/job-types/inference-flux-2-max-img2img-v1/) | 8 | Highest single-image quality at up to 2048px | | [`inference.seedream-5-0.lite.img2img.v1`](https://docs.prodia.com/job-types/inference-seedream-5-0-lite-img2img-v1/) | 14 | Multi-image blending | Single-input editing models — FLUX.1 Kontext, SDXL inpainting, Recraft V4, and the SeedEdit/Seedance img2img endpoints — accept only one `input` part. Sending more than one will be rejected at validation. ### Prompting tips for multi-image jobs - *Anchor each input by position.* Models read the `images` array in order. Phrase your prompt as *"the \ from the first image, on the \ in the second image"* rather than naming files - *Describe the relationship, not each image.* The model already sees both — what it needs from you is what to do with them ("place onto", "match the lighting of", "blend the styles of") - *Be explicit about what to preserve.* Phrases like *"keep the matte finish exactly the same"* reduce drift on the subject you care about - *Match aspect ratios deliberately.* Nano Banana defaults to `auto` (the first input's aspect ratio); FLUX.2 takes explicit `width` and `height`. Choose the framing the **scene** image was shot for — your subject will be re-composed into it ### Common errors - **`filename 'X' not found in request`** — the filename in `config.images` does not match any `input` part. With the JS SDK, `Uint8Array` and `Blob` inputs are sent as `image.jpg` regardless of the variable name; use a `File` object with the desired name (as shown above) when the config references specific filenames - **`config: too many images`** — exceeded the per-model input limit (see the table above) - **`413 Payload Too Large`** — total upload exceeded the per-model size limit (FLUX.2 Pro caps the combined inputs at 9MP, for example). Resize inputs before sending ### See also [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Single-input img2img with FLUX.2 \[klein]. [Generating Product Shots with Transparent Backgrounds](https://docs.prodia.com/workflows/generating-product-shots-with-transparent-backgrounds/) — A workflow that composes a generated product onto a removed-background plate. [Nano Banana](https://docs.prodia.com/models/nano-banana/) — Reference for Google's Nano Banana editing model. [FLUX.2](https://docs.prodia.com/models/flux-2/) — Reference for the FLUX.2 family — Dev, Pro, Flex, and Max. --- # Removing Backgrounds Source: https://docs.prodia.com/guides/removing-backgrounds/ We're going to walk through how to take an input image, create a mask for the background, and use it to remove the background leaving just the foreground. We'll be using one of our cute puppies-in-the-clouds gens as our input image: ![input.jpg](https://docs.prodia.com/llms/assets/77d2e1b0eff3-flux-styles-output.jpg) Once we are finished we'll have removed the clouds and we be left with just cute puppies. ### Project Setup ```bash # Create a project directory. mkdir prodia-removing-backgrounds cd prodia-removing-backgrounds ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Get a mask for the background pixels ### prodia-js ```bash npm install sharp --save ``` ```javascript const { createProdia } = require("prodia/v2"); const sharp = require("sharp"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/flux-styles-output.jpg")).arrayBuffer(); await sharp(inputBuffer).toFile("flux-styles-output.jpg"); // run a flux schnell generation const job = await prodia.job({ type: "inference.mask-background.v1", }, { inputs: [ inputBuffer ] }); const maskBuffer = await job.arrayBuffer(); await sharp(maskBuffer).toFile("mask.png"); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('flux-styles-output.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/flux-styles-output.jpg') input_image = BytesIO(res.content) with open('flux-styles-output.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/png', } job = { 'type': 'inference.mask-background.v1', } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('flux-styles-output.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('mask.png', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.mask-background.v1" } EOF if [[ ! -f flux-styles-output.jpg ]]; then curl -Lo flux-styles-output.jpg 'https://docs.prodia.com/flux-styles-output.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/png' \ -F job=@job.json \ -F input=@flux-styles-output.jpg \ --output mask.png \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open mask.png ``` ### Linux ```bash xdg-open mask.png ``` ### Windows ```bash start mask.png ``` ![mask.png](https://docs.prodia.com/llms/assets/c12ee6aeec61-mask.png) ### Selecting the foreground ### prodia-js ```bash npm install sharp --save ``` ```javascript const { createProdia } = require("prodia/v2"); const sharp = require("sharp"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/flux-styles-output.jpg")).arrayBuffer(); await sharp(inputBuffer).toFile("flux-styles-output.jpg"); // run a flux schnell generation const job = await prodia.job({ type: "inference.mask-background.v1", }, { inputs: [ inputBuffer ] }); const maskBuffer = await job.arrayBuffer(); await sharp(maskBuffer).toFile("mask.png"); let foregroundImage = await sharp(inputBuffer).ensureAlpha().joinChannel(maskBuffer); await foregroundImage.toFile("foreground.png"); })(); ``` ```bash node main.js ``` ### requests ```bash pip install pillow ``` ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO from PIL import Image import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('flux-styles-output.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/flux-styles-output.jpg') input_image = BytesIO(res.content) with open('flux-styles-output.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/png', } job = { 'type': 'inference.mask-background.v1', } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('flux-styles-output.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('mask.png', 'wb') as f: f.write(res.content) mask = Image.open(BytesIO(res.content)) image = Image.open(input_image) image.putalpha(mask) image.save('foreground.png') ``` ```bash python main.py ``` ### curl ```bash apt install imagemagick ``` ```bash set -euo pipefail cat < job.json { "type": "inference.mask-background.v1" } EOF if [[ ! -f flux-styles-output.jpg ]]; then curl -Lo flux-styles-output.jpg 'https://docs.prodia.com/flux-styles-output.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/png' \ -F job=@job.json \ -F input=@flux-styles-output.jpg \ --output mask.png \ https://inference.prodia.com/v2/job magick flux-styles-output.jpg mask.png -alpha Off -compose CopyOpacity -composite foreground.png ``` ```bash bash main.sh ``` ### macOS ```bash open foreground.png ``` ### Linux ```bash xdg-open foreground.png ``` ### Windows ```bash start foreground.png ``` ![foreground.png](https://docs.prodia.com/llms/assets/8fcc759f706d-foreground.png) --- # Generating Videos Source: https://docs.prodia.com/guides/generating-videos/ This guide uses Veo Fast for text-to-video and Seedance for image-to-video. You can swap the job type to use any of these video generation models: - [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) — `inference.wan2-2.lightning.txt2vid.v0` and `img2vid` (fast, \~22s) - [Wan 2.7](https://docs.prodia.com/models/wan-2-7/) — `inference.wan2-7.txt2vid.v1` and more (1080p, up to 15s, audio-driven) - [Veo](https://docs.prodia.com/models/veo/) — `inference.veo.fast.txt2vid.v2` and more (with audio generation) - [Kling](https://docs.prodia.com/models/kling/) — `inference.kling.txt2vid.v1` (camera control, motion masks) - [Seedance](https://docs.prodia.com/models/seedance/) — `inference.seedance.proturbo.txt2vid.v1` and `img2vid` (1080p, \~45s, async-only) ### Project Setup ```bash # Create a project directory. mkdir prodia-video-generation cd prodia-video-generation ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### With a Prompt ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { const job = await prodia.job({ type: "inference.veo.fast.txt2vid.v1", config: { prompt: "A sweeping mountain landscape at sunrise, captured from a high-angle perspective using a wide-angle lens. The early morning light casts long shadows across the rugged terrain, with mist rolling over the valleys. The scene features sharp detail in the rocks, lush greenery, and clouds forming over distant peaks. Warm oranges and pinks dominate the sky, creating a dramatic and serene atmosphere. High dynamic range (HDR) captures the subtle transitions between light and shadow.", }, }); const video = await job.arrayBuffer(); await fs.writeFile("landscape.mp4", new Uint8Array(video)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'video/mp4', } job = { 'type': 'inference.veo.fast.txt2vid.v1', 'config': { 'prompt': 'A sweeping mountain landscape at sunrise, captured from a high-angle perspective using a wide-angle lens. The early morning light casts long shadows across the rugged terrain, with mist rolling over the valleys. The scene features sharp detail in the rocks, lush greenery, and clouds forming over distant peaks. Warm oranges and pinks dominate the sky, creating a dramatic and serene atmosphere. High dynamic range (HDR) captures the subtle transitions between light and shadow.', }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('landscape.mp4', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat < { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/strike-a-pose.jpg")).arrayBuffer(); const job = await prodia.job({ type: "inference.veo.fast.img2vid.v1", config: { prompt: "Walking down the street.", }, }, { inputs: [ inputBuffer ] }); const video = await job.arrayBuffer(); await fs.writeFile("walking.mp4", new Uint8Array(video)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('strike-a-pose.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/strike-a-pose.jpg') input_image = BytesIO(res.content) with open('strike-a-pose.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'video/mp4', } job = { 'type': 'inference.veo.fast.img2vid.v1', 'config': { 'prompt': 'Walking down the street.', }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('strike-a-pose.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('walking.mp4', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.veo.fast.img2vid.v1", "config": { "prompt": "Walking down the street." } } EOF if [[ ! -f strike-a-pose.jpg ]]; then curl -Lo strike-a-pose.jpg 'https://docs.prodia.com/strike-a-pose.jpg' fi curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: video/mp4' \ -F job=@job.json \ -F input=@strike-a-pose.jpg \ --output walking.mp4 \ --retry 3 \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open walking.mp4 ``` ### Linux ```bash xdg-open walking.mp4 ``` ### Windows ```bash start walking.mp4 ``` ### With Audio Veo can generate a synchronized audio track alongside the video — water, footsteps, ambient sound, dialogue with lip sync — in a single job. Set `generate_audio: true` and describe the soundscape in your prompt. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { const job = await prodia.job({ type: "inference.veo.fast.txt2vid.v2", config: { prompt: "A wooden water mill in a forest stream, water splashing on the wheel, leaves rustling, peaceful afternoon, cinematic HDR", negative_prompt: "low quality, blurry, watermark", resolution: "720p", aspect_ratio: "16:9", duration_seconds: 4, generate_audio: true, }, }); const video = await job.arrayBuffer(); await fs.writeFile("watermill.mp4", new Uint8Array(video)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'video/mp4', } job = { 'type': 'inference.veo.fast.txt2vid.v2', 'config': { 'prompt': 'A wooden water mill in a forest stream, water splashing on the wheel, leaves rustling, peaceful afternoon, cinematic HDR', 'negative_prompt': 'low quality, blurry, watermark', 'resolution': '720p', 'aspect_ratio': '16:9', 'duration_seconds': 4, 'generate_audio': True, }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('watermill.mp4', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat < tip: > > Audio quality follows the prompt. Mention specific sounds you want > ("water splashing", "birds chirping", "footsteps on gravel") rather than relying > on the model to infer them. For dialogue, put the spoken line in quotes. --- # Restoring Faces Source: https://docs.prodia.com/guides/restoring-faces/ We're going to walk through how to take a low-quality face image and restore it using the face restoration endpoint. We'll also show how to upscale the image at the same time. We'll be using a small, degraded portrait as our input image: ![facerestore-input.jpg](https://docs.prodia.com/llms/assets/8b7a295861f5-facerestore-input.jpg) ### Project Setup ```bash # Create a project directory. mkdir prodia-restoring-faces cd prodia-restoring-faces ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Restore a face ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/facerestore-input.jpg")).arrayBuffer(); const job = await prodia.job({ type: "inference.facerestore.v1", }, { inputs: [ inputBuffer ] }); const image = await job.arrayBuffer(); await fs.writeFile("restored.jpg", new Uint8Array(image)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('facerestore-input.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/facerestore-input.jpg') input_image = BytesIO(res.content) with open('facerestore-input.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.facerestore.v1', } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('facerestore-input.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('restored.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.facerestore.v1" } EOF if [[ ! -f facerestore-input.jpg ]]; then curl -Lo facerestore-input.jpg 'https://docs.prodia.com/facerestore-input.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@facerestore-input.jpg \ --output restored.jpg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open restored.jpg ``` ### Linux ```bash xdg-open restored.jpg ``` ### Windows ```bash start restored.jpg ``` The restored face has sharper features and clearer details compared to the input: ![facerestore-output.jpg](https://docs.prodia.com/llms/assets/61961f641df6-facerestore-output.jpg) ### Restore and upscale The `facerestore.upscale` endpoint combines face restoration with upscaling. You can upscale by 2x, 4x, or 8x. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/facerestore-input.jpg")).arrayBuffer(); const job = await prodia.job({ type: "inference.facerestore.upscale.v1", config: { upscale: 4, }, }, { inputs: [ inputBuffer ] }); const image = await job.arrayBuffer(); await fs.writeFile("restored-upscaled.jpg", new Uint8Array(image)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('facerestore-input.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/facerestore-input.jpg') input_image = BytesIO(res.content) with open('facerestore-input.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.facerestore.upscale.v1', 'config': { 'upscale': 4, }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('facerestore-input.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('restored-upscaled.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.facerestore.upscale.v1", "config": { "upscale": 4 } } EOF if [[ ! -f facerestore-input.jpg ]]; then curl -Lo facerestore-input.jpg 'https://docs.prodia.com/facerestore-input.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@facerestore-input.jpg \ --output restored-upscaled.jpg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open restored-upscaled.jpg ``` ### Linux ```bash xdg-open restored-upscaled.jpg ``` ### Windows ```bash start restored-upscaled.jpg ``` Our 128x128 input has been restored and upscaled to 512x512 with dramatically improved facial detail: ![facerestore-upscale-output.jpg](https://docs.prodia.com/llms/assets/94964dcf0924-facerestore-upscale-output.jpg) ### Parameters | Parameter | Type | Values | Default | Description | | --------- | ------ | ------- | ------- | -------------------------------------------------- | | `upscale` | number | 2, 4, 8 | 2 | Upscale factor (only for `facerestore.upscale.v1`) | ### Input requirements | Constraint | Value | | ------------------ | --------------- | | Accepted formats | PNG, JPEG, WebP | | Minimum dimensions | 128 x 128 | | Maximum dimensions | 2048 x 2048 | | Maximum file size | 10 MB | --- # Segmenting Images Source: https://docs.prodia.com/guides/segmenting-images/ The segmentation endpoint uses Meta's Segment Anything models to detect and segment objects in an image. Unlike background removal which returns a single mask, segmentation returns multiple masks - one for each distinct object or region detected. Two models are available: - **[SAM 2](https://ai.meta.com/sam2/)** (`inference.segment.v1`, also `inference.sam2.segment.v1`) — Automatic segmentation. Detects and masks all objects in the image without any prompt. Best for extracting every distinct region. - **[SAM 3](https://ai.meta.com/sam2/)** (`inference.segment.v2`, also `inference.sam3.segment.v1`) — Text-prompted segmentation. Describe what you want to segment in natural language, and only matching objects are returned. Best when you know what you're looking for. This is useful for: - Extracting individual objects from complex scenes - Creating object-level masks for further processing - Targeting specific objects by description (SAM 3) - Analyzing image composition ### Automatic segmentation (SAM 2) SAM 2 automatically detects and segments all objects in an image — no prompt needed. ```javascript title="main.js" import fs from "node:fs/promises"; import { createProdia } from "prodia/v2"; const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); // First generate an image to segment console.log("Generating image..."); const imageJob = await prodia.job({ type: "inference.flux-fast.schnell.txt2img.v1", config: { prompt: "a cute robot cat on a colorful background", resolution: "1024x1024", }, }); const imageBuffer = await imageJob.arrayBuffer(); await fs.writeFile("input.jpg", new Uint8Array(imageBuffer)); console.log("Saved input.jpg"); // Now segment it using SAM 2 console.log("Segmenting image..."); const segmentJob = await prodia.job( { type: "inference.segment.v1" }, { accept: "multipart/form-data", inputs: [new Uint8Array(imageBuffer)] } ); // Get all mask outputs const formData = await segmentJob.formData(); const masks = formData.getAll("output"); for (const [i, mask] of masks.entries()) { const buffer = await mask.arrayBuffer(); await fs.writeFile(`mask_${i}.png`, new Uint8Array(buffer)); } console.log(`Saved ${masks.length} mask files`); ``` ```bash node main.js ``` ### Text-prompted segmentation (SAM 3) SAM 3 lets you describe what to segment using a text prompt. Only objects matching the description are returned. ```javascript title="main.js" import fs from "node:fs/promises"; import { createProdia } from "prodia/v2"; const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); // Load an image to segment const imageBuffer = await fs.readFile("input.jpg"); // Segment only the robot cat using SAM 3 console.log("Segmenting with prompt..."); const segmentJob = await prodia.job( { type: "inference.segment.v2", config: { prompt: "robot cat", confidence_threshold: 0.5, }, }, { accept: "multipart/form-data", inputs: [new Uint8Array(imageBuffer)] } ); const formData = await segmentJob.formData(); const masks = formData.getAll("output"); for (const [i, mask] of masks.entries()) { const buffer = await mask.arrayBuffer(); await fs.writeFile(`mask_${i}.png`, new Uint8Array(buffer)); } console.log(`Saved ${masks.length} mask files`); ``` ```bash node main.js ``` #### SAM 3 parameters | Parameter | Type | Default | Description | | ---------------------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------ | | `prompt` | string | *(required)* | Text describing what to segment (1–500 characters) | | `confidence_threshold` | number | `0.5` | Confidence threshold (0.0–1.0). Lower values return more masks, higher values only return high-confidence matches. | ### Understanding the output The segmentation endpoint returns a multipart response containing multiple PNG mask images. Each mask corresponds to a distinct object or region detected in the image: - **White pixels** (255) indicate the segmented object - **Black pixels** (0) indicate everything else For SAM 2, the number of masks varies based on image complexity. For SAM 3, masks correspond to objects matching your text prompt. ### Input requirements | Constraint | SAM 2 | SAM 3 | | ------------------ | --------------- | --------------- | | Accepted formats | PNG, JPEG, WebP | PNG, JPEG, WebP | | Minimum dimensions | 256 x 256 | 256 x 256 | | Maximum dimensions | 2048 x 2048 | 4096 x 4096 | | Maximum file size | 10 MB | 10 MB | --- # Segmenting Videos Source: https://docs.prodia.com/guides/segmenting-videos/ The video segmentation endpoint uses Meta's [SAM 3 Video Predictor](https://ai.meta.com/sam2/) to detect and track objects across an mp4. You provide a single text prompt describing what to segment — SAM 3 finds matching objects in the first frame and tracks them forwards and backwards through the video. The output is a single mp4 with the same resolution and fps as the input. The job type is `inference.sam3.segment.video.v1`. This is useful for: - Creating per-frame object masks for VFX or rotoscoping - Tracking subjects across a clip without manual keyframing - Generating overlays that visualize what a model is "seeing" in a video The examples below use a sample reef clip hosted at [docs.prodia.com/fish.mp4](https://docs.prodia.com/fish.mp4). Swap in your own mp4 by changing the input path. ### Mask mode (default) The default `mask` mode returns a black-and-white mp4 — white pixels mark any frame region covered by a detected object, everything else is black. ```javascript title="main.js" import fs from "node:fs/promises"; import { createProdia } from "prodia/v2"; const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); const inputBuffer = await (await fetch("https://docs.prodia.com/fish.mp4")).arrayBuffer(); console.log("Segmenting video..."); const job = await prodia.job( { type: "inference.sam3.segment.video.v1", config: { prompt: "fish", }, }, { accept: "video/mp4", inputs: [new Uint8Array(inputBuffer)] } ); const video = await job.arrayBuffer(); await fs.writeFile("mask.mp4", new Uint8Array(video)); console.log("Saved mask.mp4"); ``` ```bash node main.js ``` ### Overlay mode `overlay` mode composites the colored masks, bounding boxes, and `id=, p=` labels from the SAM 3 visualization over the original video. This matches the SAM 3 README example output and is useful for previewing what the model detected. ```javascript title="main.js" import fs from "node:fs/promises"; import { createProdia } from "prodia/v2"; const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); const inputBuffer = await (await fetch("https://docs.prodia.com/fish.mp4")).arrayBuffer(); const job = await prodia.job( { type: "inference.sam3.segment.video.v1", config: { prompt: "fish", mode: "overlay", alpha: 0.5, }, }, { accept: "video/mp4", inputs: [new Uint8Array(inputBuffer)] } ); const video = await job.arrayBuffer(); await fs.writeFile("overlay.mp4", new Uint8Array(video)); ``` ```bash node main.js ``` ### Filtering low-confidence detections Raise `confidence_threshold` to suppress weakly-matched objects. SAM 3 attaches a per-object score to every detection; objects below the threshold are dropped before the mask is merged or rendered. ```javascript title="main.js" const job = await prodia.job( { type: "inference.sam3.segment.video.v1", config: { prompt: "fish", confidence_threshold: 0.9, }, }, { accept: "video/mp4", inputs: [new Uint8Array(inputBuffer)] } ); ``` ### Parameters | Parameter | Type | Default | Description | | ---------------------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | *(required)* | Text describing what to segment and track across the video (1–500 characters). | | `confidence_threshold` | number | `0.5` | Minimum SAM 3 score an object must reach to be kept (0.0–1.0). Lower values keep more detections. | | `mode` | enum | `mask` | `mask` returns a merged black-and-white mp4. `overlay` returns the colored SAM 3 visualization composited over the input. | | `alpha` | number | `0.5` | Mask alpha used when `mode` is `overlay`. Ignored otherwise (0.0–1.0). | ### Input requirements | Constraint | Value | | ----------------- | ----------------- | | Accepted formats | MP4 (`video/mp4`) | | Maximum file size | 100 MB | Input resolution and fps are preserved on the output. Common sizes (832×480, 1280×720) are warmed into the torch.compile cache on bootstrap, so they encode the fastest. --- # Classifying Images Source: https://docs.prodia.com/guides/classifying-images/ The image classification endpoint runs a Vision Transformer over an input image and returns a set of labels with confidence scores. The recommended model is [Freepik/nsfw\_image\_detector](https://huggingface.co/Freepik/nsfw_image_detector), an EVA-02 based classifier that produces a four-bucket severity breakdown — far more useful for tunable moderation than a single `normal` / `nsfw` flag. The model returns probabilities across four labels that sum to `1.0`: | Label | Meaning | | --------- | ------------------------ | | `neutral` | Safe — no NSFW content | | `low` | Mildly suggestive | | `medium` | Suggestive or borderline | | `high` | Explicit | Two endpoints are exposed: - **`inference.vit.img2label.v1`** — returns a single JSON document. Labels are embedded under `config.labels` on the returned job. - **`inference.vit.img2label.v2`** — returns a multipart response containing `labels.json` *and* the original input image. Useful when chaining classification into a wider workflow that also needs the image bytes downstream. ### Project Setup ```bash # Create a project directory. mkdir prodia-classifying-images cd prodia-classifying-images ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Classify an image Pass the input image and request `Freepik/nsfw_image_detector`. The response contains a `labels` object with one score per severity bucket. ### prodia-js ```javascript title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/sunny-day.jpg")).arrayBuffer(); const { job } = await prodia.job({ type: "inference.vit.img2label.v1", config: { model: "Freepik/nsfw_image_detector", }, }, { inputs: [ inputBuffer ], }); console.log(job.config.labels); // => { neutral: 0.9995, high: 0.00038, low: 0.000087, medium: 0.000056 } })(); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('sunny-day.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/sunny-day.jpg') input_image = res.content with open('sunny-day.jpg', 'wb') as f: f.write(res.content) headers = { 'Accept': 'application/json', } job = { 'type': 'inference.vit.img2label.v1', 'config': { 'model': 'Freepik/nsfw_image_detector', }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('sunny-day.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) labels = res.json()['config']['labels'] print(labels) # => {'neutral': 0.9995, 'high': 0.00038, 'low': 8.7e-05, 'medium': 5.6e-05} ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail cat < job.json { "type": "inference.vit.img2label.v1", "config": { "model": "Freepik/nsfw_image_detector" } } EOF if [[ ! -f sunny-day.jpg ]]; then curl -Lo sunny-day.jpg 'https://docs.prodia.com/sunny-day.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: application/json' \ -F "job=@job.json;type=application/json" \ -F "input=@sunny-day.jpg;type=image/jpeg" \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` The full response looks like this: ```json { "type": "inference.vit.img2label.v1", "id": "65a10fac-b90f-40a8-8f5c-e41dbfbb4991", "state": { "current": "completed" }, "config": { "model": "Freepik/nsfw_image_detector", "labels": { "neutral": 0.9994731545448303, "high": 0.0003829085035249591, "low": 0.00008746454113861546, "medium": 0.00005647135549224913 } }, "metrics": { "elapsed": 0.16 } } ``` ### Choosing a threshold The four scores sum to `1.0` and represent the model's belief that the image *primarily belongs to* that severity bucket. To turn them into an allow/block decision, the [Freepik model card](https://huggingface.co/Freepik/nsfw_image_detector) recommends a *cumulative* scheme: pick the lowest severity you want to flag, sum that bucket and all higher ones, then compare against a threshold (typically `0.5`). | Policy | Score formula | Use case | | ------------------------------------ | ------------------------------ | ---------------------------------------------------------- | | Strict — block only explicit | `P(high)` | Permissive platforms; reject only the most extreme content | | Moderate — block suggestive and up | `P(medium) + P(high)` | General audiences; common default | | Lenient — block anything non-neutral | `P(low) + P(medium) + P(high)` | Family-safe / under-13 surfaces | The closer the threshold is to `0`, the more aggressively borderline images are flagged (more false positives). The closer to `1`, the more permissive (more false negatives). A minimal moderate-policy check looks like this: ```javascript const { neutral, low, medium, high } = job.config.labels; const flagged = (medium + high) > 0.5; ``` ### Keep the image alongside the labels (v2) If you want both the labels *and* a pass-through copy of the original image in a single response — for example, to pipe straight into a downstream job in a workflow — use the `v2` endpoint. It returns a multipart body containing `labels.json` followed by the original image bytes. ### prodia-js ```javascript title="main.js" const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { const inputBuffer = await (await fetch("https://docs.prodia.com/sunny-day.jpg")).arrayBuffer(); const result = await prodia.job({ type: "inference.vit.img2label.v2", config: { model: "Freepik/nsfw_image_detector" }, }, { accept: "multipart/form-data", inputs: [ inputBuffer ], }); const form = await result.formData(); const outputs = form.getAll("output"); // outputs[0] is labels.json, outputs[1] is the original image const labels = JSON.parse(await outputs[0].text()); console.log(labels); const imageBuffer = await outputs[1].arrayBuffer(); await fs.writeFile("passthrough.jpg", new Uint8Array(imageBuffer)); })(); ``` ```bash node main.js ``` ### requests ```bash pip install requests-toolbelt ``` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry from requests_toolbelt.multipart import decoder from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) with open('sunny-day.jpg', 'rb') as f: input_image = f.read() job = { 'type': 'inference.vit.img2label.v2', 'config': {'model': 'Freepik/nsfw_image_detector'}, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('sunny-day.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers={'Accept': 'multipart/form-data'}, files=files) if res.status_code != 200: print(res.text); sys.exit(1) multipart = decoder.MultipartDecoder.from_response(res) for part in multipart.parts: disposition = part.headers[b'Content-Disposition'].decode() if 'filename="labels.json"' in disposition: labels = json.loads(part.content) print(labels) elif 'filename="sunny-day.jpg"' in disposition: with open('passthrough.jpg', 'wb') as f: f.write(part.content) ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail cat < job.json { "type": "inference.vit.img2label.v2", "config": { "model": "Freepik/nsfw_image_detector" } } EOF curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: multipart/form-data' \ -F "job=@job.json;type=application/json" \ -F "input=@sunny-day.jpg;type=image/jpeg" \ --output response.bin \ https://inference.prodia.com/v2/job # response.bin is a multipart body containing job.json, labels.json, and the image. ``` ```bash bash main.sh ``` ### Input requirements | Constraint | Value | | ------------------ | --------------- | | Accepted formats | PNG, JPEG, WebP | | Minimum dimensions | 128 x 128 | | Maximum dimensions | 2048 x 2048 | | Maximum file size | 10 MB | ### Guides [Generating Images with Moderation](https://docs.prodia.com/workflows/generating-images-with-moderation/) — Chain text-to-image generation with a classification gate. [Polling Async Jobs](https://docs.prodia.com/guides/polling-async-jobs/) — Use the async API for long-running pipelines. --- # Upscaling Images Source: https://docs.prodia.com/guides/upscaling-images/ We're going to walk through how to take a small, low-resolution image and upscale it to a higher resolution using the upscale endpoint. This is useful for sharpening generated thumbnails, restoring detail in old photos, or producing print-ready assets. We'll be using a 384x384 lighthouse photo as our input image: ![upscale-input.jpg](https://docs.prodia.com/llms/assets/72db300e60c6-upscale-input.jpg) ### Project Setup ```bash # Create a project directory. mkdir prodia-upscaling-images cd prodia-upscaling-images ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Upscale 2x The upscale endpoint accepts a single image and returns a larger version of it. The `upscale` config field controls the factor — `2`, `4`, or `8`. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/upscale-input.jpg")).arrayBuffer(); const job = await prodia.job({ type: "inference.upscale.v1", config: { upscale: 2, }, }, { inputs: [ inputBuffer ] }); const image = await job.arrayBuffer(); await fs.writeFile("upscaled.jpg", new Uint8Array(image)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('upscale-input.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/upscale-input.jpg') input_image = res.content with open('upscale-input.jpg', 'wb') as f: f.write(res.content) headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.upscale.v1', 'config': { 'upscale': 2, }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('upscale-input.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('upscaled.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.upscale.v1", "config": { "upscale": 2 } } EOF if [[ ! -f upscale-input.jpg ]]; then curl -Lo upscale-input.jpg 'https://docs.prodia.com/upscale-input.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@upscale-input.jpg \ --output upscaled.jpg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open upscaled.jpg ``` ### Linux ```bash xdg-open upscaled.jpg ``` ### Windows ```bash start upscaled.jpg ``` The 384x384 input is now a sharp 768x768 image. Edges around the lighthouse and rocks have crisper detail and the JPEG compression artifacts in the sky are gone: ![upscale-output.jpg](https://docs.prodia.com/llms/assets/071415d07f00-upscale-output.jpg) ### Upscale 4x For larger outputs, set `upscale` to `4` or `8`. The endpoint returns the same dimensions multiplied by the chosen factor — for our 384x384 input, `upscale: 4` produces a 1536x1536 image. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { // get input image const inputBuffer = await (await fetch("https://docs.prodia.com/upscale-input.jpg")).arrayBuffer(); const job = await prodia.job({ type: "inference.upscale.v1", config: { upscale: 4, }, }, { inputs: [ inputBuffer ] }); const image = await job.arrayBuffer(); await fs.writeFile("upscaled-4x.jpg", new Uint8Array(image)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('upscale-input.jpg', 'rb') as f: input_image = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/upscale-input.jpg') input_image = res.content with open('upscale-input.jpg', 'wb') as f: f.write(res.content) headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.upscale.v1', 'config': { 'upscale': 4, }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('upscale-input.jpg', input_image, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('upscaled-4x.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "inference.upscale.v1", "config": { "upscale": 4 } } EOF if [[ ! -f upscale-input.jpg ]]; then curl -Lo upscale-input.jpg 'https://docs.prodia.com/upscale-input.jpg' fi curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@upscale-input.jpg \ --output upscaled-4x.jpg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open upscaled-4x.jpg ``` ### Linux ```bash xdg-open upscaled-4x.jpg ``` ### Windows ```bash start upscaled-4x.jpg ``` At 4x, the rocks gain individual texture and the clouds resolve into distinct shapes: ![upscaled-4x.jpg](https://docs.prodia.com/llms/assets/ece163bb0ef3-upscale-output-4x.jpg) ### Parameters | Parameter | Type | Values | Default | Description | | --------- | ------ | ------------- | ------- | ---------------------------------------------------------------- | | `upscale` | number | `2`, `4`, `8` | `2` | How many times larger the output should be along each dimension. | ### Picking a factor | Goal | Factor | | ----------------------------------------------------------- | ------ | | Sharpen a generated image without changing dimensions much | `2` | | Produce a print-ready or hero-banner asset from a thumbnail | `4` | | Maximum resolution for archival or large-format display | `8` | Outputs scale quadratically — an 8x upscale of a 1024x1024 input produces an 8192x8192 image (around 67 megapixels), so prefer the smallest factor that meets your needs. ### See also [Restoring Faces](https://docs.prodia.com/guides/restoring-faces/) — If your input contains faces, run face restoration first or use the combined facerestore.upscale endpoint. [Generating Images](https://docs.prodia.com/guides/generating-images/) — Generate a base image at lower resolution, then upscale to save time and cost. --- # Vectorizing Images Source: https://docs.prodia.com/guides/vectorizing-images/ Recraft V4 and V4 Pro can generate vector graphics (SVG) directly from text prompts. Unlike raster image generation which produces pixel-based output, vectorization produces infinitely scalable SVG files — perfect for logos, icons, illustrations, and print materials. ### Available models | Job Type | Resolution | ETA | | ------------------------------------- | --------------- | ----- | | `inference.recraft.v4.txt2vec.v1` | Up to 1536x768 | \~28s | | `inference.recraft.v4.pro.txt2vec.v1` | Up to 3072x1536 | \~45s | V4 Pro generates at higher resolution with more detail, but takes longer. ### Generate a vector image ### prodia-js ```javascript title="main.js" import fs from "node:fs/promises"; import { createProdia } from "prodia/v2"; const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); const job = await prodia.job({ type: "inference.recraft.v4.txt2vec.v1", config: { prompt: "a minimalist logo of a mountain range at sunset", }, }); const svg = await job.arrayBuffer(); await fs.writeFile("mountain.svg", new Uint8Array(svg)); console.log("Saved mountain.svg"); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) job = { 'type': 'inference.recraft.v4.txt2vec.v1', 'config': { 'prompt': 'a minimalist logo of a mountain range at sunset', }, } res = session.post(prodia_url, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('mountain.svg', 'wb') as f: f.write(res.content) print("Saved mountain.svg") ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail job=$(cat <` ### Example outputs **Recraft V4** (`inference.recraft.v4.txt2vec.v1`): [Recraft V4 vector output — mountain landscape](https://docs.prodia.com/recraft-v4-txt2vec-output.svg) **Recraft V4 Pro** (`inference.recraft.v4.pro.txt2vec.v1`): [Recraft V4 Pro vector output — mountain landscape](https://docs.prodia.com/recraft-v4-pro-txt2vec-output.svg) ### Size options **V4** (default: 1024x1024): `1024x1024`, `1536x768`, `768x1536`, `1280x832`, `832x1280`, `1216x896`, `896x1216`, `1152x896`, `896x1152`, `832x1344`, `1280x896`, `896x1280`, `1344x768`, `768x1344` **V4 Pro** (default: 2048x2048): `2048x2048`, `3072x1536`, `1536x3072`, `2560x1664`, `1664x2560`, `2432x1792`, `1792x2432`, `2304x1792`, `1792x2304`, `1664x2688`, `2560x1792`, `1792x2560`, `2688x1536`, `1536x2688` --- # Output Image Formats Source: https://docs.prodia.com/guides/output-image-formats/ By default `/v2/job` returns generated images as JPEG, but the `Accept` request header lets you ask for **PNG**, **WebP**, or a tuned JPEG instead — and pass extra MIME parameters to control quality and compression. The pixels stay identical (same model, same seed) so you can pick a format and quality level that fits how you store, ship, or display the result. This guide walks through the three formats end-to-end with the same prompt and seed, so you can compare file size against visual quality. ### Project Setup ```bash # Create a project directory. mkdir prodia-output-formats cd prodia-output-formats ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### JPEG (default) JPEG is the default. It's lossy and uses chroma subsampling — best for photographic generations where small file size matters more than pixel-exact fidelity. ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { const job = await prodia.job({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "a single fresh strawberry on a polished white marble countertop, soft daylight from the side, photorealistic, shallow depth of field", seed: 42, width: 1024, height: 1024, }, }, { accept: "image/jpeg" }); const image = await job.arrayBuffer(); await fs.writeFile("strawberry.jpg", new Uint8Array(image)); })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/jpeg', } job = { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'a single fresh strawberry on a polished white marble countertop, soft daylight from the side, photorealistic, shallow depth of field', 'seed': 42, 'width': 1024, 'height': 1024, }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('strawberry.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### The polling flow The async API uses four endpoints: 1. `POST /v2/job/async` — create the job, returns a job ID 2. `GET /v2/job/async/:id/job.state.current` — cheap plain-text state check (`processing`, `processed`, `failed`) 3. `GET /v2/job/async/:id/output` — list the output filenames once `processed` 4. `GET /v2/job/async/:id/output/:filename` — download an output file > note: > > Async jobs use the state `processed` (not `completed`) when successful. Outputs expire **1 hour** after the job finishes, so download promptly. ### Submit, poll, and download ### prodia-js The `prodia` SDK wraps the synchronous endpoint only, so we use `axios` directly for the async endpoints. ```bash npm install axios axios-retry --save ``` ```javascript title="main.js" const axios = require('axios'); const axiosRetry = require('axios-retry').default; const fs = require('node:fs'); async function main() { axiosRetry(axios, { retries: 3, retryCondition: (error) => { return [413, 429, 503].includes(error.response?.status); }, }); const headers = { 'Authorization': `Bearer ${process.env.PRODIA_TOKEN}`, }; // 1. Submit the job let res = await axios({ method: 'POST', url: 'https://inference.prodia.com/v2/job/async', headers, data: { type: 'inference.wan2-2.lightning.txt2vid.v0', config: { prompt: 'a golden retriever puppy running through a field of wildflowers', }, }, }); const jobId = res.data.id; let jobStatus = res.data.state.current; console.log(`Job ID: ${jobId}`); console.log(`Status: ${jobStatus}`); // 2. Poll until the job leaves `processing` while (jobStatus === 'processing') { await new Promise(resolve => setTimeout(resolve, 2000)); res = await axios({ method: 'GET', url: `https://inference.prodia.com/v2/job/async/${jobId}/job.state.current`, headers, }); jobStatus = res.data; console.log(`Status: ${jobStatus}`); } // 3. On failure, fetch the full job metadata for the error if (jobStatus !== 'processed') { res = await axios({ method: 'GET', url: `https://inference.prodia.com/v2/job/async/${jobId}/job.json`, headers, }); console.error(res.data); process.exit(1); } // 4. Download the output file res = await axios({ method: 'GET', url: `https://inference.prodia.com/v2/job/async/${jobId}/output/video.mp4`, headers, responseType: 'arraybuffer', }); fs.writeFileSync('puppy.mp4', res.data); console.log(`Saved puppy.mp4 (${res.data.byteLength} bytes)`); } main(); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys import time prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job/async' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) # 1. Submit the job job_request = { 'type': 'inference.wan2-2.lightning.txt2vid.v0', 'config': { 'prompt': 'a golden retriever puppy running through a field of wildflowers', }, } res = session.post(prodia_url, json=job_request) print(f"Request ID: {res.headers.get('x-request-id')}") print(f"Status: {res.status_code}") if res.status_code != 201: print(res.text) sys.exit(1) job = res.json() job_id = job['id'] job_status = job['state']['current'] print(f"Job ID: {job_id}") print(f"Status: {job_status}") # 2. Poll until the job leaves `processing` while job_status == 'processing': time.sleep(2) res = session.get(f"{prodia_url}/{job_id}/job.state.current") if res.status_code != 200: print(res.text) sys.exit(1) job_status = res.text print(f"Status: {job_status}") # 3. On failure, fetch the full job metadata for the error if job_status != 'processed': res = session.get(f"{prodia_url}/{job_id}/job.json") print(res.json()) sys.exit(1) # 4. Download the output file res = session.get(f"{prodia_url}/{job_id}/output/video.mp4") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppy.mp4', 'wb') as f: f.write(res.content) print(f'Saved puppy.mp4 ({len(res.content)} bytes)') ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail # 1. Submit the job job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Get the price for a single job Add `?price=true` to the request URL. The job result will include a `price` object with the billing `product` code and the `dollars` cost. The `prodia-js` SDK doesn't expose query parameters on `prodia.job(...)` directly, so we use `fetch` to read the multipart response and pull out both the price field and the image. ### prodia-js ```javascript title="main.js" const fs = require("node:fs/promises"); (async () => { const res = await fetch( "https://inference.prodia.com/v2/job?price=true", { method: "POST", headers: { Authorization: `Bearer ${process.env.PRODIA_TOKEN}`, "Content-Type": "application/json", Accept: "multipart/form-data", }, body: JSON.stringify({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "a single red apple on a white background, 4k photo", seed: 42, }, }), }, ); if (!res.ok) { console.error(`Status: ${res.status}`); console.error(await res.text()); process.exit(1); } const formData = await res.formData(); const job = JSON.parse(await formData.get("job").text()); const output = formData.get("output"); console.log(`product: ${job.price.product}`); console.log(`dollars: ${job.price.dollars}`); await fs.writeFile( "apple.jpg", new Uint8Array(await output.arrayBuffer()), ); })(); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry from requests_toolbelt.multipart import decoder import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job?price=true' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'multipart/form-data', } job = { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'a single red apple on a white background, 4k photo', 'seed': 42, }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) # Walk the multipart parts to find the JSON job result and the image output. parts = decoder.MultipartDecoder.from_response(res).parts for part in parts: disposition = part.headers.get(b'Content-Disposition', b'').decode() if 'name="job"' in disposition: result = json.loads(part.content) print(f"product: {result['price']['product']}") print(f"dollars: {result['price']['dollars']}") elif 'name="output"' in disposition: with open('apple.jpg', 'wb') as f: f.write(part.content) ``` ```bash pip install requests requests-toolbelt python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail # Capture the multipart response in a tempfile. tmp=$(mktemp) trap 'rm -f "$tmp"' EXIT curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: multipart/form-data' \ --json '{ "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "a single red apple on a white background, 4k photo", "seed": 42 } }' \ --output "$tmp" \ --retry 3 \ 'https://inference.prodia.com/v2/job?price=true' # Pull out the JSON job result and the JPEG image with awk. awk -v RS='\r\n--[a-f0-9]{60}' ' /name="job"/ { sub(/^[^{]*/, ""); print > "job.json" } /name="output"/ { sub(/^[^\xff]*/, ""); sub(/\r\n$/, ""); printf "%s", $0 > "apple.jpg" } ' "$tmp" # Print the price. python3 -c "import json; p = json.load(open('job.json'))['price']; print(f\"product: {p['product']}\"); print(f\"dollars: {p['dollars']}\")" ``` ```bash bash main.sh ``` You'll see output like: ``` product: inference-flux-schnell-large-steps-4 dollars: 0.0025 ``` The `product` is the billing line item — it's how this job will appear on your invoice and in usage exports. The `dollars` value is the exact amount charged for this single call. > tip: > > The same `?price=true` flag works on `/v2/job/async` too. The price appears on `GET /v2/job/async/:id/job.json` once the job reaches the `processed` state. See the [polling async jobs guide](https://docs.prodia.com/guides/polling-async-jobs/) for the full async flow. ### Accumulate cost across multiple jobs The `dollars` value is per-job, so totalling spend is just a sum. This snippet generates several thumbnails in a loop and prints the running total — useful when you're batching for a customer and want to charge them at the end. ### prodia-js ```javascript title="batch.js" const fs = require("node:fs/promises"); const prompts = [ "a single red apple on a white background, 4k photo", "a single yellow lemon on a white background, 4k photo", "a single green pear on a white background, 4k photo", ]; (async () => { let total = 0; for (const [i, prompt] of prompts.entries()) { const res = await fetch( "https://inference.prodia.com/v2/job?price=true", { method: "POST", headers: { Authorization: `Bearer ${process.env.PRODIA_TOKEN}`, "Content-Type": "application/json", Accept: "multipart/form-data", }, body: JSON.stringify({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt, seed: 42 }, }), }, ); if (!res.ok) { console.error(`Job ${i} failed: ${res.status}`); continue; } const formData = await res.formData(); const job = JSON.parse(await formData.get("job").text()); const output = formData.get("output"); total += job.price.dollars; console.log(`#${i} ${job.price.product} $${job.price.dollars.toFixed(4)}`); await fs.writeFile( `out-${i}.jpg`, new Uint8Array(await output.arrayBuffer()), ); } console.log(`---`); console.log(`Total: $${total.toFixed(4)}`); })(); ``` ```bash node batch.js ``` ### requests ```python title="batch.py" from requests.adapters import HTTPAdapter, Retry from requests_toolbelt.multipart import decoder import json import os import requests prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job?price=true' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) prompts = [ 'a single red apple on a white background, 4k photo', 'a single yellow lemon on a white background, 4k photo', 'a single green pear on a white background, 4k photo', ] total = 0.0 for i, prompt in enumerate(prompts): res = session.post(prodia_url, headers={'Accept': 'multipart/form-data'}, json={ 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': {'prompt': prompt, 'seed': 42}, }) if res.status_code != 200: print(f"Job {i} failed: {res.status_code}") continue parts = decoder.MultipartDecoder.from_response(res).parts for part in parts: disposition = part.headers.get(b'Content-Disposition', b'').decode() if 'name="job"' in disposition: result = json.loads(part.content) total += result['price']['dollars'] print(f"#{i} {result['price']['product']} ${result['price']['dollars']:.4f}") elif 'name="output"' in disposition: with open(f'out-{i}.jpg', 'wb') as f: f.write(part.content) print('---') print(f"Total: ${total:.4f}") ``` ```bash python batch.py ``` ### curl ```bash title="batch.sh" set -euo pipefail prompts=( "a single red apple on a white background, 4k photo" "a single yellow lemon on a white background, 4k photo" "a single green pear on a white background, 4k photo" ) total=0 for i in "${!prompts[@]}"; do tmp=$(mktemp) curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: multipart/form-data' \ --json "{\"type\":\"inference.flux-fast.schnell.txt2img.v2\",\"config\":{\"prompt\":\"${prompts[$i]}\",\"seed\":42}}" \ --output "$tmp" \ --retry 3 \ 'https://inference.prodia.com/v2/job?price=true' awk -v out="out-$i.jpg" -v RS='\r\n--[a-f0-9]{60}' ' /name="job"/ { sub(/^[^{]*/, ""); print > "job.json" } /name="output"/ { sub(/^[^\xff]*/, ""); sub(/\r\n$/, ""); printf "%s", $0 > out } ' "$tmp" dollars=$(python3 -c "import json; print(json.load(open('job.json'))['price']['dollars'])") product=$(python3 -c "import json; print(json.load(open('job.json'))['price']['product'])") echo "#$i $product \$$dollars" total=$(python3 -c "print($total + $dollars)") rm -f "$tmp" done echo "---" echo "Total: \$$total" ``` ```bash bash batch.sh ``` A typical run prints something like: ``` #0 inference-flux-schnell-large-steps-4 $0.0025 #1 inference-flux-schnell-large-steps-4 $0.0025 #2 inference-flux-schnell-large-steps-4 $0.0025 --- Total: $0.0075 ``` ### Notes - The `price` field is only present when `?price=true` is set **and** the job completes successfully. Failed jobs do not return a price. - Different `config` values can resolve to different `product` codes — for example, FLUX with 4 steps versus 28 steps, or a 720p Wan video versus 1080p — so always read `dollars` from the response rather than hard-coding it client-side. - For a deeper reference on the response shape, see the [Job Pricing reference](https://docs.prodia.com/reference/price/). [Polling Async Jobs](https://docs.prodia.com/guides/polling-async-jobs/) — Use ?price=true with the async API for long-running video jobs. --- # Introduction to Workflows Source: https://docs.prodia.com/workflows/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. > note: > > You'll need a Pro subscription in order to use Workflows. Make sure to > [upgrade](https://app.prodia.com/) your account to Pro if you haven't > already! ## Use Cases Workflows 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: ```json { "type": "workflow.serial.v1", "jobs": [ { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "A beautiful image of a cat" } } ] } ``` This job can be expanded to also do a moderation check as well: ```json { "type": "workflow.serial.v1", "jobs": [ { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "A beautiful image of a cat" } }, { "type": "workflow.moderate.v1", "config": { "threshold": 0.95 } } ] } ``` --- # Generating Images with Moderation Source: https://docs.prodia.com/workflows/generating-images-with-moderation/ ### Project Setup ```bash # Create a project directory. mkdir prodia-image-generation-with-workflows cd prodia-image-generation-with-workflows ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate an image (inside a workflow) ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }, ], }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat < { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }, { type: "workflow.moderate.v1", config: { threshold: 0.95, }, }, ], }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, }, { 'type': 'workflow.moderate.v1', 'config': { 'threshold': 0.95, }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Transform an image (inside a workflow) ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); // v2 :) const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { // get input image const sunnyDay = await (await fetch("https://docs.prodia.com/sunny-day.jpg")).arrayBuffer(); const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-2.dev.img2img.v0", config: { prompt: "rainy landscape, 4k", }, }, ], }, }, { inputs: [ sunnyDay ], }); const rainyDay = await job.arrayBuffer(); await fs.writeFile("rainy-day.jpg", new Uint8Array(rainyDay)); // open rainy-day.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('sunny-day.jpg', 'rb') as f: sunny_day = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/sunny-day.jpg') sunny_day = BytesIO(res.content) with open('sunny-day.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-2.dev.img2img.v0', 'config': { 'prompt': 'rainy landscape, 4k', }, }, ], }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('sunny-day.jpg', sunny_day, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('rainy-day.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "workflow.serial.v1", "config": { "jobs": [ { "type": "inference.flux-2.dev.img2img.v0", "config": { "prompt": "rainy landscape, 4k" } } ] } } EOF if ! [[ -f sunny-day.jpg ]]; then curl -Lo sunny-day.jpg 'https://docs.prodia.com/sunny-day.jpg' fi curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@sunny-day.jpg \ --output rainy-day.jpg \ --retry 3 \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open rainy-day.jpg ``` ### Linux ```bash xdg-open rainy-day.jpg ``` ### Windows ```bash start rainy-day.jpg ``` ### Adding content moderation ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); // v2 :) const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { // get input image const sunnyDay = await (await fetch("https://docs.prodia.com/sunny-day.jpg")).arrayBuffer(); const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "workflow.moderate.v1", config: { threshold: 0.95, }, }, { type: "inference.flux-2.dev.img2img.v0", config: { prompt: "rainy landscape, 4k", }, }, { type: "workflow.moderate.v1", config: { threshold: 0.95, }, }, ], }, }, { inputs: [ sunnyDay ], }); const rainyDay = await job.arrayBuffer(); await fs.writeFile("rainy-day.jpg", new Uint8Array(rainyDay)); // open rainy-day.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry from io import BytesIO import json import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) try: with open('sunny-day.jpg', 'rb') as f: sunny_day = f.read() except FileNotFoundError: res = requests.get('https://docs.prodia.com/sunny-day.jpg') sunny_day = BytesIO(res.content) with open('sunny-day.jpg', 'wb') as f: f.write(res.content) except Exception as e: raise e headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'workflow.moderate.v1', 'config': { 'threshold': 0.95, }, }, { 'type': 'inference.flux-2.dev.img2img.v0', 'config': { 'prompt': 'rainy landscape, 4k', }, }, { 'type': 'workflow.moderate.v1', 'config': { 'threshold': 0.95, }, }, ], }, } files = [ ('job', ('job.json', BytesIO(json.dumps(job).encode('utf-8')), 'application/json')), ('input', ('sunny-day.jpg', sunny_day, 'image/jpeg')), ] res = session.post(prodia_url, headers=headers, files=files) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('rainy-day.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail cat < job.json { "type": "workflow.serial.v1", "config": { "jobs": [ { "type": "workflow.moderate.v1", "config": { "threshold": 0.95 } }, { "type": "inference.flux-2.dev.img2img.v0", "config": { "prompt": "rainy landscape, 4k" } }, { "type": "workflow.moderate.v1", "config": { "threshold": 0.95 } } ] } } EOF if ! [[ -f sunny-day.jpg ]]; then curl -Lo sunny-day.jpg 'https://docs.prodia.com/sunny-day.jpg' fi curl -sSf \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@sunny-day.jpg \ --output rainy-day.jpg \ --retry 3 \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open rainy-day.jpg ``` ### Linux ```bash xdg-open rainy-day.jpg ``` ### Windows ```bash start rainy-day.jpg ``` --- # Generating Videos From Generated Images with Moderation Source: https://docs.prodia.com/workflows/generating-videos-from-generated-images-with-moderation/ ### Project Setup ```bash # Create a project directory. mkdir prodia-video-generation-from-generated-images cd prodia-video-generation-from-generated-images ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate an image (inside a workflow) ### prodia-js ```javascript const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }, ], }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat < { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }, { type: "workflow.moderate.v1", config: { threshold: 0.95, }, }, ], }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, }, { 'type': 'workflow.moderate.v1', 'config': { 'threshold': 0.95, }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.jpg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat < { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }, { type: "workflow.moderate.v1", config: { threshold: 0.95, }, }, { type: "inference.seedance.pro.img2vid.v1", config: { prompt: "puppies playing in the clouds", }, }, ], }, }); const video = await job.arrayBuffer(); await fs.writeFile("puppies.mp4", new Uint8Array(video)); // open puppies.mp4 })(); ``` ```bash node main.js ``` ### requests ```python from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'video/mp4', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'puppies in a cloud, 4k', }, }, { 'type': 'workflow.moderate.v1', 'config': { 'threshold': 0.95, }, }, { 'type': 'inference.seedance.pro.img2vid.v1', 'config': { 'prompt': 'puppies playing in the clouds', }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('puppies.mp4', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash set -euo pipefail job=$(cat <= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate and remove the background The chain has two jobs: a text-to-image generation, then `inference.remove-background.v1` which replaces the background with transparency. The remove-background processor returns *two* outputs — `foreground` (the transparent PNG you want) and `mask` (the binary alpha map). The Prodia SDK gives you the foreground automatically. For Python and curl, you need a multipart parser to pull `foreground` from the response — examples below. ### prodia-js ```javascript title="main.js" const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "studio product photograph of a stainless-steel coffee tumbler on a plain white seamless background, soft even lighting, centred composition", seed: 42, }, }, { type: "inference.remove-background.v1", }, ], }, }, { accept: "image/png", }); const image = await job.arrayBuffer(); await fs.writeFile("product.png", new Uint8Array(image)); // open product.png })(); ``` ```bash node main.js ``` ### requests ```bash pip install requests-toolbelt ``` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry from requests_toolbelt.multipart.decoder import MultipartDecoder import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'multipart/form-data; image/png', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'studio product photograph of a stainless-steel coffee tumbler on a plain white seamless background, soft even lighting, centred composition', 'seed': 42, }, }, { 'type': 'inference.remove-background.v1', }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) # remove-background returns two outputs (foreground + mask) — pick the foreground. for part in MultipartDecoder.from_response(res).parts: cd = part.headers[b'Content-Disposition'].decode() if 'filename="foreground"' in cd: with open('product.png', 'wb') as f: f.write(part.content) break ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail cat < job.json { "type": "workflow.serial.v1", "config": { "jobs": [ { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "studio product photograph of a stainless-steel coffee tumbler on a plain white seamless background, soft even lighting, centred composition", "seed": 42 } }, { "type": "inference.remove-background.v1" } ] } } EOF curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: multipart/form-data; image/png' \ -H 'Content-Type: application/json' \ --data-binary @job.json \ --output response.bin \ --dump-header response.headers \ https://inference.prodia.com/v2/job # remove-background returns two outputs (foreground + mask) — extract the foreground. python3 - <<'PY' import re boundary = re.search(r'boundary=(\S+)', open('response.headers').read()).group(1).strip() raw = open('response.bin', 'rb').read() for part in raw.split(('--' + boundary).encode())[1:-1]: part = part.lstrip(b'\r\n') head_end = part.find(b'\r\n\r\n') head = part[:head_end].decode() body = part[head_end+4:].rstrip(b'\r\n') if 'filename="foreground"' in head: open('product.png', 'wb').write(body) PY ``` ```bash bash main.sh ``` ### macOS ```bash open product.png ``` ### Linux ```bash xdg-open product.png ``` ### Windows ```bash start product.png ``` ### Tips - *Prompt for a clean background.* Phrases like "plain white seamless background" or "studio backdrop" give the cut-out crisper edges than busy or photographic backgrounds. - *Output is always PNG.* `inference.remove-background.v1` requires PNG output to preserve the alpha channel — JPEG would flatten it onto an opaque background. - *Need only the mask?* The chain still works if you read the `mask` part instead of `foreground` from the multipart response. See [Removing Backgrounds](https://docs.prodia.com/guides/removing-backgrounds/) for using the mask alone. --- # Generating and Vectorising Logos Source: https://docs.prodia.com/workflows/generating-and-vectorizing-logos/ This Workflow generates a raster logo with [Flux Schnell](https://docs.prodia.com/models/flux-2/) and converts it to an SVG with Recraft's image-to-vector model. The output is an infinitely scalable vector file ready for a website, app icon, or print asset — all in a single API call. | Generated raster logo | Vectorised output | | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | ![Generated raster paper-airplane logo](https://docs.prodia.com/llms/assets/a63fddb36560-workflow-vectorize-before.jpg) | [Vector paper-airplane logo](https://docs.prodia.com/workflow-vectorize-after.svg) | ### Project Setup ```bash # Create a project directory. mkdir prodia-vectorise-workflow cd prodia-vectorise-workflow ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate then vectorise (in a single workflow) The first job generates a flat, vector-friendly raster image. The second job receives that raster and converts it into an SVG. ### prodia-js ```javascript title="main.js" const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "minimalist flat logo of a paper airplane flying upward, bold geometric shapes, two-tone blue and white, plain solid background, vector-friendly silhouette", width: 1024, height: 1024, seed: 42, }, }, { type: "inference.recraft.img2vec.v1", }, ], }, }, { accept: "image/svg+xml", }); const svg = await job.arrayBuffer(); await fs.writeFile("logo.svg", new Uint8Array(svg)); // open logo.svg })(); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'image/svg+xml', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'minimalist flat logo of a paper airplane flying upward, bold geometric shapes, two-tone blue and white, plain solid background, vector-friendly silhouette', 'width': 1024, 'height': 1024, 'seed': 42, }, }, { 'type': 'inference.recraft.img2vec.v1', }, ], }, } res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('logo.svg', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail cat < job.json { "type": "workflow.serial.v1", "config": { "jobs": [ { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "minimalist flat logo of a paper airplane flying upward, bold geometric shapes, two-tone blue and white, plain solid background, vector-friendly silhouette", "width": 1024, "height": 1024, "seed": 42 } }, { "type": "inference.recraft.img2vec.v1" } ] } } EOF curl -sSf --retry 3 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/svg+xml' \ -H 'Content-Type: application/json' \ --data-binary @job.json \ --output logo.svg \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open logo.svg ``` ### Linux ```bash xdg-open logo.svg ``` ### Windows ```bash start logo.svg ``` ### Tips - *Prompt for vector-friendly raster output.* Flat, two- or three-colour designs with sharp silhouettes vectorise well. Photo-realistic or gradient-heavy images will produce SVGs with hundreds of paths and won't look like a logo. - *Native vector generation.* If you don't need to start from a raster, [Recraft V4](https://docs.prodia.com/models/recraft-v4/) supports `inference.recraft.v4.txt2vec.v1` and `inference.recraft.v4.pro.txt2vec.v1` which generate SVGs directly from a prompt — see [Vectorising Images](https://docs.prodia.com/guides/vectorizing-images/). --- # Generating a Hero Frame then Animating It Source: https://docs.prodia.com/workflows/generating-a-hero-frame-then-animating-it/ Image-to-video models follow a starting frame more faithfully than text-to-video models follow a long prompt — you get more control over the look of the scene. This Workflow generates a hero frame with [Flux Schnell](https://docs.prodia.com/models/flux-2/), then feeds it directly into [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) image-to-video, all in a single API call. | Generated hero frame | Animated 5-second clip | | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | | ![Hero frame: tropical beach at sunrise with palm trees and turquoise water](https://docs.prodia.com/llms/assets/769da66fd926-workflow-animate-hero.jpg) | [Example video](https://docs.prodia.com/workflow-animate-after.mp4) | ### Project Setup ```bash # Create a project directory. mkdir prodia-animate-hero-workflow cd prodia-animate-hero-workflow ``` ### prodia-js Install Node (if not already installed): ### macOS ```bash brew install node # Close the current terminal and open a new one so that node is available. ``` ### Linux ```bash apt install node # Close the current terminal and open a new one so that node is available. ``` ### Windows ```bash winget install -e --id OpenJS.NodeJS.LTS # Close the current terminal and open a new one so that node is available. ``` Create project skeleton: ```bash # Requires node --version >= 18 # Initialize the project with npm. npm init -y # Install the prodia-js library. npm install prodia --save ``` ### requests Install Python (if not already installed): ### macOS ```bash brew install python # Close the current terminal and open a new one so that python is available. ``` ### Linux ```bash apt install python3 python3-venv python-is-python3 # Close the current terminal and open a new one so that python is available. ``` ### Windows ```bash winget install -e --id Python.Python.3.12 # Close the current terminal and open a new one so that python is available. ``` ```bash # Requires python --version >= 3.12 python -m venv venv source venv/bin/activate pip install requests ``` ### curl Install curl (if not already installed): ### macOS ```bash brew install curl # Close the current terminal and open a new one so that curl is available. ``` ### Linux ```bash apt install curl # Close the current terminal and open a new one so that curl is available. ``` ### Windows ```bash # NOTE: Windows 10 and up have curl installed by default and this can be # skipped. winget install -e --id cURL.cURL # Close the current terminal and open a new one so that curl is available. ``` ```bash # Export your token so it can be used by the main code. export PRODIA_TOKEN=your-token-here ``` > note: > > Your token is exported to an environment variable. If you close or switch your > shell you'll need to run `export PRODIA_TOKEN=your-token-here` again. Create a main file for your project: ### prodia-js ```js title="main.js" const { createProdia } = require("prodia/v2"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN // get it from environment }); ``` ### requests Create the following `main.py` ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) ``` ### curl ```bash title="main.sh" set -euo pipefail ``` You're now ready to make some API calls! ### Generate then animate (in a single workflow) The first job generates the hero frame. The second job receives that image as its starting frame and produces a 5-second 720p MP4. Wan 2.2 Lightning is the fastest image-to-video option on Prodia (\~22s per generation). ### prodia-js ```javascript title="main.js" const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); const prodia = createProdia({ token: process.env.PRODIA_TOKEN, }); (async () => { const job = await prodia.job({ type: "workflow.serial.v1", config: { jobs: [ { type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "a tropical beach at sunrise with calm turquoise waves, palm trees swaying gently, photorealistic, cinematic lighting", seed: 42, }, }, { type: "inference.wan2-2.lightning.img2vid.v0", config: { prompt: "soft waves rolling in, palm tree leaves swaying in the breeze, the sun rising slowly", resolution: "720p", seed: 42, }, }, ], }, }, { accept: "video/mp4", }); const video = await job.arrayBuffer(); await fs.writeFile("beach.mp4", new Uint8Array(video)); // open beach.mp4 })(); ``` ```bash node main.js ``` ### requests ```python title="main.py" from requests.adapters import HTTPAdapter, Retry import os import requests import sys prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'video/mp4', } job = { 'type': 'workflow.serial.v1', 'config': { 'jobs': [ { 'type': 'inference.flux-fast.schnell.txt2img.v2', 'config': { 'prompt': 'a tropical beach at sunrise with calm turquoise waves, palm trees swaying gently, photorealistic, cinematic lighting', 'seed': 42, }, }, { 'type': 'inference.wan2-2.lightning.img2vid.v0', 'config': { 'prompt': 'soft waves rolling in, palm tree leaves swaying in the breeze, the sun rising slowly', 'resolution': '720p', 'seed': 42, }, }, ], }, } res = session.post(prodia_url, headers=headers, json=job, timeout=240) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 200: print(res.text) sys.exit(1) with open('beach.mp4', 'wb') as f: f.write(res.content) ``` ```bash python main.py ``` ### curl ```bash title="main.sh" set -euo pipefail cat < job.json { "type": "workflow.serial.v1", "config": { "jobs": [ { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "a tropical beach at sunrise with calm turquoise waves, palm trees swaying gently, photorealistic, cinematic lighting", "seed": 42 } }, { "type": "inference.wan2-2.lightning.img2vid.v0", "config": { "prompt": "soft waves rolling in, palm tree leaves swaying in the breeze, the sun rising slowly", "resolution": "720p", "seed": 42 } } ] } } EOF curl -sSf --retry 3 --max-time 240 \ -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: video/mp4' \ -H 'Content-Type: application/json' \ --data-binary @job.json \ --output beach.mp4 \ https://inference.prodia.com/v2/job ``` ```bash bash main.sh ``` ### macOS ```bash open beach.mp4 ``` ### Linux ```bash xdg-open beach.mp4 ``` ### Windows ```bash start beach.mp4 ``` ### Tips - *Two prompts, two purposes.* The first prompt describes the *scene* — the second describes the *motion*. Keep the image prompt static and visual ("at sunrise", "palm trees", "cinematic lighting"), and let the video prompt focus on what *moves* ("waves rolling in", "leaves swaying"). - *Resolution.* Wan 2.2 Lightning supports `"720p"` (1280x720) and `"480p"` (832x480). 720p is the default. - *Pinning seeds.* Both jobs accept a `seed` for reproducibility — useful when you want the same output every time, or when iterating on one prompt while keeping the other fixed. - *Long-running jobs.* Image-to-video runs end-to-end in \~25–35 seconds for this chain. Set generous timeouts on your HTTP client (the curl example uses `--max-time 240`). If you run many of these concurrently, prefer the [async API](https://docs.prodia.com/reference/async/) and poll for completion. - *Other video models.* For higher quality at the cost of time, swap in [Seedance Pro](https://docs.prodia.com/models/seedance/) (`inference.seedance.pro.img2vid.v1`, \~60s, 1080p) or [Veo](https://docs.prodia.com/models/veo/) (`inference.veo.fast.img2vid.v2` for fast, `inference.veo.img2vid.v2` for quality). --- # Cloudflare Workers Source: https://docs.prodia.com/integrations/cloudflare-workers/ We make it easy to start using Prodia and Cloudflare Workers with easy templates that work directly with `npm create cloudflare`. ## Image Generation Create a new project using the image generation template: ```bash npm create cloudflare@latest -- image-generation-worker \ --template https://github.com/prodialabs/cloudflare/image-generation-template \ --no-deploy \ --no-git ``` Change into the project directory. ```bash cd image-generation-worker ``` Go to your [API Dashboard](https://app.prodia.com/api) and create a token called `Image Generation Worker (Development)`. We'll make another one for production in the next step. Copy the key and paste it into `.dev.vars` in the following format. ```env title=".dev.vars" PRODIA_TOKEN=your_development_key_here ``` Run the wrangler CLI to start the process of setting your production token. ```bash npx wrangler secret put PRODIA_TOKEN # ? Enter a secret value: › ``` Now go back into your [API Dashboard](https://app.prodia.com/api) and create a token called `Image Generation Worker (Production)`. Paste that token into the prompt and press enter. It will ask if you want to create your worker at the same time. Press enter. ``` ? There doesn't seem to be a Worker called "image-generation-worker". Do you want to create a new Worker with that name and add secrets to it? › (Y/n) ``` Now you can deploy your worker. ```bash npm run deploy ``` It will show a link to your deployed worker. Copy and paste it into your browser. You should see a mountain landscape. Refresh the page to see a different image. --- # FLUX.2 Source: https://docs.prodia.com/models/flux-2/ FLUX.2 is the second generation of Black Forest Labs' FLUX image generation models, released in November 2025. It is the leading image generation model family on Prodia for photorealistic output, creative control, and multi-image editing workflows. ### Architecture FLUX.2 is a 32B parameter model built on a latent flow matching architecture. It couples a Mistral-3 24B vision-language model with a rectified flow transformer, giving the model strong understanding of both visual and textual inputs. This architecture enables features that previous FLUX models couldn't support: - *32K-token prompts* — describe complex scenes in extreme detail - *Multi-image input* — provide up to 10 reference images for editing, style transfer, or identity-preserving generation - *HEX color understanding* — specify exact colors in your prompt (e.g., "a bag in #FF5733") and the model will match them - *Native style presets* — 17 built-in style presets (Dev variant) eliminate the need for style-specific prompt engineering ### Choosing a variant FLUX.2 offers four variants. Choosing the right one depends on your priorities: | Variant | Best for | Resolution | Generation time | Price | | ------- | ---------------------------------------- | ---------- | --------------- | ----------- | | *Dev* | Prototyping, style presets, fine control | 512–1920px | \~3s | $0.01–0.015 | | *Pro* | Production workloads, high fidelity | 64–4096px | \~12s | $0.03 | | *Flex* | Multi-image editing, maximum control | 64–4096px | \~22s | $0.06 | | *Max* | Highest quality output | 256–2048px | \~15s | $0.04 | *FLUX.2 \[dev]* — The open-weight variant. Best for rapid iteration with adjustable steps (1–50), guidance scale (1–10), and 17 style presets. Supports up to 8 input images for img2img. The fastest variant at \~3s per generation. *FLUX.2 \[pro]* — The production workhorse. Generates at up to 4096x4096 pixels (multiples of 16) with strong prompt adherence. Supports up to 8 input images for editing with a combined 9MP limit. *FLUX.2 \[flex]* — Maximum creative control. Adjustable steps and guidance parameters plus support for up to 10 input images. Best for complex multi-reference editing workflows like product photography or identity-preserving edits. *FLUX.2 \[max]* — Highest quality output. Optimized for the best possible single-image generation at up to 2048px. When quality matters more than speed. ### FLUX.1 vs FLUX.2 | Feature | FLUX.1 | FLUX.2 | | ------------------ | ----------------- | ------------------------------------- | | Architecture | 12B flow matching | 32B flow matching + Mistral-3 24B VLM | | Max resolution | 1920px | 4096px | | Multi-image input | Not supported | Up to 10 images | | Prompt length | 512–1024 tokens | 32K tokens | | HEX color control | No | Yes | | Generation quality | Excellent | State-of-the-art | ### Job types *FLUX.2 \[dev]:* | Job type | Description | | --------------------------------- | ----------------------------------- | | `inference.flux-2.dev.txt2img.v1` | Generate an image from text | | `inference.flux-2.dev.img2img.v1` | Transform images with text guidance | *FLUX.2 \[pro]:* | Job type | Description | | --------------------------------- | ------------------------------------------ | | `inference.flux-2.pro.txt2img.v1` | Generate an image from text | | `inference.flux-2.pro.img2img.v1` | Edit images (up to 8 inputs, 9MP combined) | *FLUX.2 \[flex]:* | Job type | Description | | ---------------------------------- | ----------------------------- | | `inference.flux-2.flex.txt2img.v1` | Generate an image from text | | `inference.flux-2.flex.img2img.v1` | Edit images (up to 10 inputs) | *FLUX.2 \[max]:* | Job type | Description | | --------------------------------- | ---------------------------- | | `inference.flux-2.max.txt2img.v1` | Generate an image from text | | `inference.flux-2.max.img2img.v1` | Edit images (up to 8 inputs) | ### Parameters *Common to all variants:* - `prompt` (required) — text description, up to 32K tokens - `width` / `height` — output dimensions in pixels (ranges vary by variant, must be multiples of 16 for Pro/Flex/Max) - `seed` — integer for reproducible results - `safety_tolerance` — filter level from 0 (strict) to 5 (permissive), default 2 *Dev variant extras:* - `steps` — inference steps, 1–50 (default: 28). Lower steps = faster but less detailed - `guidance_scale` — classifier-free guidance, 1.0–10.0 (default: 4.0). Higher = more prompt-adherent - `style_preset` — one of 17 presets: `3d-model`, `analog-film`, `anime`, `cinematic`, `comic-book`, `digital-art`, `enhance`, `fantasy-art`, `isometric`, `line-art`, `low-poly`, `neon-punk`, `origami`, `photographic`, `pixel-art`, `texture`, `craft-clay` *Flex variant extras:* - `steps` — inference iterations, 1–50 (default: 50) - `guidance` — prompt adherence, 1.5–10.0 (default: 4.5) *Image-to-image (all variants):* - `images` — array of input image filenames ### Prompting tips - *Be descriptive:* FLUX.2's 32K token context window rewards detailed prompts. Describe subject, action, style, lighting, composition, and mood - *Use style presets (Dev):* the built-in presets like `anime`, `cinematic`, `photographic` produce more consistent stylized output than adding style words to your prompt - *HEX colors work:* include specific colors like "#2563EB blue accent" and the model will match them - *Multi-image editing:* when using img2img with multiple reference images, your prompt should describe what to do with the inputs — "combine the product from the first image with the background from the second" - *Safety tolerance:* for artistic content, increasing `safety_tolerance` to 3–4 reduces false positives while keeping genuine safety filtering active ### Examples Text-to-image with style preset (Dev): ```json { "type": "inference.flux-2.dev.txt2img.v1", "config": { "prompt": "A serene mountain landscape at sunset, photorealistic, 4k", "width": 1024, "height": 1024, "steps": 28, "style_preset": "photographic" } } ``` High-resolution generation (Pro): ```json { "type": "inference.flux-2.pro.txt2img.v1", "config": { "prompt": "Product photograph of a luxury watch on dark marble, studio lighting, sharp detail", "width": 2048, "height": 2048 } } ``` Multi-image editing (Flex): ```json { "type": "inference.flux-2.flex.img2img.v1", "config": { "prompt": "Place the product from the first image onto the marble surface in the second image, matching the lighting", "images": ["product.jpg", "background.jpg"], "width": 1024, "height": 1024, "steps": 50 } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Guide for image-to-image transformation. --- # FLUX.2 Klein Source: https://docs.prodia.com/models/flux-2-klein/ FLUX.2 Klein is the lightweight branch of Black Forest Labs' FLUX.2 family. While [FLUX.2](https://docs.prodia.com/models/flux-2/) Dev/Pro/Flex/Max target maximum fidelity at 32B parameters, Klein scales the same architecture down to 4B and 9B parameters and ships in two flavours per size: a distilled few-step variant for sub-second generation, and a base variant that trades speed for the standard 50-step classifier-free guidance pipeline. ![FLUX.2 Klein 9b — mountain sunset](https://docs.prodia.com/llms/assets/ce1d306d3104-flux-2-klein-9b-txt2img.jpg) ### Architecture Klein is FLUX.2's rectified flow transformer compressed into 4B- and 9B-parameter checkpoints. Each size comes in two variants: - *Distilled (`4b`, `9b`)* — step-distilled to produce a finished image in 1–4 inference steps. Optimised for latency. No `guidance_scale` parameter — guidance is baked into the distillation. - *Base (`base-4b`, `base-9b`)* — undistilled checkpoints that run the full 1–50 step diffusion pipeline with adjustable `guidance_scale`. Slower, but exposes the classic levers for fine-tuning prompt adherence. All Klein variants accept the same 32K-token prompts as the rest of the FLUX.2 family and support the 17 built-in `style_preset` values. ### Choosing a variant | Variant | Job type | Best for | Typical time | Price | | -------------- | ------------------------------------------- | ---------------------------------------- | ------------ | ------------ | | *9b distilled* | `inference.flux-2.klein.9b.txt2img.v1` | Best quality at low latency | \~1s | $0.010–0.015 | | *4b distilled* | `inference.flux-2.klein.4b.txt2img.v1` | Fastest generation, prototyping | \~0.5s | $0.010–0.015 | | *base-9b* | `inference.flux-2.klein.base-9b.txt2img.v1` | Highest quality in the Klein range | \~6s | $0.020–0.030 | | *base-4b* | `inference.flux-2.klein.base-4b.txt2img.v1` | Tuning prompt adherence at low cost | \~3.5s | $0.015–0.020 | | *default* | `inference.flux-2.klein.txt2img.v1` | Sensible default (alias of 4b distilled) | \~0.5s | $0.010–0.015 | The unversioned `klein.txt2img.v1` and `klein.img2img.v1` job types are stable aliases — currently routed to the 4b distilled variant for the best latency/cost tradeoff. Pin to a specific size (`4b`, `9b`, `base-4b`, `base-9b`) when you need consistent output across calls. ### Klein vs FLUX.2 Dev/Pro | Feature | FLUX.2 Dev | FLUX.2 Klein 9b | FLUX.2 Klein 4b | | ---------------------------------- | ------------ | --------------- | --------------- | | Parameters | 32B | 9B | 4B | | Generation time (txt2img) | \~3s | \~1.5s | \~0.5s | | Price | $0.010–0.015 | $0.010–0.015 | $0.010–0.015 | | Max resolution | 1920px | 2048px | 2048px | | Distilled (few-step) variant | No | Yes (`9b`) | Yes (`4b`) | | Base variant with `guidance_scale` | Yes | Yes (`base-9b`) | Yes (`base-4b`) | | Style presets | 17 | 17 | 17 | | Max prompt length | 32K tokens | 32K tokens | 32K tokens | | HEX colour control | Yes | Yes | Yes | Klein matches FLUX.2 Dev on prompt handling and feature set. The tradeoff is fidelity — for portraits, text-in-image, and complex multi-subject compositions, Dev/Pro/Flex/Max still produce noticeably better output. Klein wins when you need many images per second or low-cost prototyping. ### When to use FLUX.2 Klein - *Interactive UIs* — sub-second generation is fast enough to feel real-time in a prompt-and-preview loop - *Batch generation at scale* — generate hundreds or thousands of images for synthetic data, A/B testing, or content libraries - *Prototyping prompts* — iterate on a prompt with the 4b distilled variant, then graduate to FLUX.2 Pro or Max for the final render - *Cost-sensitive workloads* — same flat per-call price as Dev, with much lower latency - *Tuneable guidance* — when you need `guidance_scale` to steer prompt adherence, the `base-4b` and `base-9b` variants give you that lever without leaving the Klein price band For final-quality, photorealistic, or text-heavy output, prefer [FLUX.2](https://docs.prodia.com/models/flux-2/) Pro/Flex/Max or [Recraft V4](https://docs.prodia.com/models/recraft-v4/) for native text rendering. ### Job types *Text-to-image:* | Job type | Description | ETA | | ------------------------------------------- | ------------------------------------------ | ------ | | `inference.flux-2.klein.txt2img.v1` | Default (aliased to 4b distilled) | \~0.5s | | `inference.flux-2.klein.4b.txt2img.v1` | 4B distilled — fastest | \~0.5s | | `inference.flux-2.klein.9b.txt2img.v1` | 9B distilled — best quality at low latency | \~1.5s | | `inference.flux-2.klein.base-4b.txt2img.v1` | 4B base — tuneable steps and guidance | \~3.5s | | `inference.flux-2.klein.base-9b.txt2img.v1` | 9B base — highest quality | \~6s | *Image-to-image:* | Job type | Description | ETA | | ------------------------------------------- | --------------------------------- | ------ | | `inference.flux-2.klein.img2img.v1` | Default (aliased to 4b distilled) | \~0.5s | | `inference.flux-2.klein.4b.img2img.v1` | 4B distilled img2img | \~0.5s | | `inference.flux-2.klein.9b.img2img.v1` | 9B distilled img2img | \~2s | | `inference.flux-2.klein.base-4b.img2img.v1` | 4B base img2img | \~5s | | `inference.flux-2.klein.base-9b.img2img.v1` | 9B base img2img | \~8s | All img2img variants accept up to 8 input images, each ≤1920x1920px. ### Parameters *Common to all Klein variants:* - `prompt` (required) — text description, up to 32K tokens - `width` / `height` — output dimensions, 512–2048px - `style_preset` — one of `3d-model`, `analog-film`, `anime`, `cinematic`, `comic-book`, `digital-art`, `enhance`, `fantasy-art`, `isometric`, `line-art`, `low-poly`, `neon-punk`, `origami`, `photographic`, `pixel-art`, `texture`, `craft-clay` - `seed` — integer for reproducible results *Distilled variants (`4b`, `9b`, default) only:* - `steps` — 1–4 (default: 4). Distilled inference is fastest at 4 steps; lower values trade quality for speed *Base variants (`base-4b`, `base-9b`) only:* - `steps` — 1–50 (default: 50). More steps = more refinement - `guidance_scale` — 1.0–10.0 (default: 4.0). Higher = more prompt-adherent, lower = more creative *Image-to-image (all variants):* - `images` — optional array of input image filenames. Up to 8 images. When omitted, the first multipart `input` part is used and the output matches its dimensions ### Prompting tips - *Pick the variant for the job:* if you're iterating, use `4b` distilled. If the prompt looks ready, render the final at `base-9b` for an extra quality bump without changing the model family - *Use `style_preset` rather than style keywords:* the built-in presets (e.g. `photographic`, `cinematic`) produce more consistent results than appending "photorealistic, 4k" to your prompt - *Reach for `base-*` when distilled output drifts:* if a distilled variant ignores part of your prompt, the base variant's `guidance_scale` (try 5–7) typically pulls the model back on-prompt - *Seed for reproducibility:* Klein supports seeds across all variants — pin a seed when you're A/B testing prompts to isolate the effect of wording changes ### Examples Fast text-to-image (4b distilled, default): ```json { "type": "inference.flux-2.klein.txt2img.v1", "config": { "prompt": "A serene mountain landscape at sunset, photorealistic, 4k", "width": 1024, "height": 1024 } } ``` Higher quality at low latency (9b distilled): ```json { "type": "inference.flux-2.klein.9b.txt2img.v1", "config": { "prompt": "A serene mountain landscape at sunset, photorealistic, 4k", "width": 1024, "height": 1024, "style_preset": "photographic", "seed": 42 } } ``` Maximum quality with tuneable guidance (base-9b): ```json { "type": "inference.flux-2.klein.base-9b.txt2img.v1", "config": { "prompt": "A serene mountain landscape at sunset, photorealistic, 4k", "width": 1024, "height": 1024, "steps": 50, "guidance_scale": 4.5 } } ``` ![FLUX.2 Klein base-9b — same prompt rendered with the 50-step pipeline](https://docs.prodia.com/llms/assets/82f12fe9839b-flux-2-klein-base-9b-txt2img.jpg) Image-to-image (default 4b distilled): ```json { "type": "inference.flux-2.klein.img2img.v1", "config": { "prompt": "Same scene as input but at midday with bright blue sky, photorealistic, 4k" } } ``` ![FLUX.2 Klein img2img — the sunset landscape transformed to midday](https://docs.prodia.com/llms/assets/e36f226926c8-flux-2-klein-img2img.jpg) ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia — uses Klein by default. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Guide for image-to-image transformation — uses Klein img2img by default. --- # FLUX.1 Kontext Source: https://docs.prodia.com/models/flux-kontext/ FLUX.1 Kontext is Black Forest Labs' instruction-guided editing model. You provide an input image and a natural-language description of the change you want — "make the sky stormy", "swap the dress for a leather jacket", "add a bowler hat" — and the model rewrites only the regions the prompt describes while keeping the rest of the scene, characters, and lighting intact. It is the model to reach for when you need surgical, in-place edits without the artifacts that mask-based inpainting tends to introduce. ### Architecture FLUX.1 Kontext extends the FLUX.1 rectified-flow transformer with a context-conditioning path that takes the reference image as a sequence of latent tokens alongside the text prompt. The model is trained to attend jointly to those visual tokens and the instruction, which is why it preserves identity, framing, and unedited regions much better than a vanilla img2img loop. Two characteristics of the architecture matter in practice: - *Token-level conditioning, not noise blending* — the input image is fed in as latent context rather than as a noised latent the model gradually denoises. Untouched regions stay near pixel-perfect, with no `strength` knob to tune - *Single-pass editing* — one prompt, one forward pass. There is no separate mask, no two-stage inpaint+blend. The model decides which pixels the instruction describes ### Choosing a variant | Variant | Best for | Generation time | Price | | ------- | ---------------------------------------------- | --------------- | ------ | | *Pro* | Production editing at scale | \~6s | $0.04 | | *Max* | Complex multi-step instructions, hardest edits | \~7s | $0.08 | | *Dev* | Style-preset workflows, lowest cost | \~7s | $0.025 | *FLUX.1 Kontext \[pro]* — the default. Hosted by Black Forest Labs, served through Prodia's `/v2/job` endpoint with both image generation (`txt2img`) and image editing (`img2img`) modes. Supports the full set of `aspect_ratio` values and a `safety_tolerance` knob from 0 (strict) to 6 (permissive). *FLUX.1 Kontext \[max]* — same modes as Pro with stronger prompt adherence on harder edits — fine-grained instructions, multiple changes in a single prompt, edits that need to reason about lighting or geometry. Roughly 2x the cost and slightly slower. `safety_tolerance` caps at 2 on the editing endpoint. *FLUX.1 Kontext \[dev]* — open-weight distilled variant served through Prodia's fast pipeline. Edit-only (img2img). Exposes 17 `style_preset` values and explicit `width`, `height`, `steps`, and `guidance_scale` knobs in exchange for dropping the `aspect_ratio` field. ### When to use FLUX.1 Kontext - *Localized edits with identity preservation* — character changes, prop swaps, outfit changes, expression edits where everything off-prompt should stay frozen - *Edits that would need a mask elsewhere* — Kontext figures out the region from the prompt, so you don't have to author or compute a mask - *Style transfer with structure preservation* — "make this a watercolour painting" or "render in pixel art" while keeping the original composition - *High-aspect ratios for txt2img* — the v1 endpoints support nine fixed ratios from 9:21 to 21:9; v2 accepts arbitrary `W:H` strings For prompt-only generation without a reference image, [FLUX.2](https://docs.prodia.com/models/flux-2/) produces stronger photorealistic output. For natural-language editing on Google's Gemini family, [Nano Banana](https://docs.prodia.com/models/nano-banana/) is a flat-rate alternative. For mask-based region replacement (rather than instruction-based editing), see the [`flux-fill.dev.v1`](https://docs.prodia.com/job-types/inference-flux-fill-dev-v1/) and SDXL inpainting job types. ### Job types *FLUX.1 Kontext \[pro]:* | Job type | Description | ETA | | --------------------------------------- | --------------------------------- | ---- | | `inference.flux-kontext.pro.txt2img.v2` | Generate an image from text | \~6s | | `inference.flux-kontext.pro.img2img.v2` | Edit an input image with a prompt | \~6s | *FLUX.1 Kontext \[max]:* | Job type | Description | ETA | | --------------------------------------- | --------------------------------- | ---- | | `inference.flux-kontext.max.txt2img.v2` | Generate an image from text | \~7s | | `inference.flux-kontext.max.img2img.v2` | Edit an input image with a prompt | \~7s | *FLUX.1 Kontext \[dev]:* | Job type | Description | ETA | | -------------------------------------------- | --------------------------------------------- | ---- | | `inference.flux-fast.dev-kontext.img2img.v1` | Edit an input image with style-preset support | \~7s | > note: > > The v1 Pro and Max job types (`inference.flux-kontext.pro.txt2img.v1`, etc.) remain available for existing integrations. v2 accepts arbitrary `W:H` aspect ratios; v1 limits you to a fixed enum (`21:9`, `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `9:21`). Otherwise the schemas are identical. ### Parameters *Pro and Max — `txt2img.v2` and `img2img.v2`:* - `prompt` (required) — text description, 3–4,096 characters. For `img2img` this is the editing instruction - `aspect_ratio` — any string of the form `W:H` (e.g. `16:9`, `3:2`, `21:9`). Defaults to the input aspect ratio for `img2img` - `prompt_upsampling` — boolean, default `false`. When `true` the model rewrites your prompt into a richer description before generating; useful for short prompts - `safety_tolerance` — integer. `txt2img`: 0–6, default 4. `img2img`: 0–2, default 2. Lower values apply stricter content moderation - `seed` — integer for reproducible output *Pro and Max — `img2img` inputs:* - A single input image attached as the multipart `input` part. Accepted: PNG, JPEG, or WebP, 256–1920 pixels per side, max 10 MB *Dev — `flux-fast.dev-kontext.img2img.v1`:* - `prompt` (required) — 3–4,096 characters - `style_preset` — one of `3d-model`, `analog-film`, `anime`, `cinematic`, `comic-book`, `craft-clay`, `digital-art`, `enhance`, `fantasy-art`, `isometric`, `line-art`, `low-poly`, `neon-punk`, `origami`, `photographic`, `pixel-art`, `texture` - `width` and `height` — output dimensions, 512–1040 in multiples of 32, default `1024` - `steps` — diffusion steps, 1–50, default `30` - `guidance_scale` — classifier-free guidance, default `2.5` - `seed` — integer for reproducible output - `progressive` — boolean, default `false`. When the response is JPEG, return a progressive JPEG ### Prompting tips - *Describe the change, not the whole scene.* For `img2img` write the diff — "replace the apple pie with a chocolate cake" — not the full description. The model already sees the input - *Anchor preservation explicitly* when a small change risks pulling the rest of the image with it: "...keep the wooden table, window, and lighting exactly the same" - *Use `prompt_upsampling` for short prompts.* It rewrites a five-word prompt into a richer description before generation. Skip it when you have already written the prompt you want - *For `txt2img`, choose `aspect_ratio` deliberately.* Defaults to `1:1`. Set `9:16` or `16:9` rather than upscaling or cropping later - *Reach for \[max] on multi-step instructions.* If a single prompt has two or three independent changes ("recolour the door, add a bicycle, and put leaves on the trees"), Max follows all three more reliably than Pro - *Tighten `safety_tolerance` for user-facing apps* — `0` or `1` for txt2img-from-user-input is a reasonable starting point ### Examples Apple pie generated with `txt2img.v2`: ![FLUX.1 Kontext Pro txt2img — apple pie on a sunny kitchen table](https://docs.prodia.com/llms/assets/0c8fd60ba7c6-flux-kontext-txt2img.jpg) The same image edited with `img2img.v2` to swap the pie for a chocolate cake while preserving the kitchen, window, and lighting: ![FLUX.1 Kontext Pro img2img — same scene with the pie replaced by a chocolate birthday cake](https://docs.prodia.com/llms/assets/f334a9d729bf-flux-kontext-img2img.jpg) Text-to-image at a wide aspect ratio: ```json { "type": "inference.flux-kontext.pro.txt2img.v2", "config": { "prompt": "A small, freshly baked apple pie sitting on a wooden kitchen table by a sunny window, golden flaky crust, warm afternoon light, soft natural shadows, photorealistic", "aspect_ratio": "1:1", "seed": 42 } } ``` Instruction-based editing — replace the pie above with a chocolate cake while preserving the rest of the scene: ```json { "type": "inference.flux-kontext.pro.img2img.v2", "config": { "prompt": "replace the apple pie with a chocolate birthday cake with white frosting and rainbow sprinkles, keep the wooden table, window, and lighting the same" } } ``` Multi-step instruction with the Max variant: ```json { "type": "inference.flux-kontext.max.img2img.v2", "config": { "prompt": "change the season to winter, add fresh snow on the windowsill outside, dim the indoor lighting to dusk, and place a steaming mug of cocoa next to the cake", "safety_tolerance": 1 } } ``` Style-preset edit with the Dev variant: ```json { "type": "inference.flux-fast.dev-kontext.img2img.v1", "config": { "prompt": "the same scene rendered as a hand-painted illustration", "style_preset": "anime", "width": 1024, "height": 1024, "steps": 30 } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Use img2img to transform an existing image. --- # Wan 2.2 Lightning Source: https://docs.prodia.com/models/wan-2-2/ Wan 2.2 Lightning is Alibaba's fast video generation model from the Wan family. It generates video in around 22 seconds — making it practical for interactive applications and high-volume pipelines. ### Architecture Wan 2.2 Lightning uses 14B active parameters in a Diffusion Transformer (DiT) architecture with three key components: - *T5 text encoder* — encodes multilingual text input with cross-attention in each transformer block - *Spatiotemporal 3D VAE* — compresses video frames simultaneously across space and time, dramatically reducing compute requirements - *DiT backbone* — processes the compressed latent space with shared MLP modules across transformer blocks Wan 2.2 Lightning generates video in just 4 diffusion steps without requiring classifier-free guidance (CFG), enabling fast generation while maintaining strong visual quality. ### When to use Wan 2.2 Lightning - *Social media content* — fast turnaround for short-form video at 720p - *Rapid prototyping* — quickly test video concepts before committing to longer, higher-quality generation - *High-volume pipelines* — the \~22s generation time makes batch processing practical - *Image animation* — bring product shots, illustrations, or photos to life with the img2vid mode For higher resolution (1080p), longer duration (up to 15s), or features like audio-driven lip sync and video continuation, consider [Wan 2.7](https://docs.prodia.com/models/wan-2-7/) instead. ### Job types | Job type | Description | | --------------------------------------- | ----------------------------------------------- | | `inference.wan2-2.lightning.txt2vid.v0` | Generate a video from a text prompt | | `inference.wan2-2.lightning.img2vid.v0` | Generate a video from an input image and prompt | ### Parameters - `prompt` (required) — text description of the video to generate, up to 2,500 characters - `resolution` — output resolution: `720p` (default, 1280x720) or `480p` (832x480) - `seed` — integer for reproducible results - `image` (img2vid only) — input image filename to animate ### Prompting tips Wan 2.2 Lightning responds well to specific, action-oriented prompts. Include details about movement, camera angle, and visual style: - *Be specific about motion:* "A cat walking slowly through a garden" works better than "a cat in a garden" - *Include visual style cues:* "cinematic lighting", "slow motion", "4k" help guide quality - *Describe camera movement:* "tracking shot", "pan left", "aerial view" improve spatial coherence - *Keep it concise:* the model performs best with focused, clear prompts rather than long descriptions ### Examples Text-to-video: ```json { "type": "inference.wan2-2.lightning.txt2vid.v0", "config": { "prompt": "Two anthropomorphic cats boxing on a spotlighted stage, cinematic lighting, dynamic camera angles", "resolution": "720p" } } ``` Image-to-video (animate a still image): ```json { "type": "inference.wan2-2.lightning.img2vid.v0", "config": { "prompt": "The person slowly turns their head and smiles, natural movement", "image": "portrait.jpg", "resolution": "720p" } } ``` ### Guides [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step guide for generating videos with Prodia, including text-to-video and image-to-video examples. --- # Wan 2.7 Source: https://docs.prodia.com/models/wan-2-7/ Wan 2.7 is the most capable release in Alibaba's Wan model family — a single unified model that handles five generation tasks: text-to-image, image-to-image editing, text-to-video, image-to-video animation, and video-to-video continuation. It is the go-to choice when you need maximum flexibility and quality across both image and video modalities. ### Architecture Wan 2.7 builds on the DiT (Diffusion Transformer) foundation established in the Wan 2.x series with a refined Flow-Matching framework. Key architectural improvements over earlier versions include: - *Improved motion coherence* — reduced temporal flickering on skin, fabric, and moving objects through better physics-based motion consistency - *Bilingual T5 encoder* — native support for both Chinese and English prompts with cross-attention in every transformer block - *Prompt extension* — an intelligent prompt rewriting system that expands short prompts into detailed scene descriptions for better results (enabled by default, can be disabled) - *Thinking mode* — for image generation, an optional reasoning step that improves composition and detail at the cost of longer generation time ### What sets Wan 2.7 apart Wan 2.7 is uniquely versatile among the models on Prodia: - *Five generation modes in one model* — no other model covers txt2img, img2img, txt2vid, img2vid, and vid2vid in a single family - *Audio-driven video* — provide a WAV or MP3 file to drive lip-sync and motion timing in img2vid, useful for talking-head videos and music-driven content - *First and last frame control* — specify both the starting and ending frames of a video, and the model generates everything in between. This enables loopable videos and precise scene transitions - *Video continuation* — extend an existing video clip with vid2vid, maintaining visual consistency while adding new content - *1080p video output* — one of the few open video models supporting full HD generation - *Up to 15-second clips* — longer durations than most competing video models ### When to use Wan 2.7 | Use case | Job type | Why Wan 2.7 | | ----------------------------- | --------------------------- | ----------------------------------------------------------------- | | High-quality image generation | `txt2img` | Thinking mode produces detailed, well-composed images at up to 2K | | Image style transfer | `img2img` | Edit or restyle photos with bilingual prompts | | Cinematic video from text | `txt2vid` | 1080p output with 5 aspect ratios and up to 15s duration | | Talking-head videos | `img2vid` with `audio` | Audio-driven lip-sync from a portrait photo | | Product animations | `img2vid` | Animate product shots with controlled motion | | Loopable social content | `img2vid` with `last_frame` | Set first = last frame for seamless loops | | Scene extensions | `vid2vid` | Continue an existing clip naturally | For faster video generation at 720p where you don't need audio, frame control, or 1080p — [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) generates in \~22 seconds vs Wan 2.7's \~200 seconds. ### Job types | Job type | Description | ETA | | ----------------------------- | --------------------------------- | ------ | | `inference.wan2-7.txt2img.v1` | Generate an image from text | \~40s | | `inference.wan2-7.img2img.v1` | Edit or restyle an existing image | \~40s | | `inference.wan2-7.txt2vid.v1` | Generate a video from text | \~200s | | `inference.wan2-7.img2vid.v1` | Animate an image into a video | \~200s | | `inference.wan2-7.vid2vid.v1` | Continue or extend a video clip | \~200s | > note: > > Video job types (`txt2vid`, `img2vid`, `vid2vid`) support async processing. See the [async reference](https://docs.prodia.com/reference/async/) for polling-based workflows. ### Parameters *Common to all job types:* - `prompt` — text description, up to 5,000 characters (required for most types) - `seed` — integer 0–2147483647 for reproducible results *Image generation (txt2img, img2img):* - `size` — `1K` (\~1024x1024) or `2K` (\~2048x2048, default) - `thinking_mode` — enable reasoning for improved composition (txt2img only, default: true) - `image` — input image filename (img2img only) *Video generation (txt2vid, img2vid, vid2vid):* - `resolution` — `720P` (default) or `1080P` - `ratio` — aspect ratio: `16:9` (default), `9:16`, `1:1`, `4:3`, `3:4` (txt2vid only) - `duration` — video length in seconds, 2–15 (default: 5) - `negative_prompt` — content to exclude, up to 500 characters - `prompt_extend` — intelligent prompt rewriting (default: true) *Image-to-video additional parameters:* - `image` — first-frame image to animate - `last_frame` — target last-frame image for start-end interpolation - `audio` — driving audio for lip-sync and motion timing (WAV/MP3, 2–30s, max 15 MB) *Video-to-video additional parameters:* - `video` — input video clip to continue (MP4/MOV, 2–10s, max 100 MB) - `last_frame` — target last-frame image to guide the continuation endpoint ### Prompting tips - *Use prompt extension:* leave `prompt_extend` enabled (default) for short prompts — the model will expand them into detailed scene descriptions that produce better results - *Negative prompts matter for video:* adding `"low resolution, error, worst quality, deformed"` as a `negative_prompt` noticeably improves video quality - *Bilingual prompts:* you can mix Chinese and English in the same prompt for nuanced descriptions - *Aspect ratios:* match your target platform — `9:16` for TikTok/Reels, `16:9` for YouTube, `1:1` for Instagram posts - *Audio-driven video:* for best lip-sync results, use clear speech audio without background music. Audio longer than the video duration is automatically trimmed ### Examples Text-to-video at 1080p: ```json { "type": "inference.wan2-7.txt2vid.v1", "config": { "prompt": "A kitten running in the moonlight", "resolution": "1080P", "ratio": "16:9", "duration": 5, "negative_prompt": "low resolution, error, worst quality, deformed" } } ``` Audio-driven talking head: ```json { "type": "inference.wan2-7.img2vid.v1", "config": { "image": "portrait.jpg", "audio": "speech.mp3", "prompt": "A person speaking naturally, subtle head movement", "resolution": "720P", "duration": 10 } } ``` Text-to-image with thinking mode: ```json { "type": "inference.wan2-7.txt2img.v1", "config": { "prompt": "A serene mountain landscape at sunrise with vibrant colors", "size": "2K", "thinking_mode": true } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step guide for text-to-video and image-to-video generation. --- # Veo Source: https://docs.prodia.com/models/veo/ Veo is Google DeepMind's video generation model. Its defining feature is joint audio-visual generation — rather than generating video first and adding sound as a separate step, Veo processes both modalities together using a joint diffusion process. This means generated audio syncs naturally with on-screen actions, with dialogue matching lip movements with under 120ms accuracy. ### Architecture Veo uses a 3D latent diffusion transformer architecture that goes beyond 2D image generation by adding time as a third dimension. The model uses 3D convolutional layers to process spatiotemporal data across channels, time, height, and width simultaneously, enabling it to extract patterns not just across space but also across time. The video data is compressed into spatio-temporal patches in the latent space, making generation efficient while maintaining high visual quality. This same architecture powers the audio generation when `generate_audio` is enabled. ### Standard vs Fast mode Veo is available in two speed tiers: | Mode | Generation time | Best for | | ---------- | --------------- | ------------------------------------------------ | | *Standard* | \~90 seconds | Maximum quality, commercial content | | *Fast* | \~60 seconds | Rapid iteration, previews, high-volume workloads | Both modes support the same resolution, aspect ratio, and feature set. The quality difference is subtle — start with Fast for prototyping and switch to Standard for final output. ### What sets Veo apart *Joint audio-visual generation:* Enable `generate_audio: true` to produce a synchronized audio track alongside the video. The model generates audio that matches on-screen actions — footsteps sync with walking, dialogue matches lip movements, ambient sounds match the environment. This eliminates the need for a separate audio generation or foley step. *Negative prompts:* Veo supports `negative_prompt` to exclude specific content from generation. This is useful for avoiding common artifacts: `"low quality, blurry, distorted faces, watermark"`. *Last-frame control (img2vid):* For image-to-video generation, you can provide both a starting image and a target last frame. The model generates a smooth transition between the two, useful for morphing effects and controlled scene transitions. *Person generation policy:* The `person_generation` parameter lets you explicitly allow or disallow the generation of people, giving you control over content policy compliance. ### When to use Veo - *Video with sound* — the only model on Prodia with integrated audio generation - *Landscape and nature content* — excels at sweeping shots, atmospheric scenes, and environmental video - *Social media video* — 16:9 and 9:16 aspect ratios cover YouTube, TikTok, and Instagram - *Talking-head content* — joint audio-visual diffusion produces natural lip sync For longer videos (up to 15s), more aspect ratios, or video continuation, consider [Wan 2.7](https://docs.prodia.com/models/wan-2-7/). For fast generation at lower cost, [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) generates in \~22s. For precise camera control, [Kling](https://docs.prodia.com/models/kling/) offers programmatic camera movements. ### Job types | Job type | Description | ETA | | ------------------------------- | ------------------------------ | ----- | | `inference.veo.txt2vid.v2` | Generate a video from text | \~90s | | `inference.veo.img2vid.v2` | Generate a video from an image | \~90s | | `inference.veo.fast.txt2vid.v2` | Fast text-to-video generation | \~60s | | `inference.veo.fast.img2vid.v2` | Fast image-to-video generation | \~60s | > note: > > All Veo job types support async processing. See the [async reference](https://docs.prodia.com/reference/async/) for polling-based workflows. ### Parameters *Common to all:* - `prompt` (required) — text description, up to 2,500 characters - `negative_prompt` — content to exclude, up to 2,500 characters - `resolution` — `720p` (default) or `1080p` - `aspect_ratio` — `16:9` (default) or `9:16` - `duration_seconds` — `4`, `6`, or `8` (default) - `generate_audio` — set to `true` to generate a synchronized audio track (default: false) - `person_generation` — `allow_adult` (default) or `dont_allow` - `seed` — integer for reproducible results *Image-to-video only:* - `image` — input image filename to use as the first frame - `last_frame` — optional target last-frame image for controlled transitions ### Prompting tips - *Describe the soundscape:* when using `generate_audio`, include audio cues in your prompt — "birds chirping in a forest", "footsteps echoing in a hallway", "crowd cheering in a stadium" - *Cinematic language works well:* terms like "tracking shot", "slow motion", "dolly zoom", "aerial view" produce expected camera behaviors - *Use negative prompts:* adding `"low quality, blurry, distorted, watermark"` as a negative prompt consistently improves output - *Match aspect ratio to platform:* `16:9` for YouTube/landscape, `9:16` for TikTok/Reels/Shorts ### Examples Text-to-video with audio: ```json { "type": "inference.veo.fast.txt2vid.v2", "config": { "prompt": "A sweeping mountain landscape at sunrise, mist rolling through valleys, birds flying overhead, cinematic HDR", "resolution": "1080p", "aspect_ratio": "16:9", "duration_seconds": 8, "generate_audio": true, "negative_prompt": "low quality, blurry, watermark" } } ``` Image-to-video with last-frame control: ```json { "type": "inference.veo.img2vid.v2", "config": { "prompt": "Smooth transition from day to night, lights gradually turning on", "image": "daytime-city.jpg", "last_frame": "nighttime-city.jpg", "resolution": "1080p", "aspect_ratio": "16:9", "duration_seconds": 6 } } ``` ### Guides [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step guide for generating videos with Prodia, including text-to-video and image-to-video examples. --- # Kling Source: https://docs.prodia.com/models/kling/ Kling is a video generation model family from Kuaishou Technology, the company behind the Kwai short-video platform. Among the video models available on Prodia, Kling stands out for its precise camera control system and motion masking capabilities — features that give you fine-grained control over how subjects and camera move within generated videos. ### Architecture Kling uses a Diffusion Transformer (DiT) architecture with two proprietary innovations: - *Custom 3D VAE* — Kuaishou's self-developed spatiotemporal variational autoencoder compresses video data simultaneously across space and time. This approach achieves high reconstruction quality while keeping training efficient — a better balance than encoding spatial and temporal dimensions separately - *Full-attention spatiotemporal mechanism* — instead of processing spatial and temporal features in separate passes, Kling's attention module integrates both into a single operation. This allows the model to capture local spatial features within frames and temporal dynamics across frames simultaneously, producing more natural motion ### Model version guide Kling offers five model versions, each building on the previous: | Version | Key improvement | Best for | | ------------------- | ---------------------------- | ------------------------------- | | `kling-v1` | Original release | Baseline quality, fastest | | `kling-v1-6` | Improved motion coherence | General-purpose video | | `kling-v2-master` | Major quality leap | High-quality commercial content | | `kling-v2-1` | Refined temporal consistency | Smooth, natural movement | | `kling-v2-1-master` | Best overall quality | Maximum quality, commercial use | For most use cases, start with `kling-v2-1-master` (the latest) and only switch to earlier versions if you need specific behavior. ### Standout features *Camera choreography:* Kling provides direct control over camera movement through five preset types (`simple`, `down_back`, `forward_up`, `right_turn_forward`, `left_turn_forward`) and six independent axes (horizontal, vertical, pan, tilt, roll, zoom), each adjustable from -10 to 10. This gives you precise cinematic control that other video models handle only through prompt engineering. *Static and dynamic masks (img2vid):* - *Static masks* — define regions of the image that should remain still while the rest animates. Useful for keeping backgrounds stable while a subject moves. - *Dynamic masks with trajectories* — define a mask for a subject and provide a sequence of (x, y) trajectory points. The model will move that subject along the specified path. This enables precise motion planning that prompt-based control can't achieve. *Standard and Pro modes:* Each generation can use `std` (faster) or `pro` (higher quality) mode. Pro mode roughly doubles generation time but produces notably better temporal coherence and detail. ### When to use Kling - *Cinematic content* — camera choreography controls give you dolly shots, pans, and zooms that other models can only approximate via prompting - *Product animations* — use static masks to keep the product crisp while animating the background - *Character animation* — dynamic masks with trajectories give you frame-by-frame motion control - *Social media video* — native 16:9, 9:16, and 1:1 aspect ratio support for all major platforms For faster generation without camera/mask control, consider [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) (\~22s vs Kling's \~300s). For audio-driven video or video continuation, [Wan 2.7](https://docs.prodia.com/models/wan-2-7/) supports those features. ### Job types | Job type | Description | ETA | | ---------------------------- | ------------------------------ | ------ | | `inference.kling.txt2vid.v1` | Generate a video from text | \~300s | | `inference.kling.img2vid.v1` | Generate a video from an image | \~300s | > note: > > Both job types support async processing. See the [async reference](https://docs.prodia.com/reference/async/) for polling-based workflows. ### Parameters *Text-to-video:* - `prompt` (required) — text description, up to 2,500 characters - `model` — model version (default: `kling-v1`) - `mode` — quality mode: `std` (default) or `pro` - `aspect_ratio` — `16:9` (default), `9:16`, or `1:1` - `duration` — `5` (default) or `10` seconds - `negative_prompt` — content to exclude - `cfg_scale` — guidance scale, 0–1 (default: 0.5) - `camera_control` — object with `type` and optional `config`: - `type`: `simple`, `down_back`, `forward_up`, `right_turn_forward`, or `left_turn_forward` - `config`: object with `horizontal`, `vertical`, `pan`, `tilt`, `roll`, `zoom` (each -10 to 10) *Image-to-video:* - `image` — input image filename - `image_tail` — optional last-frame image - `prompt` — text description to guide animation - `model_name` — model version (default: `kling-v1`) - `mode` — `std` or `pro` - `duration` — `5` or `10` seconds - `static_mask` — mask filename for areas that should remain still - `dynamic_masks` — array of `{mask, trajectories}` objects for guided motion, where each trajectory is a sequence of `{x, y}` points ### Examples Text-to-video with camera control: ```json { "type": "inference.kling.txt2vid.v1", "config": { "prompt": "A golden retriever running through a sunlit meadow, cinematic slow motion", "model": "kling-v2-1-master", "mode": "pro", "aspect_ratio": "16:9", "duration": "5", "camera_control": { "type": "simple", "config": { "horizontal": 3, "zoom": 2 } } } } ``` Image-to-video with static mask: ```json { "type": "inference.kling.img2vid.v1", "config": { "model_name": "kling-v2-1-master", "image": "product-on-table.jpg", "static_mask": "product-mask.png", "prompt": "The background transitions from day to night, city lights appear", "mode": "pro", "duration": "5" } } ``` ### Guides [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step guide for generating videos with Prodia, including text-to-video and image-to-video examples. --- # Nano Banana Source: https://docs.prodia.com/models/nano-banana/ Nano Banana is Google's image generation and editing model. It is the model that powers the conversational, prompt-driven image editing in the Gemini app — you describe what you want changed in natural language, and the model edits the image while preserving everything else. On Prodia, both modes are exposed as flat-rate jobs that complete in around 8 seconds. ### Architecture Nano Banana is a multimodal model built on Google's Gemini family. It accepts text and images in the same context window, which is what makes its editing behavior different from a typical diffusion img2img: rather than running noise through a pre-conditioned latent, the model reads the input image as visual tokens and reasons about which regions the prompt describes. In practice this means edits stay tightly localized — change "the puppy's collar" and the rest of the scene, lighting, and pose stay frozen. The text-to-image variant uses the same model with no input images, generating output from prompt and aspect ratio alone. ### When to use Nano Banana - *Localized edits to existing images* — adding, removing, or modifying a specific element while keeping the rest of the image unchanged. Identity preservation, prop swaps, expression edits, clothing changes - *Multi-image composition* — img2img.v2 accepts up to 3 input images, useful for combining a subject from one photo with a setting from another - *Conversational prompt style* — the model responds well to natural-language instructions ("add a red bow tie", "make it nighttime") rather than the keyword-heavy prompts used for diffusion models - *Flat per-job pricing* — every job is $0.039 regardless of resolution or aspect ratio, so cost is predictable For photorealistic generation with style presets and high-resolution output up to 4096px, [FLUX.2](https://docs.prodia.com/models/flux-2/) is a stronger choice. For native text rendering inside images, see [Recraft V4](https://docs.prodia.com/models/recraft-v4/). For higher-fidelity Google models with selectable resolution up to 4K, see [Gemini 3](https://docs.prodia.com/models/gemini-3/). ### Job types | Job type | Description | ETA | | ---------------------------------- | ---------------------------------------------------------- | ---- | | `inference.nano-banana.txt2img.v2` | Generate an image from a text prompt | \~8s | | `inference.nano-banana.img2img.v2` | Edit one or more input images (up to 3) with a text prompt | \~8s | | `inference.nano-banana.img2img.v1` | Single-image editing (deprecated — use v2) | \~8s | The `nano-banana` processor on Prodia also serves Google's higher-tier Gemini image models with selectable resolution up to 4K: | Job type | Description | ETA | | --------------------------------------- | ---------------------------------------------------------------- | ----- | | `inference.gemini-3-pro.txt2img.v1` | Gemini 3 Pro text-to-image | \~10s | | `inference.gemini-3-pro.img2img.v1` | Gemini 3 Pro image-to-image (up to 3 inputs) | \~12s | | `inference.gemini-3-1-flash.txt2img.v1` | Gemini 3.1 Flash text-to-image, optional Google Search grounding | \~30s | | `inference.gemini-3-1-flash.img2img.v1` | Gemini 3.1 Flash image-to-image (up to 14 inputs) | \~35s | > note: > > The deprecated `inference.nano-banana.img2img.v1` accepts a single `image` filename and is kept for backwards compatibility. New integrations should use `img2img.v2`, which accepts an `images` array and exposes the `aspect_ratio` parameter. ### Parameters *`inference.nano-banana.txt2img.v2`:* - `prompt` (required) — text description of the desired output, up to 2,500 characters - `aspect_ratio` — one of `1:1` (default), `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` - `include_messages` — when `true`, the response also returns `message.txt` parts containing the model's natural-language reasoning *`inference.nano-banana.img2img.v2`:* - `prompt` (required) — describe the edit you want, up to 2,500 characters - `images` — array of 1–3 input image filenames sent as multipart `input` parts - `aspect_ratio` — one of `auto` (default — match the first input), `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9` - `include_messages` — see above ### Prompting tips - *Describe the change, not the whole scene.* For img2img edits, write what should be different ("add a red bow tie") rather than re-describing the entire image — the model already sees the input - *Anchor preservation explicitly.* Phrases like "keep everything else exactly the same" reduce drift in untouched regions, especially for subtle edits - *Use natural language.* Nano Banana is a multimodal LLM, not a CLIP-conditioned diffusion model. Conversational instructions outperform comma-separated keyword prompts - *Reference inputs by position.* When passing multiple images to `img2img.v2`, refer to them in order — "the subject from the first image, in the setting from the second image" - *Pick `aspect_ratio` deliberately for txt2img.* The default is `1:1`. For social, web, or phone use cases, set `9:16` or `16:9` rather than upscaling/cropping after the fact ### Examples Text-to-image at 16:9: ```json { "type": "inference.nano-banana.txt2img.v2", "config": { "prompt": "a cute corgi puppy in a sunny meadow with wildflowers, soft natural light, photorealistic", "aspect_ratio": "16:9" } } ``` ![Nano Banana txt2img — corgi puppy in a wildflower meadow](https://docs.prodia.com/llms/assets/0cbcf6ef6baa-nano-banana-txt2img.jpg) Image-to-image edit (using the previous output as input): ```json { "type": "inference.nano-banana.img2img.v2", "config": { "prompt": "Add a small red bow tie to the puppy. Keep everything else exactly the same.", "aspect_ratio": "16:9" } } ``` ![Nano Banana img2img — same corgi with a red bow tie added](https://docs.prodia.com/llms/assets/2d856b1f0c39-nano-banana-img2img.jpg) Notice how the puppy's pose, fur, the wildflowers, the lighting, and the background are all preserved — only the bow tie is added. Multi-image composition (up to 3 inputs): ```json { "type": "inference.nano-banana.img2img.v2", "config": { "prompt": "Place the product from the first image onto the wooden surface in the second image, matching the warm lighting.", "images": ["product.jpg", "surface.jpg"], "aspect_ratio": "3:2" } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Guide for image-to-image transformation. --- # Gemini 3 Source: https://docs.prodia.com/models/gemini-3/ Gemini 3 is Google's higher-tier image family — the same multimodal lineage as [Nano Banana](https://docs.prodia.com/models/nano-banana/), but with selectable resolution up to 4K and stronger fidelity on complex prompts. Two variants are exposed through Prodia: *Gemini 3 Pro* for highest-quality output and *Gemini 3.1 Flash* for cost-efficient generation with optional Google Search grounding. Both accept text prompts, support image-to-image editing, and complete in 10–35 seconds depending on resolution. > note: > > In the Prodia explorer these variants are surfaced as *Nano Banana Pro* and *Nano Banana 2*. The underlying job-type identifiers (`inference.gemini-3-pro.*` and `inference.gemini-3-1-flash.*`) follow Google's naming. The IDs in this page are what you send to the API. ### Architecture Gemini 3 is a multimodal model: text and images share a single context window, and image generation runs through the same reasoning path as text generation. In practice this is what makes editing behave like instruction-following rather than diffusion noise blending — the model reads the input image as visual tokens, reasons about which regions the prompt describes, and rewrites only those pixels. The Pro variant is the higher-capability tier, biased toward complex compositions, accurate text rendering, and detail retention at high resolutions. Flash is the smaller, faster sibling — same model family, lower cost per image, and uniquely able to ground generation in real-time Google Search results when `google_search` is enabled. ### Choosing a variant | Variant | Best for | Generation time | Resolutions | Price | | ------- | ------------------------------------------------------------ | --------------- | ----------- | ---------------------------------- | | *Pro* | High-fidelity output, hardest prompts, 4K detail | \~10–12s | 1K, 2K, 4K | $0.15 (1K/2K), $0.30 (4K) | | *Flash* | Cost-efficient generation, search grounding, batch workloads | \~30–35s | 1K, 2K, 4K | $0.08 (1K), $0.12 (2K), $0.16 (4K) | *Gemini 3 Pro* — flagship image model. Accurate text rendering, photorealistic detail, and consistent multi-object composition. Img2img accepts up to 3 reference images. *Gemini 3.1 Flash* — smaller, cheaper, and supports `google_search` grounding for prompts that require real-world facts (logos, product designs, current events). Img2img accepts up to 14 reference images, useful for multi-image composition or character-consistency workflows across larger image sets. ### When to use Gemini 3 - *4K-resolution output* — neither [Nano Banana](https://docs.prodia.com/models/nano-banana/) nor [FLUX.2](https://docs.prodia.com/models/flux-2/) generates above 2K natively. Use Gemini 3 when you need print-quality detail - *Accurate text rendering at high resolution* — both variants render text reliably; for native vector text output, see [Recraft V4](https://docs.prodia.com/models/recraft-v4/) - *Multi-image composition with up to 14 inputs* (Flash) — combining a subject across many reference frames, or fusing several scenes into one - *Search-grounded generation* (Flash only) — set `google_search: true` to pull in real-world references during generation. Useful for logos, products, locations, or anything that benefits from current factual context - *Predictable resolution-tier pricing* — the only billing parameter is `resolution`. No per-step or per-pixel cost surprises For natural-language editing at flat per-job pricing, [Nano Banana](https://docs.prodia.com/models/nano-banana/) is a strong alternative. For instruction-guided edits with arbitrary aspect ratios, see [FLUX.1 Kontext](https://docs.prodia.com/models/flux-kontext/). ### Job types | Job type | Description | ETA | | --------------------------------------- | ---------------------------------------------------------------- | ----- | | `inference.gemini-3-pro.txt2img.v1` | Gemini 3 Pro text-to-image | \~10s | | `inference.gemini-3-pro.img2img.v1` | Gemini 3 Pro image-to-image (up to 3 inputs) | \~12s | | `inference.gemini-3-1-flash.txt2img.v1` | Gemini 3.1 Flash text-to-image, optional Google Search grounding | \~30s | | `inference.gemini-3-1-flash.img2img.v1` | Gemini 3.1 Flash image-to-image (up to 14 inputs) | \~35s | > note: > > 4K Pro and 2K/4K Flash jobs can take 30s+ to complete. For long-running generations, use the [async polling API](https://docs.prodia.com/guides/polling-async-jobs/) instead of holding the connection open. ### Parameters *Common to all four job types:* - `prompt` (required) — text description of the desired output, 1–5,000 characters. For img2img this is the editing instruction - `aspect_ratio` — one of `1:1` (default), `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` - `resolution` — `1K` (default), `2K`, or `4K`. Use uppercase K. Pricing tier is determined by this field - `include_messages` — boolean, default `false`. When `true`, the multipart response also returns `message.txt` parts containing the model's natural-language reasoning *`gemini-3-pro.img2img.v1`:* - `images` — optional array of 1–3 input image filenames sent as multipart `input` parts. When omitted, a single attached input is used implicitly *`gemini-3-1-flash.txt2img.v1` and `img2img.v1`:* - `google_search` — boolean, default `false`. Enables Google Search grounding so the model can incorporate real-world references (logos, products, locations) into the output - `images` — `img2img` only, optional array of 1–14 input image filenames ### Prompting tips - *Describe the change, not the whole scene.* For img2img write the diff — "add a small wooden tag with a leather string" — rather than re-describing the input. The model already sees it - *Anchor preservation explicitly.* "Keep everything else exactly the same" reduces drift in untouched regions, especially for subtle edits at 1K - *Use `4K` only when you need it.* 4K Pro is 2x the price of 1K/2K, and Flash 4K takes 30s+. For thumbnails and web use, 1K is usually enough - *Enable `google_search` for fact-bound prompts* — brand logos, product replicas, real-world architecture. Skip it for purely creative prompts where grounding adds latency without value - *Pass multiple images deliberately.* When using multi-image inputs, refer to them by position in the prompt — "the subject from the first image, in the setting from the second" — and make sure the multipart filenames match the order in `images` - *Pick `aspect_ratio` up front.* The default is `1:1`. For social, web, or phone, set `9:16` or `16:9` rather than upscaling or cropping after the fact ### Examples Gemini 3 Pro text-to-image at 16:9, 1K resolution: ```json { "type": "inference.gemini-3-pro.txt2img.v1", "config": { "prompt": "a cute red panda eating bamboo on a mossy log, soft natural light, photorealistic", "aspect_ratio": "16:9", "resolution": "1K" } } ``` ![Gemini 3 Pro txt2img — red panda eating bamboo on a mossy log](https://docs.prodia.com/llms/assets/fce243c00562-gemini-3-pro-txt2img.jpg) Same image edited with `img2img.v1` — adds a wooden name tag while preserving the pose, fur, lighting, and background: ```json { "type": "inference.gemini-3-pro.img2img.v1", "config": { "prompt": "Add a small wooden tag with a leather string around the red panda's neck. Keep everything else exactly the same.", "aspect_ratio": "16:9", "resolution": "1K" } } ``` ![Gemini 3 Pro img2img — same panda with a wooden name tag added](https://docs.prodia.com/llms/assets/dfcfec6c768f-gemini-3-pro-img2img.jpg) Gemini 3.1 Flash text-to-image at 2K, generating a multi-panel infographic with rendered text: ```json { "type": "inference.gemini-3-1-flash.txt2img.v1", "config": { "prompt": "a hyper-realistic infographic poster about coffee brewing methods, clean modern design, soft pastel background", "aspect_ratio": "3:4", "resolution": "2K" } } ``` ![Gemini 3.1 Flash txt2img — coffee brewing methods infographic](https://docs.prodia.com/llms/assets/c1779e2672de-gemini-3-1-flash-txt2img.jpg) Gemini 3.1 Flash img2img — same red panda transformed into a winter scene: ```json { "type": "inference.gemini-3-1-flash.img2img.v1", "config": { "prompt": "Make this look like a winter scene with snow falling and snow covering the moss and ferns. Keep the red panda in the same pose.", "aspect_ratio": "16:9", "resolution": "1K" } } ``` ![Gemini 3.1 Flash img2img — same panda in a snowy winter scene](https://docs.prodia.com/llms/assets/03745cf8e4d3-gemini-3-1-flash-img2img.jpg) Search-grounded generation with Flash — pull a real-world reference into the output: ```json { "type": "inference.gemini-3-1-flash.txt2img.v1", "config": { "prompt": "a product render of the original 1984 Macintosh 128K on a clean studio backdrop, accurate proportions, soft top lighting", "aspect_ratio": "1:1", "resolution": "2K", "google_search": true } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Use img2img to transform or edit an existing image. [Polling Async Jobs](https://docs.prodia.com/guides/polling-async-jobs/) — Use the async API for long-running 4K generations. --- # Sora 2 Source: https://docs.prodia.com/models/sora-2/ Sora 2 is OpenAI's video generation model. Compared to first-generation video models, Sora 2 produces noticeably stronger physical realism — cause-and-effect plays out plausibly, missed shots ricochet rather than teleport, and characters behave consistently across cuts. The Pro variant generates a synchronized audio track alongside the video. ### Variants Sora 2 ships in two variants on Prodia: | Variant | Resolution | Audio | Best for | | ------------ | ------------------ | ------------------ | --------------------------------------------------- | | *Sora 2* | Fixed (720p-class) | No | Rapid iteration, lower cost | | *Sora 2 Pro* | `720p` or `1080p` | Yes (synchronized) | Final output, content with dialogue or sound design | Both variants accept text-to-video and image-to-video inputs and produce 4, 8, or 12 second clips. ### What sets Sora 2 apart *Physical plausibility:* Sora 2's defining property is that it gets physics roughly right — basketballs miss the rim and bounce off the backboard, water settles, momentum carries through a gesture. Earlier text-to-video models tend to bend the world to satisfy the prompt, deleting or warping objects to make the requested outcome happen. Sora 2 is more willing to let an action fail, which produces more usable footage for narrative content. *Synchronized audio (Pro):* Sora 2 Pro generates the audio track jointly with the video, so dialogue, footsteps, and ambient sound line up with what's happening on screen. There's no separate foley pass. Ambient cues described in the prompt (for example "rain on a metal roof", "crowd chatter") are produced as part of the same generation. *Steerable via prompt:* The model responds well to detailed cinematographic direction — shot type, lens, lighting, camera motion — and to multi-shot prompts that specify a sequence of scenes within a single clip. *Image-to-video animation:* The `img2vid` job types accept a still image and a motion prompt describing how the scene should evolve. Useful for animating product shots, character portraits, or storyboard frames. ### When to use Sora 2 - *Narrative content with dialogue or sound* — Sora 2 Pro is the right choice when you need an audio track baked in - *Action sequences* — sports, stunts, and physics-driven scenes benefit from Sora 2's grounded behavior - *Storyboard animation* — animate a still image into a short clip without a separate foley step - *Vertical and landscape social* — both 16:9 and 9:16 are supported natively For longer clips with audio control or audio-driven generation, see [Wan 2.7](https://docs.prodia.com/models/wan-2-7/). For the fastest video generation on Prodia (\~22s), use [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/). For precise camera choreography (dolly, pan, zoom presets) or motion masking, see [Kling](https://docs.prodia.com/models/kling/). For another joint audio-visual model with last-frame transition control, see [Veo](https://docs.prodia.com/models/veo/). ### Job types | Job type | Description | Audio | Resolution | | --------------------------------- | ------------------------- | ----- | ------------- | | `inference.sora-2.txt2vid.v1` | Sora 2 text-to-video | No | Fixed | | `inference.sora-2.img2vid.v1` | Sora 2 image-to-video | No | Fixed | | `inference.sora-2.pro.txt2vid.v1` | Sora 2 Pro text-to-video | Yes | 720p or 1080p | | `inference.sora-2.pro.img2vid.v1` | Sora 2 Pro image-to-video | Yes | 720p or 1080p | > note: > > All Sora 2 job types support async processing. Generations commonly run longer than typical HTTP timeouts, so use the [async API](https://docs.prodia.com/reference/async/) and the [Polling Async Jobs](https://docs.prodia.com/guides/polling-async-jobs/) guide for serverless integrations. ### Parameters *Common to all Sora 2 job types:* - `prompt` (required) — text description, 3 to 4,096 characters - `aspect_ratio` — `16:9` (default) or `9:16` - `duration` — `4` (default), `8`, or `12` seconds - `seed` — integer 1 to 2,147,483,647 for reproducible results *Pro variants only:* - `resolution` — `720p` (default) or `1080p` *Image-to-video only:* - `image` — input image filename to animate. The image is referenced from the multipart upload. ### Prompting tips - *Lead with action, not subject:* "A cyclist sprints up a steep hill, pedals out of the saddle" produces better motion than "a cyclist on a hill" - *Describe the soundscape (Pro):* mention diegetic sound — "tires on gravel", "wind through pines", "low ambient room tone" — when using Sora 2 Pro - *Cinematographic direction works:* terms like "handheld", "tracking shot", "rack focus", "shallow depth of field", "golden hour" are interpreted as expected - *Animation prompts (img2vid):* describe how the existing scene should change rather than re-describing it — "the camera dollies in slowly as the subject turns to face it" - *Use seeds for iteration:* hold the seed constant while you tweak the prompt to see how each phrase changes the output ### Examples Text-to-video (Sora 2 standard): ```json { "type": "inference.sora-2.txt2vid.v1", "config": { "prompt": "A close-up cinematic shot of a golden retriever puppy bounding through a field of wildflowers at sunrise, soft warm light, slow motion", "aspect_ratio": "16:9", "duration": 4 } } ``` Text-to-video with audio (Sora 2 Pro at 1080p): ```json { "type": "inference.sora-2.pro.txt2vid.v1", "config": { "prompt": "A barista in an empty cafe pulls an espresso shot at golden hour. The grinder hums, steam hisses, the milk pitcher clinks against the bar. Shallow depth of field, warm window light.", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 8 } } ``` Image-to-video animation: ```json { "type": "inference.sora-2.img2vid.v1", "config": { "image": "product-shot.jpg", "prompt": "Slow turntable rotation, soft studio lighting, the product turns to reveal the back face", "aspect_ratio": "16:9", "duration": 4 } } ``` ### Guides [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step guide for generating videos with Prodia, including text-to-video and image-to-video examples. --- # Recraft V4 Source: https://docs.prodia.com/models/recraft-v4/ Recraft V4 is the model to choose when your images need to contain readable text. While most image generation models struggle with typography — producing garbled or misspelled text — Recraft V4 can accurately place and render multi-line text within generated images. Combined with native SVG vector output, this makes it uniquely suited for design workflows like logos, signage, social media graphics, and marketing materials. ### Architecture Recraft V4 is a ground-up rebuild with tens of billions of parameters, trained on NVIDIA Blackwell GPUs interconnected via Quantum-2 InfiniBand using bfloat16 precision. Rather than focusing on parameter count alone, Recraft optimized for total compute operations (FLOPS) per generation — scaling both parameters and inference operations for better output quality. The exact architecture is proprietary, but V4 represents a significant scale increase over Recraft V2 (\~20B parameters released in March 2024). ### What sets Recraft V4 apart *Native text rendering:* The `text_layout` parameter lets you specify text content and bounding box positions using normalized coordinates (0–1). The model renders the text as part of the image generation process — not as a post-processing overlay — so text integrates naturally with the scene's lighting, perspective, and style. *Vector (SVG) output:* The `txt2vec` job types produce SVG vector graphics instead of raster images. This is valuable for logos, icons, and illustrations that need to scale to any size without quality loss. You can also control the color palette with the `controls` parameter. *Pro variant (2x resolution):* Standard sizes max out at 1536x1024. The Pro variant doubles this to 3072x1536 — useful for print-quality output, large-format displays, or when you need extra detail. ### Recraft V3 vs V4 | Feature | Recraft V3 | Recraft V4 | | -------------- | ------------------------------------ | ------------------------------------------- | | Prompt length | 1,000 chars | 10,000 chars | | Max resolution | 2048x1024 | 1536x1024 (Standard), 3072x1536 (Pro) | | Text rendering | Basic | Precise `text_layout` with bounding boxes | | Styles | 5 styles, 40+ substyles | Prompt-driven (no explicit style parameter) | | img2img | Yes | Not yet (use V3) | | Vector output | `img2vec` (rasterize then vectorize) | Native `txt2vec` (generate as vector) | | Color controls | Yes | Vector only | > note: > > Recraft V3 remains available via `inference.recraft.txt2img.v1`, `inference.recraft.img2img.v1`, and `inference.recraft.img2vec.v1`. Use V3 when you need img2img, explicit style/substyle control, or color controls for raster output. ### When to use Recraft V4 - *Marketing graphics* — social media posts, banners, and ads with text overlays that render correctly - *Logos and branding* — use `txt2vec` for scalable SVG logos with precise color control - *Signage and packaging* — generate realistic product mockups with accurate label text - *Infographics* — combine visual elements with readable data labels and titles - *Print materials* — Pro variant's high resolution suits posters, brochures, and large-format output For photorealistic images without text, [FLUX.2](https://docs.prodia.com/models/flux-2/) generally produces higher-fidelity results. For image editing (img2img), use Recraft V3 or FLUX.2. ### Job types | Job type | Description | ETA | | ------------------------------------- | -------------------------------------- | ----- | | `inference.recraft.v4.txt2img.v1` | Generate a raster image | \~18s | | `inference.recraft.v4.pro.txt2img.v1` | Generate a high-res raster image (Pro) | \~40s | | `inference.recraft.v4.txt2vec.v1` | Generate an SVG vector graphic | \~28s | | `inference.recraft.v4.pro.txt2vec.v1` | Generate a high-res SVG vector (Pro) | \~45s | ### Parameters - `prompt` (required) — text description, up to 10,000 characters - `size` — output dimensions from preset list (see below) - `text_layout` — array of text elements, each with: - `text` — the text content to render - `bbox` — bounding box as 4 corner points, each `[x, y]` normalized to 0–1 range - `controls` (vector types only) — color palette: - `colors` — array of `{"rgb": [r, g, b]}` objects - `background_color` — optional `{"rgb": [r, g, b]}` background *Standard sizes:* `1024x1024`, `1536x768`, `768x1536`, `1280x832`, `832x1280`, `1216x896`, `896x1216`, `1152x896`, `896x1152`, `832x1344`, `1280x896`, `896x1280`, `1344x768`, `768x1344` *Pro sizes:* `2048x2048`, `3072x1536`, `1536x3072`, `2560x1664`, `1664x2560`, `2432x1792`, `1792x2432`, `2304x1792`, `1792x2304`, `1664x2688`, `2560x1792`, `1792x2560`, `2688x1536`, `1536x2688` ### Prompting tips - *Describe text placement in the prompt too:* while `text_layout` controls exact position, mentioning the text in your prompt (e.g., "a coffee shop sign reading COFFEE HOUSE") helps the model understand the visual context - *Use bounding boxes generously:* the bbox defines where text appears. Place it where text would naturally occur in the scene — on signs, labels, banners, etc. - *Long prompts work well:* with 10,000 characters of prompt space, you can describe complex scenes in detail. Be specific about materials, lighting, and composition - *Vector color control:* for SVG output, specify your brand colors via `controls.colors` to ensure on-brand output ### Examples Image with rendered text: ```json { "type": "inference.recraft.v4.txt2img.v1", "config": { "prompt": "A vintage coffee shop storefront with a hand-painted wooden sign, warm afternoon light, brick walls with ivy", "size": "1280x832", "text_layout": [ { "text": "COFFEE HOUSE", "bbox": [[0.2, 0.15], [0.8, 0.15], [0.8, 0.35], [0.2, 0.35]] }, { "text": "Est. 1987", "bbox": [[0.35, 0.38], [0.65, 0.38], [0.65, 0.45], [0.35, 0.45]] } ] } } ``` SVG logo with brand colors: ```json { "type": "inference.recraft.v4.txt2vec.v1", "config": { "prompt": "A minimalist mountain logo, clean geometric shapes, modern design", "size": "1024x1024", "controls": { "colors": [ {"rgb": [37, 99, 235]}, {"rgb": [255, 255, 255]} ], "background_color": {"rgb": [15, 23, 42]} } } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Vectorizing Images](https://docs.prodia.com/guides/vectorizing-images/) — Guide for generating and working with vector images. --- # SDXL Source: https://docs.prodia.com/models/sdxl/ SDXL (Stable Diffusion XL) is the model to reach for when you need fast, cheap image generation with fine-grained control. It produces 1024x1024 images in under two seconds and costs a fraction of a cent per image, making it well-suited to high-volume workflows, experimentation, and applications where iteration speed matters more than absolute fidelity. It also exposes more knobs than most newer models — explicit `steps`, `guidance`, `seed`, and `negative_prompt` parameters give you direct control over the diffusion process. ### Architecture SDXL is a latent-diffusion model built around a U-Net (\~2.6B parameters) operating in the latent space of a VAE. It uses *two* text encoders in parallel — OpenAI's CLIP ViT-L and the larger OpenCLIP ViT-bigG — and concatenates their outputs to form a richer text embedding (\~3.5B total parameters across the pipeline). This dual-encoder setup is the main reason SDXL produces noticeably better composition and prompt adherence than its 1.5 predecessor while remaining small enough to run on a single consumer GPU. The model includes an optional refiner stage — a second U-Net specialised for the final denoising steps. Enabling `refiner: true` improves fine detail (skin texture, foliage, fabric) at the cost of extra latency. ### When to use SDXL - *High-volume generation* — sub-2s ETAs and \~$0.002 per image make SDXL viable for batch jobs, A/B tests, and user-facing prototypes - *Style-controlled output* — the `style_preset` parameter applies one of 17 baked-in styles (anime, photographic, neon-punk, line-art, etc.) without hand-crafting prompts - *Negative prompting* — explicit `negative_prompt` support is rare among newer models; useful when you need to exclude specific subjects, artifacts, or qualities - *Image editing without retraining* — `img2img` and `inpainting` variants share the same backbone, so style and quality stay consistent across the workflow - *Reproducibility-critical work* — the `seed` parameter combined with deterministic `steps` makes SDXL easy to use for caching, regression tests, and side-by-side comparisons For higher-fidelity output and stronger prompt following, consider [FLUX.2](https://docs.prodia.com/models/flux-2/). For text-in-image workloads, use [Recraft V4](https://docs.prodia.com/models/recraft-v4/). ### Job types | Job type | Description | ETA | | ------------------------------ | ---------------------------------------------- | ------ | | `inference.sdxl.txt2img.v1` | Generate an image from a text prompt | \~1.8s | | `inference.sdxl.img2img.v1` | Transform an existing image guided by a prompt | \~1.5s | | `inference.sdxl.inpainting.v1` | Replace a masked region of an image | \~1.7s | ### Parameters *Common to all job types:* - `prompt` (required) — text description, 3–1024 characters - `negative_prompt` — qualities or subjects to avoid, 3–1024 characters - `style_preset` — one of: `3d-model`, `analog-film`, `anime`, `cinematic`, `comic-book`, `craft-clay`, `digital-art`, `enhance`, `fantasy-art`, `isometric`, `line-art`, `low-poly`, `neon-punk`, `origami`, `photographic`, `pixel-art`, `texture` - `guidance` — classifier-free guidance scale, default `8`. Lower values (5–7) give more creative results, higher values (9–12) follow the prompt more strictly - `seed` — integer for reproducible output; omit for random - `steps` — diffusion steps, 1–1000, default `25`. 20–30 is the sweet spot - `refiner` — boolean, default `false`. Adds the SDXL refiner stage for sharper detail - `conditioner` — boolean, default `false`. Enables additional conditioning signals - `noise` — noise scale, default `1` *txt2img only:* - `width`, `height` — output dimensions, 512–1536, default `1024`. SDXL was trained at 1024x1024 and works best at that resolution *img2img and inpainting:* - `strength` — how much the input image is altered, 0–1, default `0.6`. Lower values stay closer to the input *Inputs:* - `img2img` and `inpainting` accept an input image (PNG, JPEG, or WebP, 256x256 to 1536x1536, max 10 MB) - `inpainting` additionally requires a mask image — white pixels are regenerated, black pixels are preserved ### Prompting tips - *Lead with the subject:* SDXL pays more attention to the start of the prompt. Put the main subject and key adjectives first, scene details after - *Combine style preset with prompt:* `style_preset` sets the overall aesthetic — your prompt can still describe subject and composition. Prefer the preset over hand-written style words like "in the style of anime" - *Use negative prompts surgically:* terms like `blurry, low quality, distorted, watermark, text` are reliable defaults. Avoid stuffing too many terms or you'll wash out the signal - *Tune `guidance` for tone:* drop to `6` for more creative variation, raise to `10` for tighter prompt adherence. Above `12` images often look over-saturated - *Stick to 1024x1024:* SDXL was trained at 1024 square. Other supported sizes work but may show composition drift, especially at the extremes (512 or 1536) - *Enable the refiner for portraits and close-ups:* `refiner: true` notably improves skin, eyes, and fine textures. It adds latency, so leave it off for thumbnails and previews ### Examples Text to image with a style preset and seed: ```json { "type": "inference.sdxl.txt2img.v1", "config": { "prompt": "a majestic snow leopard perched on a frozen mountain ledge, sweeping vista of snowy peaks behind, golden hour, sharp focus", "negative_prompt": "blurry, low quality, distorted, painting", "style_preset": "photographic", "width": 1024, "height": 1024, "seed": 42, "refiner": true } } ``` Image-to-image transformation with low strength to preserve composition: ```json { "type": "inference.sdxl.img2img.v1", "config": { "prompt": "a watercolour painting of the same scene, soft pastel tones, visible brush strokes", "style_preset": "analog-film", "strength": 0.45, "guidance": 7 } } ``` Inpainting a masked region: ```json { "type": "inference.sdxl.inpainting.v1", "config": { "prompt": "a vase of fresh sunflowers on the table", "negative_prompt": "blurry, distorted", "strength": 0.85, "steps": 30 } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Use img2img to transform an existing image. --- # Seedance Source: https://docs.prodia.com/models/seedance/ Seedance is ByteDance's video generation model family, developed by the team behind Doubao and the [Seedream](https://docs.prodia.com/models/seedream/) image models. It is built for fast, prompt-faithful video generation: a single short prompt produces a coherent 5- or 10-second clip at up to 1080p, with strong adherence to camera-direction language ("dolly in", "tracking shot", "static") and good motion stability across frames. ### Architecture Seedance is a Diffusion Transformer (DiT) trained jointly on text-to-video and image-to-video objectives. Two design choices stand out for API users: - *Decoupled spatial and temporal layers* — the model alternates spatial-attention blocks (per-frame composition) with temporal-attention blocks (cross-frame motion). This split lets it learn fine-grained appearance and physics independently, which produces fewer flicker artifacts on textures like fur, fabric, and water than single-stream architectures. - *Multi-shot training* — Seedance is trained on multi-shot sequences, so a single prompt that describes a brief sequence of actions ("the dog runs to the camera, then leaps over the puddle") tends to produce a continuous shot that follows the described beats rather than a single static motion. ### Variant comparison The Seedance family on Prodia ships in two variants. *Pro Turbo* is the default starting point for almost all use cases; *Pro* exists for cases where you need maximum quality and are willing to pay more for it. | Feature | Pro Turbo | Pro | | ----------------------- | ------------------------------- | ------------------------------- | | Job type prefix | `inference.seedance.proturbo.*` | `inference.seedance.pro.*` | | Resolutions | 480p, 1080p | 480p, 1080p | | Aspect ratios (txt2vid) | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 | | Duration | 5s or 10s | 5s or 10s | | Generation time | \~45s | \~60s | | Cost (1080p, 5s) | lower (around half of Pro) | higher | *Pro Turbo* — the recommended default. A distillation/optimization tier with the same API surface as Pro and \~25% faster generation. The quality difference for typical prompts is small enough that Pro Turbo is the right choice unless you have a specific reason to pay more. *Pro* — full-quality variant. Useful when you have a finished prompt that didn't quite render the way you wanted on Pro Turbo and you want one more pass with the higher-quality model before iterating on the prompt. > note: > > A `lite` variant (`inference.seedance.lite.*`) is also exposed, but it is *deprecated* and reaches end of life on 2026-04-30. New projects should use `proturbo` or `pro`. The migration is a one-token rename in the `type` field — the config schema is compatible. ### When to use Seedance | Use case | Job type | Why Seedance | | ------------------------------------- | -------------------------------------------- | ------------------------------------------------------------ | | Short cinematic clip from a prompt | `proturbo.txt2vid` | \~45s generation at 1080p, strong camera-direction prompting | | Animating a hero image / product shot | `proturbo.img2vid` | Faithful starting frame + natural motion in 5s | | Loopable social content | `proturbo.txt2vid` with `aspect_ratio: 9:16` | Native portrait support for TikTok/Reels | | Final-pass quality on a locked prompt | `pro.txt2vid` / `pro.img2vid` | Slightly higher fidelity than Pro Turbo at higher cost | For *audio-driven* video (lip-sync from a portrait + audio file) or *first-and-last-frame* interpolation, [Wan 2.7](https://docs.prodia.com/models/wan-2-7/) is the better fit — Seedance does not accept audio or a `last_frame`. For very low-latency 720p-only generation, [Wan 2.2 Lightning](https://docs.prodia.com/models/wan-2-2/) generates in \~22s. For the most precise *camera choreography* (per-axis pan, tilt, roll, zoom), [Kling](https://docs.prodia.com/models/kling/) exposes those controls explicitly. ### Job types | Job type | Description | ETA | | ---------------------------------------- | ----------------------------------------------- | ----- | | `inference.seedance.proturbo.txt2vid.v1` | Text-to-video, Pro Turbo | \~45s | | `inference.seedance.proturbo.img2vid.v1` | Image-to-video from a starting frame, Pro Turbo | \~45s | | `inference.seedance.pro.txt2vid.v1` | Text-to-video, Pro | \~60s | | `inference.seedance.pro.img2vid.v1` | Image-to-video from a starting frame, Pro | \~60s | > note: > > All Seedance job types are *async-only*. Submit to `POST /v2/job/async` and poll `GET /v2/job/async/:id/job.state.current` until it returns `processed`, then download `output/video.mp4`. See the [async reference](https://docs.prodia.com/reference/async/) and the [polling async jobs guide](https://docs.prodia.com/guides/polling-async-jobs/) for the full flow. ### Parameters *Common to all job types:* - `prompt` (required) — text description of the desired clip, 3–4,096 characters - `resolution` — `"480p"` or `"1080p"` (default: `"1080p"`). Exact width/height varies with aspect ratio. - `duration` — `5` or `10` seconds (default: `5`) - `camera_fixed` — `true` to discourage camera motion (default: `false`, not guaranteed) - `watermark` — `true` to add an "AI-generated" watermark (default: `false`) - `seed` — integer for reproducible results *Text-to-video only:* - `aspect_ratio` — `"16:9"` (default), `"9:16"`, `"1:1"`, `"4:3"`, `"3:4"`, or `"21:9"` *Image-to-video only:* - `first_frame` — filename of the starting frame, supplied as a multipart form file. Aspect ratio of the output follows the input image. ### Prompting tips - *Describe the motion, not just the scene* — Seedance is trained to follow camera and subject-motion language. A prompt like `"slow dolly in on the puppy, shallow depth of field"` produces noticeably more intentional motion than `"a puppy"`. - *Use camera\_fixed for product shots* — when you want the subject to move but the camera held still (e.g. a rotating product on a tabletop), set `camera_fixed: true` and describe the subject motion in the prompt. - *Match aspect ratio to platform* — `9:16` for TikTok/Reels/Shorts, `16:9` for YouTube/landing pages, `1:1` for Instagram feed, `21:9` for cinematic banners. - *480p is genuinely useful for iteration* — 480p costs roughly an order of magnitude less than 1080p and finishes in the same wall time. Iterate on prompts at 480p, then switch the same prompt to 1080p for the final render. - *Short, declarative prompts beat long ones* — Seedance handles 1–2 sentence prompts well. Very long prompts tend to get partially ignored; if you need to describe a sequence of actions, separate beats with commas rather than long subordinate clauses. ### Examples Text-to-video at 1080p, 16:9, 5 seconds: ```json { "type": "inference.seedance.proturbo.txt2vid.v1", "config": { "prompt": "a golden retriever puppy running through a field of wildflowers in slow motion, cinematic lighting, hyperrealistic", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5 } } ``` Sample frame from the generated clip (480p preview shown for size): ![Seedance Pro Turbo text-to-video output, golden retriever puppy](https://docs.prodia.com/llms/assets/c52c6edb2b55-seedance-txt2vid-poster.jpg) Vertical 9:16 clip for TikTok/Reels with a fixed camera: ```json { "type": "inference.seedance.proturbo.txt2vid.v1", "config": { "prompt": "a barista pouring latte art into a cup, steam rising, warm morning light", "resolution": "1080p", "aspect_ratio": "9:16", "duration": 5, "camera_fixed": true } } ``` Image-to-video — animate a still frame with a described camera move. The `first_frame` field names the file, which is uploaded alongside the job as multipart form-data: ```json title="job.json" { "type": "inference.seedance.proturbo.img2vid.v1", "config": { "first_frame": "cyberpunk-input.jpg", "prompt": "the camera slowly pushes forward through the cyberpunk market, neon signs flicker, people walk by", "resolution": "1080p", "duration": 5 } } ``` Input frame: ![Seedance img2vid input — cyberpunk street](https://docs.prodia.com/llms/assets/10e1e0e73d20-seedance-img2vid-input.jpg) Sample frame from the generated clip — the camera has pushed forward through the same scene: ![Seedance Pro Turbo img2vid output frame](https://docs.prodia.com/llms/assets/1e4e2a624f53-seedance-img2vid-poster.jpg) ### Guides [Generating Videos](https://docs.prodia.com/guides/generating-videos/) — Step-by-step tutorial covering text-to-video and image-to-video against the v2 inference API. [Polling Async Jobs](https://docs.prodia.com/guides/polling-async-jobs/) — The submit → poll → download flow used by all Seedance job types. [Async API Reference](https://docs.prodia.com/reference/async/) — Endpoint reference for /v2/job/async. --- # Seedream Source: https://docs.prodia.com/models/seedream/ Seedream is ByteDance's image generation model family, developed by the same team behind TikTok's internal creative tools. It uses a unified architecture that integrates image generation and editing into a single model, enabling workflows where you generate an image and then iteratively refine it — all within the same model family without switching between different systems. ### Architecture Seedream uses a unified generation-editing architecture that handles both tasks in one framework. This is different from most model families where generation and editing are separate models with different capabilities. The unified design means the model understands both "create from scratch" and "modify existing" as points on a continuum, leading to more consistent results when combining both workflows. Each version scales the model's capabilities while maintaining this unified approach. Seedream 4.5 scored #10 on the LM Arena global leaderboard with a performance score of 1147, placing it among the top image generators available. ### Version comparison | Feature | Seedream 4.0 | Seedream 4.5 | Seedream 5.0 Lite | | --------------- | ------------ | ------------ | ----------------- | | Min resolution | 1024px | 1920px | 1024px | | Max resolution | 4096px | 4096px | 4096px | | Default size | 2048x2048 | 2048x2048 | 2048x2048 | | txt2img | Yes | Yes | Yes | | img2img | Single image | Single image | Up to 14 images | | Seed support | No | Yes | No | | Generation time | \~15s | \~15s | \~15s | *Seedream 4.0* — the baseline version with strong generation quality at 1024–4096px. Good general-purpose choice. *Seedream 4.5* — improved quality through model scaling, with a higher minimum resolution (1920px) that ensures output is always high-quality. The only version with seed support for reproducible results. Ranked among top image generators globally. *Seedream 5.0 Lite* — introduces multi-image blending, accepting up to 14 input images and combining them into a single coherent output. This enables complex compositing workflows like product swaps, element transfers between images, and multi-source style mixing while preserving depth, perspective, and lighting consistency. ### When to use Seedream - *High-resolution output* — all versions generate at up to 4096x4096 by default, with 2048x2048 as default. Good for print, large displays, and detail-heavy images - *Generate-then-edit workflows* — generate with txt2img, then refine with img2img using the same model family for consistency - *Multi-image compositing* — Seedream 5.0 Lite's 14-image blending is unique among models on Prodia. Useful for product photography compositing, combining subjects from multiple reference photos, or style blending - *Asian aesthetic content* — as ByteDance's internal model, Seedream excels at content styles popular on TikTok and Douyin For photorealistic output with style presets and multi-image editing, [FLUX.2](https://docs.prodia.com/models/flux-2/) offers more control. For text rendering in images, [Recraft V4](https://docs.prodia.com/models/recraft-v4/) is the better choice. ### Job types | Job type | Description | ETA | | ---------------------------------------- | -------------------------------------- | ----- | | `inference.seedream-4.txt2img.v1` | Seedream 4.0 text-to-image | \~15s | | `inference.seedream-4.img2img.v1` | Seedream 4.0 image-to-image | \~20s | | `inference.seedream-4-5.txt2img.v1` | Seedream 4.5 text-to-image | \~15s | | `inference.seedream-4-5.img2img.v1` | Seedream 4.5 image-to-image | \~20s | | `inference.seedream-5-0.lite.txt2img.v1` | Seedream 5.0 Lite text-to-image | \~15s | | `inference.seedream-5-0.lite.img2img.v1` | Seedream 5.0 Lite multi-image blending | \~20s | ### Parameters *Common to all versions:* - `prompt` (required) — text description, up to 4,096 characters - `width` — output width in pixels (ranges vary by version) - `height` — output height in pixels (ranges vary by version) - `watermark` — set to `true` to add an AI-generated watermark (default: false) *Seedream 4.5 only:* - `seed` — integer 0–2147483647 for reproducible results *Single-image editing (4.0, 4.5):* - `image` — input image filename to edit *Multi-image blending (5.0 Lite img2img):* - `images` — array of up to 14 input image filenames. The model blends elements from all provided images into a single coherent output guided by the prompt ### Prompting tips - *Resolution matters:* Seedream defaults to 2048x2048. For Seedream 4.5, the minimum is 1920px — the model is optimized for high-resolution output, so don't downscale - *Multi-image blending:* when using Seedream 5.0 Lite with multiple images, describe in your prompt how the images should combine — "place the product from the first image in the setting from the second image" or "blend the styles of all reference images" - *Watermark for compliance:* enable `watermark: true` when generating content that needs to be clearly marked as AI-generated - *Iterative refinement:* generate a base image with txt2img, then use img2img with the same version to refine specific aspects — the unified architecture maintains consistency ### Examples High-resolution text-to-image: ```json { "type": "inference.seedream-4-5.txt2img.v1", "config": { "prompt": "A dancing cat under moonlight, detailed fur, dramatic lighting, volumetric rays", "width": 2048, "height": 2048, "seed": 42 } } ``` Multi-image blending (5.0 Lite): ```json { "type": "inference.seedream-5-0.lite.img2img.v1", "config": { "prompt": "Place the sneaker from the first image on the wooden surface from the second image, matching the warm lighting from the third image", "images": ["sneaker.jpg", "surface.jpg", "lighting-ref.jpg"], "width": 2048, "height": 2048 } } ``` ### Guides [Generating Images](https://docs.prodia.com/guides/generating-images/) — Step-by-step guide for generating images with Prodia. [Transforming Images](https://docs.prodia.com/guides/transforming-images/) — Guide for image-to-image transformation. --- # Inference API Source: https://docs.prodia.com/reference/inference/ The inference API provides an HTTP endpoint for running jobs to convert text to images, an image to an image, text to a video, and [more](https://app.prodia.com/explorer). The jobs endpoint covers all types of supported inference workloads through a unified IO interface and a single `/v2/job` endpoint. Job requests are made in a synchronous manner with the input containing the job configuration along with the input data and the output containing an updated job configuration with the output data. ## Authentication API requests require authentication via the [`Authorization` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) with a `Bearer` token scheme: ``` Authorization: Bearer xxxxxxxxxxxx ``` Tokens are created on the [API Dashboard](https://app.prodia.com/api) and are required to use the API. > Did you know? > > Prodia's API tokens are JWTs. This allows us to check your identity without > touching a database and without adding latency. ## Base URL The base URL for all requests should be: ## `POST /v2/job` Execute a Job Jobs are executed by posting to the `/v2/job` endpoint with an appropriate job configuration and input data. ### Query Parameters #### `price` (optional) When set to `true`, the response job result will include a `price` field with the billing product code and cost in dollars. ``` POST /v2/job?price=true ``` ```json title="price field in job result" { "price": { "product": "inference-flux-fast-schnell-txt2img-v2", "dollars": 0.0010 } } ``` ### Job Configuration All requests minimally have a [JSON](https://www.json.org/json-en.html) job configuration that is differentiated on the `type` field: ```json title="job.json" { "type": "inference.ping.v1" } ``` There are a variety of job types documented in the [explorer](https://app.prodia.com/explorer) and they have the following in common: - All jobs have a `type` field that indicates which job type is being requested. - Jobs with configuration have a `config` field that contains the type specific job configuration. For example, this is a job configuration for a [FLUX.1 \[schnell\]](https://huggingface.co/black-forest-labs/FLUX.1-schnell) text to image generation: ```json title="job.json" { "type": "inference.flux-fast.schnell.txt2img.v2", "config": { "prompt": "grainy photograph of a space explorer" } } ``` > note: > > Some jobs require configuration with some minimal information (e.g. > `inference.flux-fast.schnell.txt2img.v2` requires at least a config with a prompt. Make > sure to check the job configuration requirements in the > [explorer](https://app.prodia.com/explorer). ### Job Input Data Some jobs need data that isn't best transferred in the JSON format (e.g. binary [PNG](https://en.wikipedia.org/wiki/PNG) data). This additional non-JSON input to the job execution is sent as a [multipart/form-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types#multipartform-data) part named `input`. Multiple input data parts may be specified as long as they use different filenames. When sending input data the job configuration is sent in the part named `job` with `filename="job.json"` (and there must only be one part with this name). For example, a FLUX.1 \[schnell] image to image generation requires an input image. This would result in a multipart/form-data request with 2 parts (one for the job configuration and another for the input image). Given the following job configuration and an `input.jpg` in the local directory: ```json title="job.json" { "type": "inference.flux.schnell.img2img.v1", "config": { "prompt": "grainy photograph of a space explorer", "loras": ["prodia/lora/flux/levels/analog@v1"] } } ``` Curl can be used to make the multipart request: ```bash title="curl FLUX.1 [schnell] image to image" curl -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg' \ -F job=@job.json \ -F input=@input.jpg \ --output output.jpg \ 'https://inference.prodia.com/v2/job' ``` An HTTP trace of the request might look something like: ```text {9,21} "name="job"" "name="input"" POST /v2/job HTTP/2 Host: inference.prodia.com User-Agent: curl/8.11.1 Accept: image/jpeg Authorization: Bearer $PRODIA_TOKEN Content-Type: multipart/form-data; boundary=------------------------fYf8kg9C7fC50PWcYjMuWt --------------------------fYf8kg9C7fC50PWcYjMuWt Content-Disposition: form-data; name="job"; filename="job.json" Content-Type: application/json { "type": "inference.flux.schnell.img2img.v1", "config": { "prompt": "grainy photograph of a space explorer", "loras": ["prodia/lora/flux/levels/analog@v1"] } } --------------------------fYf8kg9C7fC50PWcYjMuWt Content-Disposition: form-data; name="input"; filename="input.jpg" Content-Type: image/jpeg ......JFIF...... ...more bytes... --------------------------fYf8kg9C7fC50PWcYjMuWt-- ``` > note: > > Note the part `name` in the `Content-Disposition` above. The job part name must > be `job` with `filename="job.json"`, and the input part name(s) must be `input`. > Only one `job` part is allowed. Multiple `input` parts may be provided (if the > job type supports it) as long as the `filename` is unique for each `input` part. ### Job Result All jobs return a job result which is a mirror of the original job configuration with additional information from the job execution. A job result includes all fields in the [job configuration](https://docs.prodia.com/reference/inference/#job-configuration) and the following: - `created_at` is the UTC time the server created the job - `updated_at` is the UTC time the job result was last updated - `expires_at` is the UTC time after which the job is considered expired - `id` is a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) generated by the server to identify this job - `state` has a `current` field indicating the final state of the job and an optional `history` array (see [Job States](https://docs.prodia.com/reference/inference/#job-states) below) - `metrics` contains the elapsed inference time for the job and additional metrics when appropriate (e.g. iterations per second) - `error` is an error message present if the final state of the job is `failed` - `deprecated` is present when the job type has been deprecated (see [Deprecation](https://docs.prodia.com/reference/inference/#deprecation) below) - `price` is present when `?price=true` is set (see [Query Parameters](https://docs.prodia.com/reference/inference/#query-parameters) above) The job result may also update the `config` field to include default values or results produced during inference. For example, a text-to-image job may write back the random `seed` that was used, the actual `width` and `height` after any rounding, or an [NSFW](https://en.wikipedia.org/wiki/Not_safe_for_work) classification result. These fields are useful for reproducibility (re-submit the same config with the same seed to get identical output) and for inspecting what parameters the server actually used. > tip: > > To reproduce a job, copy the `config` from the job result and submit it as a > new job — the server-assigned defaults (like `seed`) are preserved. For example, using the job configuration above would render a job result similar to this: ```json title="job.json" { "type": "inference.flux.schnell.img2img.v1", "created_at": "2025-01-01T00:00:14.885Z", "updated_at": "2025-01-01T00:00:20.11Z", "expires_at": "2025-01-01T00:01:14.885Z", "id": "c83d7027-240a-484a-aeba-96014e568711", "state": { "current": "completed" }, "config": { "prompt": "grainy photograph of a space explorer", "loras": ["prodia/lora/flux/levels/analog@v1"] }, "metrics": { "elapsed": 5.138920783996582, "ips": 4.864834670706344 } } ``` ### Job States The `state.current` field of a job result will be one of: | State | Description | | ------------ | -------------------------------------------------- | | `created` | Job has been received and is queued for processing | | `processing` | Job is currently being processed by a worker | | `completed` | Job completed successfully | | `failed` | Job encountered an error (see `error` field) | The `state` object may also include a `history` array that records each state transition with timestamps and dwell times. State history is available to admin-scoped tokens: ```json title="state with history" { "state": { "current": "completed", "history": [ { "from": "created", "to": "processing", "at": "2025-01-01T00:00:14.900Z", "dwell": 0.015, "message": "Job is being processed." }, { "from": "processing", "to": "completed", "at": "2025-01-01T00:00:20.110Z", "dwell": 5.21, "message": "Job completed." } ] } } ``` For non-admin tokens, `state.history` is `null` and only `state.current` is populated. ### Deprecation When a job type is being retired, the job result will include a `deprecated` field: ```json title="deprecated field in job result" { "deprecated": { "on": "2025-12-01T00:00:00Z", "eol": "2026-01-01T00:00:00Z", "notice": "This job type is deprecated. Please migrate to inference.flux-fast.schnell.txt2img.v3" } } ``` - `on` is the date the deprecation was announced - `eol` (end-of-life) is the date after which the job type will no longer be accepted - `notice` contains migration guidance Before the `eol` date, the job will still execute normally but the `deprecated` field serves as a warning. After the `eol` date, the server will reject the job with a `400 Bad Request` and the `deprecated` field in the error response. ### Input Constraints Job types may define constraints on input files such as maximum file size and image dimensions. These constraints are documented per job type in the [explorer](https://app.prodia.com/explorer). Submitting input that exceeds these constraints will result in a `400 Bad Request` response. ### Job Output Data Similar to [job input data](https://docs.prodia.com/reference/inference/#job-input-data), all jobs support returning a `multipart/form-data` response that includes the job result JSON as the `job` part and output data as the `output` parts. An HTTP trace of such a response might look something like: ```text {6,30} "name="job"" "name="output"" HTTP/2 200 content-type: multipart/form-data; boundary=b3d4fb976dce6e5d036fa7fb3da645bcfcc56384abb2cb618f8c8bdfd360 x-request-id: 835b0174-5a7c-45e0-8256-050d0f2c47a1 --b3d4fb976dce6e5d036fa7fb3da645bcfcc56384abb2cb618f8c8bdfd360 Content-Disposition: form-data; name="job"; filename="job.json" Content-Type: application/json { "type": "inference.flux.schnell.img2img.v1", "created_at": "2025-01-01T00:00:14.885Z", "updated_at": "2025-01-01T00:00:20.11Z", "expires_at": "2025-01-01T00:01:14.885Z", "id": "c83d7027-240a-484a-aeba-96014e568711", "state": { "current": "completed" }, "config": { "prompt": "grainy photograph of a space explorer", "loras": [ "prodia/lora/flux/levels/analog@v1" ] }, "metrics": { "elapsed": 5.138920783996582, "ips": 4.864834670706344 } } --b3d4fb976dce6e5d036fa7fb3da645bcfcc56384abb2cb618f8c8bdfd360 Content-Disposition: form-data; name="output"; filename="f9774fd02a85-8985-4d2a-a093-24bda78322b7" Content-Type: image/jpeg ......JFIF...... ...more bytes... --b3d4fb976dce6e5d036fa7fb3da645bcfcc56384abb2cb618f8c8bdfd360-- ``` > note: > > Note the part `name` in the `Content-Disposition` above. There will always be > at least a `job` part. Zero or more `output` parts may be sent depending on the > job type. All `output` parts will have unique filenames. ### Content Negotiation #### Request Body The HTTP request format is specified via the request `Content-Type` header. All jobs can accept a `multipart/form-data` request. If a job type doesn't (or optionally doesn't) accept job input data then the `Content-Type` can be set to `application/json` and the job configuration can be sent directly. #### Response Body The desired HTTP response format is specified via the request `Accept` header. All jobs can negotiate a `multipart/form-data` response which works much like [job input data](https://docs.prodia.com/reference/inference/#job-input-data) except that instead of `input` parts it has `output` parts. If a job only outputs a single job output data file, then it can be returned directly by setting the `Accept` header to one of the supported output formats for the job type. > tip: > > Content negotiation allows some jobs to be simplified into a request containing > only a job configuration and a response containing only the job output data. > For example, FLUX.1 \[schnell] text to image jobs can be curl'd like so: > > ```bash title="curl FLUX.1 [schnell] text to image" > curl -H "Authorization: Bearer $PRODIA_TOKEN" \ > -H 'Accept: image/jpeg' \ > --json '{"type": "inference.flux-fast.schnell.txt2img.v2", "config": {"prompt": "grainy photograph of a space explorer"}}' \ > --output output.jpg \ > 'https://inference.prodia.com/v2/job' > ``` When negotiating a `multipart/form-data` response the default output content type can be overridden by specifying a secondary type in the `Accept` header. For example `Accept: multipart/form-data; image/png` would format the response into a `multipart/form-data` where the first `output` part has `Content-Type: image/png`. #### Output Format Parameters The `Accept` header supports encoding parameters to control output quality and compression. Parameters are specified using the standard MIME type parameter syntax: `type/subtype;param1=value1;param2=value2`. ##### image/jpeg | Parameter | Type | Range | Default | Description | | ------------- | ------ | ----------- | ------- | ---------------------------------------------------------- | | `quality` | int | 0-95 | 75 | Compression quality (higher = better quality, larger file) | | `optimize` | bool | 0/1 | false | Optimize Huffman tables for smaller file size | | `progressive` | bool | 0/1 | false | Create progressive JPEG (loads in multiple passes) | | `subsampling` | string | 444/422/420 | 420 | Chroma subsampling (444 = best quality, 420 = smallest) | Example: ```bash curl -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/jpeg;quality=90;progressive=1' \ --json '{"type": "inference.flux-fast.schnell.txt2img.v2", "config": {"prompt": "puppies"}}' \ --output output.jpg \ 'https://inference.prodia.com/v2/job' ``` ##### image/webp | Parameter | Type | Range | Default | Description | | --------------- | ---- | ----- | ------- | ---------------------------------------------------------- | | `quality` | int | 0-100 | 80 | Compression quality (higher = better quality, larger file) | | `lossless` | bool | 0/1 | false | Use lossless compression (ignores quality setting) | | `alpha-quality` | int | 0-100 | 100 | Quality of alpha channel compression | | `method` | int | 0-6 | 4 | Compression method (0 = fastest, 6 = best compression) | Example: ```bash curl -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/webp;quality=95;method=6' \ --json '{"type": "inference.flux-fast.schnell.txt2img.v2", "config": {"prompt": "puppies"}}' \ --output output.webp \ 'https://inference.prodia.com/v2/job' ``` ##### image/png | Parameter | Type | Range | Default | Description | | ---------------- | ---- | ----- | ------- | ----------------------------------------- | | `compress-level` | int | 0-9 | 6 | Compression level (0 = none, 9 = maximum) | | `optimize` | bool | 0/1 | false | Optimize encoding for smaller file size | Example: ```bash curl -H "Authorization: Bearer $PRODIA_TOKEN" \ -H 'Accept: image/png;compress-level=9;optimize=1' \ --json '{"type": "inference.flux-fast.schnell.txt2img.v2", "config": {"prompt": "puppies"}}' \ --output output.png \ 'https://inference.prodia.com/v2/job' ``` ### Status Codes #### `200` OK A [`200` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) indicates the job was completed successfully. #### `400` Bad Request A [`400` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) indicates that the request was malformed. If possible the server will respond with a job result with the state set to `failed` and a message regarding the error in the `error` field: ```json title="400 error response" { "type": "inference.flux-fast.schnell.txt2img.v2", "id": "c83d7027-240a-484a-aeba-96014e568711", "created_at": "2025-01-01T00:00:14.885Z", "updated_at": "2025-01-01T00:00:14.886Z", "expires_at": "2025-01-01T00:01:14.885Z", "state": { "current": "failed" }, "config": {}, "error": "config: prompt is required" } ``` #### `401` Unauthorized A [`401` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401) indicates the request requires [authentication](https://docs.prodia.com/reference/inference/#authentication). #### `403` Forbidden A [`403` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403) indicates that the [authentication](https://docs.prodia.com/reference/inference/#authentication) provided does not have sufficient privileges for the request. This can happen if the job type requires additional permissions. #### `429` Too Many Requests A `429` status code indicates that there is no idle capacity available at request time. *This is a normal part of load management.* The response includes a `Retry-After` header specifying the minimum delay (in seconds) before retrying. The server also applies adaptive backoff: if the system remains at capacity, successive `429` responses may take progressively longer to return. This server-side delay prevents thundering herd effects and helps the system recover. Clients should still respect the `Retry-After` header and use exponential backoff for best results. > note: > > This response code is issued based on *global* system capacity. It does not > mean that your account has been rate limited or that you individually > have sent too many requests. #### `5xx` Server Errors A status code in the [`5xx` range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) indicates a server error. These errors are typically transient and will be resolved soon. --- # Async API Source: https://docs.prodia.com/reference/async/ The asynchronous polling-style API enables easy integration of long duration workflows, particularly video generation. Unlike the synchronous `/v2/job` endpoint which blocks until completion, the async API returns immediately with a job ID that you can poll to check progress and retrieve outputs. > caution: > > This API is still in beta! ## Endpoints ### `POST /v2/job/async` Create Async Job Creates a new async job and returns immediately with the job metadata. The job will be processed in the background. **Request:** Same as synchronous `/v2/job` - supports both `application/json` and `multipart/form-data` content types. The `?price=true` query parameter is also supported (see [Query Parameters](https://docs.prodia.com/reference/inference/#query-parameters)). **Response:** `201 Created` with the full job JSON. The response includes the server-generated `id` field that you need for polling: ```json title="201 response" { "type": "inference.veo.fast.txt2vid.v1", "id": "c83d7027-240a-484a-aeba-96014e568711", "created_at": "2025-01-01T00:00:14.885Z", "updated_at": "2025-01-01T00:00:14.885Z", "expires_at": "2025-01-01T00:01:14.885Z", "state": { "current": "processing" }, "config": { "prompt": "Running in the woods with a dog.", "aspect_ratio": "16:9", "resolution": "720p", "generate_audio": true } } ``` > note: > > Not all job types support async execution. If a job type doesn't permit async, > you'll receive a `400 Bad Request` with a message indicating you should use the > sync API instead. ### `GET /v2/job/async/:id/job.state.current` Get Job State Returns the current state of the job as plain text. Use this for efficient polling. **States:** - `processing` - Job is currently being processed - `processed` - Job completed successfully - `failed` - Job encountered an error > note: > > Async jobs use the state `processed` (not `completed`) when successful. This > differs from the synchronous API which uses `completed`. ### `GET /v2/job/async/:id/job.json` Get Job Metadata Returns the full job JSON including configuration, timestamps, metrics, and error information (if failed). ### `GET /v2/job/async/:id/output` List Output Files Returns a list of output files produced by the job. ### `GET /v2/job/async/:id/output/:filename` Download Output Downloads a specific output file (e.g., `video.mp4`). ## Job Expiry Async job results are stored temporarily and *expire after 1 hour*. After expiry, all GET endpoints for that job will return `404 Not Found`. Clients should download outputs promptly after the job completes. The `expires_at` field in the job result indicates the exact expiry time. ## Status Codes | Code | Description | | ----- | ------------------------------------------------------------------------- | | `201` | Job created successfully (POST /v2/job/async) | | `200` | Request successful (GET endpoints) | | `400` | Bad request - invalid job configuration or job type doesn't support async | | `401` | Unauthorized - missing or invalid authentication | | `404` | Job not found or expired | | `429` | Too many requests - exceeded async job limit or no capacity | ## Example ### requests Create the following `main.py` ```python title="main.py" import json import os import sys import time import requests from requests.adapters import HTTPAdapter, Retry prodia_token = os.getenv('PRODIA_TOKEN') prodia_url = 'https://inference.prodia.com/v2/job/async' session = requests.Session() retries = Retry(allowed_methods=None, status_forcelist=Retry.RETRY_AFTER_STATUS_CODES) session.mount('http://', HTTPAdapter(max_retries=retries)) session.mount('https://', HTTPAdapter(max_retries=retries)) session.headers.update({'Authorization': f"Bearer {prodia_token}"}) headers = { 'Accept': 'video/mp4', } job = json.loads('''{ "type": "inference.veo.fast.txt2vid.v1", "config": { "prompt": "Running in the woods with a dog.", "aspect_ratio": "16:9", "resolution": "720p", "generate_audio": true } }''') res = session.post(prodia_url, headers=headers, json=job) print(f"Request ID: {res.headers['x-request-id']}") print(f"Status: {res.status_code}") if res.status_code != 201: print(res.text) sys.exit(1) job = res.json() job_id = job['id'] job_status = job['state']['current'] print(f"Job ID: {job_id}") print(f"Job Status: {job_status}") while job_status == 'processing': time.sleep(1) res = session.get(f"{prodia_url}/{job_id}/job.state.current") if res.status_code != 200: print(res.text) sys.exit(1) job_status = res.text print(f"Job Status: {job_status}") if job_status != 'processed': res = session.get(f"{prodia_url}/{job_id}/job.json") if res.status_code != 200: print(res.text) sys.exit(1) print(res.json()) sys.exit(1) res = session.get(f"{prodia_url}/{job_id}/output/video.mp4") if res.status_code != 200: print(res.text) sys.exit(1) with open('output.mp4', 'wb') as f: f.write(res.content) print('Output file: output.mp4') ``` ### axios Create the following `main.js` ```javascript title="main.js" const axios = require('axios'); const axiosRetry = require('axios-retry').default; const fs = require('node:fs'); async function main() { axiosRetry(axios, { retries: 3, retryCondition: (error) => { return [413, 429, 503].includes(error.response?.status); }, }); let job = { "type": "inference.veo.fast.txt2vid.v1", "config": { "prompt": "Running in the woods with a dog.", "aspect_ratio": "16:9", "resolution": "720p", "generate_audio": true } }; let res = await axios({ method: 'POST', url: 'https://inference.prodia.com/v2/job/async', headers: { 'Accept': 'video/mp4', 'Authorization': `Bearer ${process.env.PRODIA_TOKEN}`, }, data: job, }); job = res.data; let jobStatus = job.state.current; console.log(`Job ID: ${job.id}`); console.log(`Job Status: ${jobStatus}`); while (jobStatus == 'processing') { await new Promise(resolve => setTimeout(resolve, 1000)); res = await axios({ method: 'GET', url: `https://inference.prodia.com/v2/job/async/${job.id}/job.state.current`, headers: { 'Authorization': `Bearer ${process.env.PRODIA_TOKEN}`, }, }); jobStatus = res.data; console.log(`Job Status: ${jobStatus}`) } if (jobStatus != 'processed') { console.log(job); process.exit(1); } res = await axios({ method: 'GET', url: `https://inference.prodia.com/v2/job/async/${job.id}/output/video.mp4`, headers: { 'Authorization': `Bearer ${process.env.PRODIA_TOKEN}`, }, responseType: 'arraybuffer', }); fs.writeFileSync('output.mp4', res.data); console.log('Output file: output.mp4'); } main().catch((error) => { console.error(error); process.exitCode = 1; }); ``` > note: > > Outputs are only available for 1 hour. See [Job Expiry](https://docs.prodia.com/reference/async/#job-expiry) above. --- # Job Pricing Source: https://docs.prodia.com/reference/price/ The `/v2/job` and `/v2/job/async` endpoints support an optional `price` query parameter that includes the dollar cost of a completed job in the response. This is useful for gateways and platforms that need to accurately pass through generation costs to their users. ## Usage Add `?price=true` to the job endpoint URL. The pricing flag works with both the synchronous and asynchronous APIs. ```javascript title="main.js" const token = process.env.PRODIA_TOKEN; const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); let response; do { response = await fetch("https://inference.prodia.com/v2/job?price=true", { method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", Accept: "multipart/form-data", }, body: JSON.stringify({ type: "inference.flux-fast.schnell.txt2img.v2", config: { prompt: "puppies in a cloud, 4k", }, }), }); if (response.status === 429) { const retryAfter = Number(response.headers.get("Retry-After")) || 1; await sleep(retryAfter * 1000); } } while (response.status === 429); const formData = await response.formData(); const job = JSON.parse(await formData.get("job").text()); const output = formData.get("output"); console.log(job.price); // { product: "inference-flux-schnell-large-steps-4", dollars: 0.0025 } const image = new Uint8Array(await output.arrayBuffer()); // write image to disk, display in browser, etc. ``` The `?price=true` parameter also works with [`/v2/job/async`](https://docs.prodia.com/reference/async/). ## Response When `?price=true` is set and the job completes successfully, the job result includes an additional `price` field: ```json title="job.json" {17-20} { "type": "inference.flux-fast.schnell.txt2img.v2", "created_at": "2026-02-10T12:30:00.612Z", "updated_at": "2026-02-10T12:30:01.108Z", "expires_at": "2026-02-10T12:35:00.612Z", "id": "bf610a8d-f055-41bd-aa16-894c913d1bb3", "state": { "current": "completed" }, "config": { "prompt": "puppies in a cloud, 4k", "steps": 4, "width": 1024, "height": 1024 }, "metrics": { "elapsed": 0.29949116706848145, "ips": 13.355986552636335 }, "price": { "product": "inference-flux-schnell-large-steps-4", "dollars": 0.0025 } } ``` ### `price` Object | Field | Type | Description | | --------- | ------ | ------------------------------------------- | | `product` | string | The billing product identifier for this job | | `dollars` | number | The cost of the job in USD | > note: > > The `price` field is only present when `?price=true` is set **and** the job > completes successfully. If the job fails, no pricing information is returned. > tip: > > Pricing is calculated after the job finishes, so the cost reflects the actual > work performed — including the specific job type, configuration, and any > resources consumed. --- # inference.birefnet.segment.v1 Source: https://docs.prodia.com/job-types/inference-birefnet-segment-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.birefnet.segment.v1", "inference.remove-background.v1", "inference.mask-background.v1" ] }, "config": { "type": "object", "properties": { "contour": { "description": "Enable contour detection for a crisp outline mask style.", "type": "boolean", "default": false }, "contour_tolerance": { "description": "Increase contour tolerance to smooth and expand the mask.", "type": "integer", "default": 0, "minimum": 0, "maximum": 128 } } } } } ``` --- # inference.facerestore.v1 Source: https://docs.prodia.com/job-types/inference-facerestore-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.facerestore.v1" ] }, "config": { "type": "object", "properties": { "upscale": { "type": "number", "enum": [ 1 ], "default": 1 } } } } } ``` --- # inference.flux-2.dev.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-dev-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.dev.img2img.v0", "inference.flux-2.dev.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Input images to transform. Up to 8 images can be provided. Each image must be ≤1920x1920 pixels." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 1920, "description": "Output image width in pixels. If not specified, defaults to first input image's width." }, "height": { "type": "integer", "minimum": 512, "maximum": 1920, "description": "Output image height in pixels. If not specified, defaults to first input image's height." }, "steps": { "type": "integer", "minimum": 1, "maximum": 50, "default": 28, "description": "Number of inference steps." }, "guidance_scale": { "type": "number", "minimum": 1, "maximum": 10, "default": 4, "description": "Guidance scale for classifier-free guidance." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.dev.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-dev-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.dev.txt2img.v0", "inference.flux-2.dev.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 1920, "default": 1024, "description": "Output image width in pixels." }, "height": { "type": "integer", "minimum": 512, "maximum": 1920, "default": 1024, "description": "Output image height in pixels." }, "steps": { "type": "integer", "minimum": 1, "maximum": 50, "default": 28, "description": "Number of inference steps." }, "guidance_scale": { "type": "number", "minimum": 1, "maximum": 10, "default": 4, "description": "Guidance scale for classifier-free guidance." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.flex.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-flex-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.flex.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string", "format": "filename", "example": "input.jpg", "description": "The filename of an input image." }, "description": "Input images for editing. Flex model supports up to 10 images. If not specified, uses uploaded files." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "Replace the background with a forest" ], "description": "Text description of the edit to be applied. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "description": "Output width in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "height": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "description": "Output height in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." }, "steps": { "type": "integer", "minimum": 1, "maximum": 50, "default": 50, "description": "Number of inference iterations." }, "guidance": { "type": "number", "minimum": 1.5, "maximum": 10, "default": 4.5, "description": "Prompt adherence control. Higher values follow the prompt more closely." } } } } } ``` --- # inference.flux-2.flex.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-flex-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.flex.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "default": 1024, "description": "Output width in pixels. Must be a multiple of 16." }, "height": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "default": 1024, "description": "Output height in pixels. Must be a multiple of 16." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." }, "steps": { "type": "integer", "minimum": 1, "maximum": 50, "default": 50, "description": "Number of inference iterations." }, "guidance": { "type": "number", "minimum": 1.5, "maximum": 10, "default": 4.5, "description": "Prompt adherence control. Higher values follow the prompt more closely." } } } } } ``` --- # inference.flux-2.klein.4b.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-4b-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.img2img.v1", "inference.flux-2.klein.9b.img2img.v1", "inference.flux-2.klein.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Input images to transform. Up to 8 images can be provided. Each image must be ≤1920x1920 pixels." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image width in pixels. If not specified, defaults to first input image's width." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image height in pixels. If not specified, defaults to first input image's height." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.klein.4b.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-4b-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.txt2img.v1", "inference.flux-2.klein.9b.txt2img.v1", "inference.flux-2.klein.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image width in pixels." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image height in pixels." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.klein.9b.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-9b-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.img2img.v1", "inference.flux-2.klein.9b.img2img.v1", "inference.flux-2.klein.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Input images to transform. Up to 8 images can be provided. Each image must be ≤1920x1920 pixels." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image width in pixels. If not specified, defaults to first input image's width." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image height in pixels. If not specified, defaults to first input image's height." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.klein.9b.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-9b-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.txt2img.v1", "inference.flux-2.klein.9b.txt2img.v1", "inference.flux-2.klein.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image width in pixels." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image height in pixels." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.klein.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.img2img.v1", "inference.flux-2.klein.9b.img2img.v1", "inference.flux-2.klein.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Input images to transform. Up to 8 images can be provided. Each image must be ≤1920x1920 pixels." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image width in pixels. If not specified, defaults to first input image's width." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "description": "Output image height in pixels. If not specified, defaults to first input image's height." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.klein.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-klein-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.klein.4b.txt2img.v1", "inference.flux-2.klein.9b.txt2img.v1", "inference.flux-2.klein.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image width in pixels." }, "height": { "type": "integer", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Output image height in pixels." }, "steps": { "type": "integer", "minimum": 1, "maximum": 4, "default": 4, "description": "Number of inference steps for distilled models (4b/9b)." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset to apply to the prompt." }, "seed": { "type": "integer", "minimum": 0, "maximum": 18446744073709552000, "description": "Random seed for reproducible results." } } } } } ``` --- # inference.flux-2.max.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-max-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.max.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.jpg", "description": "The filename of an input image." }, "description": "Input images for editing. Max model supports up to 8 images. If not specified, uses uploaded files." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "Replace the background with a forest" ], "description": "Text description of the edit to be applied. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 256, "maximum": 2048, "multipleOf": 16, "description": "Output width in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "height": { "type": "integer", "minimum": 256, "maximum": 2048, "multipleOf": 16, "description": "Output height in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." } } } } } ``` --- # inference.flux-2.max.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-max-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.max.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 256, "maximum": 2048, "multipleOf": 16, "default": 1024, "description": "Output width in pixels. Must be a multiple of 16." }, "height": { "type": "integer", "minimum": 256, "maximum": 2048, "multipleOf": 16, "default": 1024, "description": "Output height in pixels. Must be a multiple of 16." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." } } } } } ``` --- # inference.flux-2.pro.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-pro-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.pro.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "string", "format": "filename", "example": "input.jpg", "description": "The filename of an input image." }, "description": "Input images for editing. Pro model supports up to 8 images (9MP combined). If not specified, uses uploaded files." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "Replace the background with a forest" ], "description": "Text description of the edit to be applied. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "description": "Output width in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "height": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "description": "Output height in pixels. Must be a multiple of 16. If not specified, uses input image dimensions." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." } } } } } ``` --- # inference.flux-2.pro.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-2-pro-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-2.pro.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "examples": [ "A serene mountain landscape at sunset, photorealistic, 4k" ], "description": "Text description of the image to generate. Supports up to 32K tokens." }, "width": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "default": 1024, "description": "Output width in pixels. Must be a multiple of 16." }, "height": { "type": "integer", "minimum": 64, "maximum": 4096, "multipleOf": 16, "default": 1024, "description": "Output height in pixels. Must be a multiple of 16." }, "seed": { "type": "integer", "description": "Random seed for reproducible results." }, "safety_tolerance": { "type": "integer", "minimum": 0, "maximum": 5, "default": 2, "description": "Safety filter tolerance level. 0 is strict, 5 is permissive." } } } } } ``` --- # inference.flux-control.dev.ghibli.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-control-dev-ghibli-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-control.dev.ghibli.img2img.v1" ] }, "config": { "type": "object", "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "guidance_scale": { "type": "number", "default": 3.5 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-fast.dev-kontext.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-fast-dev-kontext-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.flux-fast.dev-kontext.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "width": { "type": "number", "multipleOf": 32, "minimum": 512, "maximum": 1040, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 512, "maximum": 1040, "default": 1024 }, "steps": { "type": "integer", "default": 30, "minimum": 1, "maximum": 50, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "guidance_scale": { "type": "number", "default": 2.5 }, "progressive": { "type": "boolean", "default": false, "description": "When using JPEG output, return a progressive JPEG." } } } } } ``` --- # inference.flux-fast.dev.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-fast-dev-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.flux-fast.dev.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "width": { "type": "number", "minimum": 512, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "minimum": 512, "maximum": 1920, "default": 1024 }, "steps": { "type": "integer", "default": 28, "minimum": 1, "maximum": 200, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "guidance_scale": { "type": "number", "default": 3.5, "minimum": 0, "maximum": 100 }, "progressive": { "type": "boolean", "default": false, "description": "When using JPEG output, return a progressive JPEG." } } } } } ``` --- # inference.flux-fast.schnell.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-fast-schnell-txt2img-v1/ The `inference.flux-fast.schnell.txt2img.v1` job generates an image based on the text prompt provided in the configuration. This job type is limited to fixed resolutions and defaults to the `1024x1024` resolution. ```json { "type": "inference.flux-fast.schnell.txt2img.v1", "config": { "prompt": "puppies in the clouds, 4k", } } ``` ```json { "type": "inference.flux-fast.schnell.txt2img.v1", "config": { "prompt": "puppies in the clouds, 4k", "resolution": "1024x576" } } ``` ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.flux-fast.schnell.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "steps": { "type": "integer", "default": 4, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "resolution": { "type": "string", "default": "1024x1024", "enum": [ "1024x1024", "1024x768", "1024x576", "768x1024", "640x640", "576x1024", "512x512" ], "description": "Output image resolution WxH" }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "progressive": { "type": "boolean", "default": false, "description": "When using JPEG output, return a progressive JPEG." } } } } } ``` --- # inference.flux-fast.schnell.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-fast-schnell-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.flux-fast.schnell.txt2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "width": { "type": "number", "minimum": 256, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "minimum": 256, "maximum": 1920, "default": 1024 }, "steps": { "type": "integer", "default": 4, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "progressive": { "type": "boolean", "default": false, "description": "When using JPEG output, return a progressive JPEG." } } } } } ``` --- # inference.flux-fill.dev.v1 Source: https://docs.prodia.com/job-types/inference-flux-fill-dev-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-fill.dev.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "hyper": { "description": "Enable/disable Hyper LoRA", "type": "boolean", "default": true }, "guidance_scale": { "type": "number", "default": 28 }, "steps": { "type": "integer", "default": 13, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 } } } } } ``` --- # inference.flux-kontext.max.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-kontext-max-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.img2img.v1", "inference.flux-kontext.max.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 2, 0 being most strict, 2 being least strict.", "type": "integer", "default": 2, "minimum": 0, "maximum": 2 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.max.img2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-kontext-max-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.img2img.v2", "inference.flux-kontext.max.img2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image that will be edited." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "pattern": "^[1-9][0-9]*:[1-9][0-9]*$" }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 2, 0 being most strict, 2 being least strict.", "type": "integer", "default": 2, "minimum": 0, "maximum": 2 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.max.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-kontext-max-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.txt2img.v1", "inference.flux-kontext.max.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.max.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-kontext-max-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.txt2img.v2", "inference.flux-kontext.max.txt2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "pattern": "^[1-9][0-9]*:[1-9][0-9]*$" }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.pro.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-kontext-pro-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.img2img.v1", "inference.flux-kontext.max.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 2, 0 being most strict, 2 being least strict.", "type": "integer", "default": 2, "minimum": 0, "maximum": 2 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.pro.img2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-kontext-pro-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.img2img.v2", "inference.flux-kontext.max.img2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image that will be edited." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "pattern": "^[1-9][0-9]*:[1-9][0-9]*$" }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 2, 0 being most strict, 2 being least strict.", "type": "integer", "default": 2, "minimum": 0, "maximum": 2 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.pro.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-kontext-pro-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.txt2img.v1", "inference.flux-kontext.max.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux-kontext.pro.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-kontext-pro-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux-kontext.pro.txt2img.v2", "inference.flux-kontext.max.txt2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "pattern": "^[1-9][0-9]*:[1-9][0-9]*$" }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] } } } } } ``` --- # inference.flux.dev.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-dev-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v1", "inference.flux.dev.img2img.v1", "inference.flux.dev.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3 }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 } } } } } ``` --- # inference.flux.dev.img2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-dev-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v2", "inference.flux.dev.img2img.v2", "inference.flux.dev.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.85, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3.5 }, "steps": { "type": "integer", "default": 28, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 }, "height": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 } } } } } ``` --- # inference.flux.dev.inpainting.v1 Source: https://docs.prodia.com/job-types/inference-flux-dev-inpainting-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v1", "inference.flux.dev.img2img.v1", "inference.flux.dev.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3 }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 } } } } } ``` --- # inference.flux.dev.inpainting.v2 Source: https://docs.prodia.com/job-types/inference-flux-dev-inpainting-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v2", "inference.flux.dev.img2img.v2", "inference.flux.dev.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.85, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3.5 }, "steps": { "type": "integer", "default": 28, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 }, "height": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 } } } } } ``` --- # inference.flux.dev.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-dev-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v1", "inference.flux.dev.img2img.v1", "inference.flux.dev.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3 }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024 } } } } } ``` --- # inference.flux.dev.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-dev-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.dev.txt2img.v2", "inference.flux.dev.img2img.v2", "inference.flux.dev.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] } }, "strength": { "type": "number", "default": 0.85, "minimum": 0, "maximum": 1 }, "guidance_scale": { "type": "number", "default": 3.5 }, "steps": { "type": "integer", "default": 28, "minimum": 1, "maximum": 100 }, "max_sequence_length": { "type": "integer", "default": 512, "minimum": 1, "maximum": 1024 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 }, "height": { "type": "number", "minimum": 512, "maximum": 1280, "default": 1024 } } } } } ``` --- # inference.flux.pro11.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-pro11-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.pro11.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1440, "default": 1024 }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1440, "default": 768 } } } } } ``` --- # inference.flux.pro11ultra.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-pro11ultra-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.pro11ultra.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt", "image_prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "9:21" ] }, "raw": { "description": "generate less processed, more natural-looking images", "type": "boolean", "default": false }, "image_prompt": { "description": "optional image to remix in base64 format", "type": "string", "format": "filename", "example": "reference.png" }, "image_prompt_strength": { "description": "blend between the prompt and the image prompt", "type": "number", "default": 0.1, "minimum": 0, "maximum": 1 } } } } } ``` --- # inference.flux.pro11ultra.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-pro11ultra-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.pro11ultra.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ] }, "prompt_upsampling": { "description": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.", "type": "boolean", "default": false }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "safety_tolerance": { "description": "Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.", "type": "integer", "default": 4, "minimum": 0, "maximum": 6 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "aspect_ratio": { "description": "Aspect Ratio", "type": "string", "enum": [ "21:9", "9:21" ] }, "raw": { "description": "generate less processed, more natural-looking images", "type": "boolean", "default": false } } } } } ``` --- # inference.flux.schnell.img2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-schnell-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v1", "inference.flux.schnell.img2img.v1", "inference.flux.schnell.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 4, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Width of the output image in pixels." }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.flux.schnell.img2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-schnell-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v2", "inference.flux.schnell.img2img.v2", "inference.flux.schnell.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 2, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Width of the output image in pixels." }, "height": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.flux.schnell.inpainting.v1 Source: https://docs.prodia.com/job-types/inference-flux-schnell-inpainting-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v1", "inference.flux.schnell.img2img.v1", "inference.flux.schnell.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 4, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Width of the output image in pixels." }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.flux.schnell.inpainting.v2 Source: https://docs.prodia.com/job-types/inference-flux-schnell-inpainting-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v2", "inference.flux.schnell.img2img.v2", "inference.flux.schnell.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 2, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Width of the output image in pixels." }, "height": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.flux.schnell.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-flux-schnell-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v1", "inference.flux.schnell.img2img.v1", "inference.flux.schnell.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 4, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Width of the output image in pixels." }, "height": { "type": "number", "multipleOf": 32, "minimum": 256, "maximum": 1920, "default": 1024, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.flux.schnell.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-flux-schnell-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.flux.schnell.txt2img.v2", "inference.flux.schnell.img2img.v2", "inference.flux.schnell.inpainting.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "Input description of desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Apply a visual theme to your output image." }, "loras": { "type": "array", "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "prodia/lora/flux/2_5D_anime@v1", "prodia/lora/flux/3D_anime@v1", "prodia/lora/flux/amateur_photography@v1", "prodia/lora/flux/dreamy_semi_realism@v1", "prodia/lora/flux/dutch_golden_age@v1", "prodia/lora/flux/levels/analog@v1", "prodia/lora/flux/levels/counter_strike@v1", "prodia/lora/flux/levels/disposable_camera@v1", "prodia/lora/flux/levels/gta@v1", "prodia/lora/flux/levels/lomography@v1", "prodia/lora/flux/levels/neon_tokyo@v1", "prodia/lora/flux/xlabs-ai/realism@v1" ] }, "description": "Augment the output with a LoRa model." }, "steps": { "type": "integer", "default": 2, "minimum": 1, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducability." }, "width": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Width of the output image in pixels." }, "height": { "type": "number", "default": 512, "minimum": 256, "maximum": 1920, "multipleOf": 32, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.gemini-3-1-flash.img2img.v1 Source: https://docs.prodia.com/job-types/inference-gemini-3-1-flash-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.gemini-3-1-flash.img2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 14, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Reference images for image-to-image generation. Up to 14 images can be provided." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "examples": [ "Transform this into a watercolor painting" ], "description": "A description of the desired output image." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output image." }, "resolution": { "type": "string", "default": "1K", "enum": [ "1K", "2K", "4K" ], "description": "Resolution/image size of output. Use uppercase K." }, "google_search": { "type": "boolean", "default": false, "description": "Enable Google Search grounding to inform image generation with real-world information." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.gemini-3-1-flash.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-gemini-3-1-flash-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.gemini-3-1-flash.txt2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "examples": [ "A hyper-realistic infographic of a gourmet cheeseburger" ], "description": "A description of the desired output image." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output image." }, "resolution": { "type": "string", "default": "1K", "enum": [ "1K", "2K", "4K" ], "description": "Resolution/image size of output. Use uppercase K." }, "google_search": { "type": "boolean", "default": false, "description": "Enable Google Search grounding to inform image generation with real-world information." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.gemini-3-pro.img2img.v1 Source: https://docs.prodia.com/job-types/inference-gemini-3-pro-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.gemini-3-pro.img2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Reference images for image-to-image generation. Up to 3 images can be provided." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "examples": [ "Transform this into a watercolor painting" ], "description": "A description of the desired output image." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output image." }, "resolution": { "type": "string", "default": "1K", "enum": [ "1K", "2K", "4K" ], "description": "Resolution/image size of output. Use uppercase K." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.gemini-3-pro.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-gemini-3-pro-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.gemini-3-pro.txt2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "examples": [ "A hyper-realistic infographic of a gourmet cheeseburger" ], "description": "A description of the desired output image." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output image." }, "resolution": { "type": "string", "default": "1K", "enum": [ "1K", "2K", "4K" ], "description": "Resolution/image size of output. Use uppercase K." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.hypir.upscale.v1 Source: https://docs.prodia.com/job-types/inference-hypir-upscale-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.hypir.upscale.v1" ] }, "config": { "type": "object", "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the target image." }, "factor": { "type": "number", "enum": [ 2 ], "default": 2, "description": "Upscale factor is how many times larger the upscaled image will be (e.g. 2x)." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "description": "A description of your image." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset applies a common style to your prompt." }, "patch_size": { "type": "number", "default": 512, "minimum": 512, "maximum": 1024, "description": "Tiling patch size." }, "stride": { "type": "number", "default": 256, "minimum": 256, "maximum": 512, "description": "Tiling stride length." }, "model_t": { "type": "number", "default": 200, "minimum": 1, "maximum": 400, "description": "Model input timestep." }, "coeff_t": { "type": "number", "default": 200, "minimum": 1, "maximum": 400, "description": "Timestep used to calculate the conversion coefficients from noise to data." } } } } } ``` --- # inference.kling.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-kling-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.kling.txt2vid.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "model": { "type": "string", "default": "kling-v1", "enum": [ "kling-v1", "kling-v1-6", "kling-v2-master", "kling-v2-1", "kling-v2-1-master" ] }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ] }, "negative_prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ] }, "cfg_scale": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1 }, "mode": { "type": "string", "default": "std", "enum": [ "std", "pro" ] }, "camera_control": { "type": "object", "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "simple", "down_back", "forward_up", "right_turn_forward", "left_turn_forward" ] }, "config": { "type": "object", "additionalProperties": false, "properties": { "horizontal": { "type": "number", "minimum": -10, "maximum": 10 }, "vertical": { "type": "number", "minimum": -10, "maximum": 10 }, "pan": { "type": "number", "minimum": -10, "maximum": 10 }, "tilt": { "type": "number", "minimum": -10, "maximum": 10 }, "roll": { "type": "number", "minimum": -10, "maximum": 10 }, "zoom": { "type": "number", "minimum": -10, "maximum": 10 } } } } }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16", "1:1" ] }, "duration": { "type": "string", "default": "5", "enum": [ "5", "10" ] } } } } } ``` --- # inference.mask-background.v1 Source: https://docs.prodia.com/job-types/inference-mask-background-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.birefnet.segment.v1", "inference.remove-background.v1", "inference.mask-background.v1" ] }, "config": { "type": "object", "properties": { "contour": { "description": "Enable contour detection for a crisp outline mask style.", "type": "boolean", "default": false }, "contour_tolerance": { "description": "Increase contour tolerance to smooth and expand the mask.", "type": "integer", "default": 0, "minimum": 0, "maximum": 128 } } } } } ``` --- # inference.minimax.h3.base.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-base-img2vid-v1/ The `inference.minimax.h3.base.img2vid.v1` job animates a provided keyframe into a video with synchronized stereo audio (24 fps, canvas following the keyframe's aspect ratio) using the MiniMax H3 (Hailuo-03) model. The `base` tier is the highest-quality option. Upload the keyframe as a job input and reference its filename with `first_frame`; an optional `last_frame` pins the closing frame too. Naming is optional: with the fields absent, the first uploaded input is the first frame and a second upload, when present, the last frame: ```json { "type": "inference.minimax.h3.base.img2vid.v1", "config": { "prompt": "the scene comes to life, camera slowly pushing in", "first_frame": "input.jpg", "duration": 8 } } ``` `duration`, `resolution` and `seed` behave as in txt2vid (whole seconds 4–15, rounded up to the 17n+5 frame grid; outputs run 4.46–15.08 s; only the default `768P` resolution is valid). ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.img2vid.v0", "inference.minimax.h3.fast.img2vid.v0", "inference.minimax.h3.base.img2vid.v1", "inference.minimax.h3.fast.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video. Optional: defaults to the first uploaded input." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video. Optional: defaults to the second uploaded input, when present." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "adaptive" ], "default": "adaptive", "description": "The aspect ratio always derives from the input image, so only \"adaptive\" is accepted." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the aspect ratio of the input image." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.base.ref2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-base-ref2vid-v1/ The `inference.minimax.h3.base.ref2vid.v1` job generates a video with synchronized stereo audio featuring the identity from reference images (1344×768, 24 fps) using the MiniMax H3 (Hailuo-03) model. The `base` tier is the highest-quality option. Upload the references as job inputs and list their filenames in `references`, in the order the model should read them. Each reference's role is derived from its blob content type — image/*, video/* and audio/\* become subject/style, motion, and voice/music references respectively. Up to 9 images, 3 videos and 3 audio files (15 total); audio never on its own. The field itself is optional: with it absent, every uploaded input is a reference, in upload order: ```json { "type": "inference.minimax.h3.base.ref2vid.v1", "config": { "prompt": "the subject walks through a sunlit park, birds chirping", "references": ["face.jpg", "profile.jpg"], "duration": 6 } } ``` Images are JPEG, PNG, WEBP, HEIC or HEIF, 30MB each. Videos are MP4 or MOV with H.264/H.265, 50MB each, 2-15s each and 15s combined, 23.976-60 fps. Audio is WAV or MP3, 15MB each, 2-15s each and 15s combined. Image and video frames must be 256-5760px per side with a width/height ratio between 0.4 and 2.5. `duration`, `resolution` and `seed` behave as in txt2vid (whole seconds 4–15, rounded up to the 17n+5 frame grid; outputs run 4.46–15.08 s; only the default `768P` resolution is valid). The output aspect ratio derives from the first visual reference (snapped to the nearest supported ratio) unless `aspect_ratio` (one of 16:9, 4:3, 1:1, 3:4, 9:16, 21:9) is set, which overrides it. ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.ref2vid.v0", "inference.minimax.h3.fast.ref2vid.v0", "inference.minimax.h3.base.ref2vid.v1", "inference.minimax.h3.fast.ref2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "references": { "type": "array", "minItems": 1, "maxItems": 15, "items": { "type": "string", "format": "filename", "example": "subject.png", "description": "Filename of a reference file." }, "description": "Reference files to feature in the video, in the order the model should read them. The role of each reference is derived from its content type: images, videos, and audio act as subject/style, motion, and voice/music references respectively. Up to 9 images (JPEG, PNG, WEBP, HEIC, or HEIF; 30MB each; 256-5760px per side; width/height ratio 0.4-2.5), 3 videos (MP4 or MOV with H.264/H.265; 50MB each; 2-15s each and 15s combined; same pixel and ratio bounds; 23.976-60 fps), and 3 audio files (WAV or MP3; 15MB each; 2-15s each and 15s combined); audio never on its own. Optional: with the field absent, every uploaded input is a reference, in upload order." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "adaptive", "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "adaptive", "description": "Controls the approximate aspect ratio of the resulting video. With \"adaptive\" (the default), the aspect ratio derives from the first visual reference (snapped to the nearest supported ratio); an explicit ratio overrides it." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the aspect ratio of the first visual reference." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.base.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-base-txt2vid-v1/ The `inference.minimax.h3.base.txt2vid.v1` job generates a video with synchronized stereo audio (1344×768, 24 fps, AAC 32 kHz) from a text prompt using the MiniMax H3 (Hailuo-03) model. The `base` tier is the highest-quality option. ```json { "type": "inference.minimax.h3.base.txt2vid.v1", "config": { "prompt": "a red fox trotting through a snowy pine forest at golden hour" } } ``` `duration` (whole seconds, 4–15), `aspect_ratio` (one of 16:9, 4:3, 1:1, 3:4, 9:16, 21:9; default 16:9) and `seed` can be set. Durations round **up** to the model's frame grid (17n+5 frames at 24 fps): 4 s returns 4.46 s, 15 s returns 15.08 s, and values outside 4–15 fail validation. The same seed reproduces the same video within a tier. `resolution` is accepted for parity with other MiniMax job types, but only its default `768P` is valid: this job type generates at a 768 px short edge only. Typical latency: roughly 45 s for a 5 s clip, \~220 s for a 15 s one. ```json { "type": "inference.minimax.h3.base.txt2vid.v1", "config": { "prompt": "a red fox trotting through a snowy pine forest at golden hour", "duration": 10, "seed": 42 } } ``` ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.txt2vid.v0", "inference.minimax.h3.fast.txt2vid.v0", "inference.minimax.h3.base.txt2vid.v1", "inference.minimax.h3.fast.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the selected aspect ratio." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.fast.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-fast-img2vid-v1/ The `inference.minimax.h3.fast.img2vid.v1` job animates a provided keyframe into a video with synchronized stereo audio (24 fps, canvas following the keyframe's aspect ratio) using the MiniMax H3 (Hailuo-03) model. The `fast` tier is the fastest option; outputs are equally coherent but not pixel-identical to `base` at the same seed. Upload the keyframe as a job input and reference its filename with `first_frame`; an optional `last_frame` pins the closing frame too. Naming is optional: with the fields absent, the first uploaded input is the first frame and a second upload, when present, the last frame: ```json { "type": "inference.minimax.h3.fast.img2vid.v1", "config": { "prompt": "the scene comes to life, camera slowly pushing in", "first_frame": "input.jpg", "duration": 8 } } ``` `duration`, `resolution` and `seed` behave as in txt2vid (whole seconds 4–15, rounded up to the 17n+5 frame grid; outputs run 4.46–15.08 s; only the default `768P` resolution is valid). ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.img2vid.v0", "inference.minimax.h3.fast.img2vid.v0", "inference.minimax.h3.base.img2vid.v1", "inference.minimax.h3.fast.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video. Optional: defaults to the first uploaded input." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video. Optional: defaults to the second uploaded input, when present." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "adaptive" ], "default": "adaptive", "description": "The aspect ratio always derives from the input image, so only \"adaptive\" is accepted." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the aspect ratio of the input image." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.fast.ref2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-fast-ref2vid-v1/ The `inference.minimax.h3.fast.ref2vid.v1` job generates a video with synchronized stereo audio featuring the identity from reference images (1344×768, 24 fps) using the MiniMax H3 (Hailuo-03) model. The `fast` tier is the fastest option; outputs are equally coherent but not pixel-identical to `base` at the same seed. Upload the references as job inputs and list their filenames in `references`, in the order the model should read them. Each reference's role is derived from its blob content type — image/*, video/* and audio/\* become subject/style, motion, and voice/music references respectively. Up to 9 images, 3 videos and 3 audio files (15 total); audio never on its own. The field itself is optional: with it absent, every uploaded input is a reference, in upload order: ```json { "type": "inference.minimax.h3.fast.ref2vid.v1", "config": { "prompt": "the subject walks through a sunlit park, birds chirping", "references": ["face.jpg", "profile.jpg"], "duration": 6 } } ``` Images are JPEG, PNG, WEBP, HEIC or HEIF, 30MB each. Videos are MP4 or MOV with H.264/H.265, 50MB each, 2-15s each and 15s combined, 23.976-60 fps. Audio is WAV or MP3, 15MB each, 2-15s each and 15s combined. Image and video frames must be 256-5760px per side with a width/height ratio between 0.4 and 2.5. `duration`, `resolution` and `seed` behave as in txt2vid (whole seconds 4–15, rounded up to the 17n+5 frame grid; outputs run 4.46–15.08 s; only the default `768P` resolution is valid). The output aspect ratio derives from the first visual reference (snapped to the nearest supported ratio) unless `aspect_ratio` (one of 16:9, 4:3, 1:1, 3:4, 9:16, 21:9) is set, which overrides it. ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.ref2vid.v0", "inference.minimax.h3.fast.ref2vid.v0", "inference.minimax.h3.base.ref2vid.v1", "inference.minimax.h3.fast.ref2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "references": { "type": "array", "minItems": 1, "maxItems": 15, "items": { "type": "string", "format": "filename", "example": "subject.png", "description": "Filename of a reference file." }, "description": "Reference files to feature in the video, in the order the model should read them. The role of each reference is derived from its content type: images, videos, and audio act as subject/style, motion, and voice/music references respectively. Up to 9 images (JPEG, PNG, WEBP, HEIC, or HEIF; 30MB each; 256-5760px per side; width/height ratio 0.4-2.5), 3 videos (MP4 or MOV with H.264/H.265; 50MB each; 2-15s each and 15s combined; same pixel and ratio bounds; 23.976-60 fps), and 3 audio files (WAV or MP3; 15MB each; 2-15s each and 15s combined); audio never on its own. Optional: with the field absent, every uploaded input is a reference, in upload order." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "adaptive", "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "adaptive", "description": "Controls the approximate aspect ratio of the resulting video. With \"adaptive\" (the default), the aspect ratio derives from the first visual reference (snapped to the nearest supported ratio); an explicit ratio overrides it." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the aspect ratio of the first visual reference." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.fast.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-fast-txt2vid-v1/ The `inference.minimax.h3.fast.txt2vid.v1` job generates a video with synchronized stereo audio (1344×768, 24 fps, AAC 32 kHz) from a text prompt using the MiniMax H3 (Hailuo-03) model. The `fast` tier is the fastest option; outputs are equally coherent but not pixel-identical to `base` at the same seed. ```json { "type": "inference.minimax.h3.fast.txt2vid.v1", "config": { "prompt": "a red fox trotting through a snowy pine forest at golden hour" } } ``` `duration` (whole seconds, 4–15), `aspect_ratio` (one of 16:9, 4:3, 1:1, 3:4, 9:16, 21:9; default 16:9) and `seed` can be set. Durations round **up** to the model's frame grid (17n+5 frames at 24 fps): 4 s returns 4.46 s, 15 s returns 15.08 s, and values outside 4–15 fail validation. The same seed reproduces the same video within a tier. `resolution` is accepted for parity with other MiniMax job types, but only its default `768P` is valid: this job type generates at a 768 px short edge only. Typical latency: roughly 25 s for a 5 s clip, \~105 s for a 15 s one. ```json { "type": "inference.minimax.h3.fast.txt2vid.v1", "config": { "prompt": "a red fox trotting through a snowy pine forest at golden hour", "duration": 10, "seed": 42 } } ``` ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.base.txt2vid.v0", "inference.minimax.h3.fast.txt2vid.v0", "inference.minimax.h3.base.txt2vid.v1", "inference.minimax.h3.fast.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of the desired video and audio." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds. Rounded up to the model's frame grid (4 s returns 4.46 s, 15 s returns 15.08 s)." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "resolution": { "type": "string", "enum": [ "768P" ], "default": "768P", "description": "Only 768P is supported: the video is generated at a 768px short edge; exact width and height follow the selected aspect ratio." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "Seed for reproducible generation. Random when omitted." } } } } } ``` --- # inference.minimax.h3.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-img2vid-v1/ The `inference.minimax.h3.img2vid.v1` job generates a video based on the text prompt and input image(s) provided using the MiniMax H3 (Hailuo-03) model. Input images must be set explicitly by referencing input filenames. The starting and ending frames can be controlled with `first_frame` and `last_frame`: ```json { "type": "inference.minimax.h3.img2vid.v1", "config": { "prompt": "a smooth morph from start to finish", "first_frame": "first_frame.png", "last_frame": "last_frame.png", "duration": 8 } } ``` When only one frame is provided it takes its named position: `first_frame` alone sets the starting frame and `last_frame` alone sets the ending frame. The output aspect ratio is always adaptive (derived from the input image). Content moderation is enabled by default and filters NSFW content. Set `content_moderation` to `false` to disable it. ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "content_moderation": { "type": "boolean", "default": true, "description": "Filter NSFW content using MiniMax's content moderation." }, "resolution": { "type": "string", "enum": [ "768P", "2K" ], "default": "768P", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the aspect ratio of the input image." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds." } } } } } ``` --- # inference.minimax.h3.ref2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-ref2vid-v1/ The `inference.minimax.h3.ref2vid.v1` job generates a video based on the text prompt and the reference files provided using the MiniMax H3 (Hailuo-03) model. Reference files are listed by filename in `references`. The role of each reference is implicit in the content type of the file: images become `reference_image`, videos become `reference_video`, and audio files become `reference_audio`. Up to 9 images, 3 videos, and 3 audio files (15 total) are supported, and audio references require at least one image or video reference. Per the MiniMax API's attachment rules, images are JPEG, PNG, WEBP, HEIC or HEIF (30MB each); videos are MP4 or MOV with H.264/H.265 (50MB each, 2-15s each and 15s combined, 23.976-60 fps); audio is WAV or MP3 (15MB each, 2-15s each and 15s combined); image and video frames are 256-5760px per side with a width/height ratio between 0.4 and 2.5. ```json { "type": "inference.minimax.h3.ref2vid.v1", "config": { "prompt": "the subject walking through a neon city", "references": ["subject.png"], "duration": 6 } } ``` The output aspect ratio is adaptive (derived from the input media) unless `aspect_ratio` (one of 16:9, 4:3, 1:1, 3:4, 9:16, 21:9) is set, in which case it overrides the reference-derived canvas. Content moderation is enabled by default and filters NSFW content. Set `content_moderation` to `false` to disable it. ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.ref2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt", "references" ], "additionalProperties": false, "properties": { "references": { "type": "array", "minItems": 1, "maxItems": 15, "items": { "type": "string", "format": "filename", "example": "subject.png", "description": "Filename of a reference file." }, "description": "Reference files to feature in the video. The role of each reference is derived from its content type: images, videos, and audio become reference_image, reference_video, and reference_audio respectively. Up to 9 images (JPEG, PNG, WEBP, HEIC, or HEIF; 30MB each; 256-5760px per side; width/height ratio 0.4-2.5), 3 videos (MP4 or MOV with H.264/H.265; 50MB each; 2-15s each and 15s combined; same pixel and ratio bounds; 23.976-60 fps), and 3 audio files (WAV or MP3; 15MB each; 2-15s each and 15s combined); audio never on its own." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "content_moderation": { "type": "boolean", "default": true, "description": "Filter NSFW content using MiniMax's content moderation." }, "resolution": { "type": "string", "enum": [ "768P", "2K" ], "default": "768P", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the aspect ratio of the input image." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "description": "Controls the approximate aspect ratio of the resulting video. When omitted, the aspect ratio derives from the reference files." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds." } } } } } ``` --- # inference.minimax.h3.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-minimax-h3-txt2vid-v1/ The `inference.minimax.h3.txt2vid.v1` job generates a video based on the text prompt provided in the configuration using the MiniMax H3 (Hailuo-03) model. ```json { "type": "inference.minimax.h3.txt2vid.v1", "config": { "prompt": "puppies in the clouds, 4k" } } ``` The `resolution` (`768P` or `2K`), `aspect_ratio`, and `duration` (4-15 seconds) can be adjusted: ```json { "type": "inference.minimax.h3.txt2vid.v1", "config": { "prompt": "puppies in the clouds, 4k", "resolution": "2K", "aspect_ratio": "9:16", "duration": 10 } } ``` Content moderation is enabled by default and filters NSFW content. Set `content_moderation` to `false` to disable it: ```json { "type": "inference.minimax.h3.txt2vid.v1", "config": { "prompt": "puppies in the clouds, 4k", "content_moderation": false } } ``` ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.minimax.h3.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 7000, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "content_moderation": { "type": "boolean", "default": true, "description": "Filter NSFW content using MiniMax's content moderation." }, "resolution": { "type": "string", "enum": [ "768P", "2K" ], "default": "768P", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "duration": { "type": "integer", "minimum": 4, "maximum": 15, "default": 6, "description": "Duration of the video in seconds." } } } } } ``` --- # inference.nano-banana.img2img.v1 Source: https://docs.prodia.com/job-types/inference-nano-banana-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.nano-banana.img2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image that will be edited." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.nano-banana.img2img.v2 Source: https://docs.prodia.com/job-types/inference-nano-banana-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.nano-banana.img2img.v2" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "Provide an image and use text prompts to add, remove, or modify elements, change the style, or adjust the color grading. Use multiple input images to compose a new scene or transfer the style from one image to another." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "aspect_ratio": { "type": "string", "default": "auto", "enum": [ "auto", "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.nano-banana.txt2img.v2 Source: https://docs.prodia.com/job-types/inference-nano-banana-txt2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.nano-banana.txt2img.v2" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output image." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ], "description": "Aspect ratio of output." }, "include_messages": { "type": "boolean", "default": false, "description": "Enable to include the model's messages in the output as message.txt files." } } } } } ``` --- # inference.ping.v1 Source: https://docs.prodia.com/job-types/inference-ping-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "v2.job.ping", "v2.optimize.ping", "inference.ping.v1", "optimize.ping.v1" ] } } } ``` --- # inference.pruna.p-image-ideogram.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-pruna-p-image-ideogram-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.pruna.p-image-ideogram.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Text prompt describing the image to generate." }, "thinking": { "type": "string", "default": "high", "enum": [ "very low", "low", "medium", "high" ], "description": "Reasoning effort. Lower levels generate faster, higher levels improve quality." }, "image_size": { "type": "string", "default": "1K", "enum": [ "1K", "2K" ], "description": "Output resolution budget. Ignored when width or height is set." }, "aspect_ratio": { "type": "string", "default": "1:1", "enum": [ "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" ], "description": "Aspect ratio of the image. Ignored when width or height is set." }, "width": { "type": "integer", "minimum": 256, "maximum": 2560, "description": "Number of pixels wide. Setting width or height overrides image_size and aspect_ratio." }, "height": { "type": "integer", "minimum": 256, "maximum": 2560, "description": "Number of pixels tall. Setting width or height overrides image_size and aspect_ratio." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducibility. Only reproducible when prompt_upsampling is disabled." }, "prompt_upsampling": { "type": "boolean", "default": true, "description": "Use prompt upsampling to enhance the prompt." } } } } } ``` --- # inference.pruna.p-video.aud2vid.v1 Source: https://docs.prodia.com/job-types/inference-pruna-p-video-aud2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.pruna.p-video.aud2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt", "audio" ], "additionalProperties": false, "properties": { "audio": { "type": "string", "format": "filename", "description": "Input audio for audio-conditioned video generation. Supports flac, mp3, wav." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Text prompt for video generation." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Video resolution." }, "fps": { "type": "integer", "default": 24, "enum": [ 24, 48 ], "description": "Frames per second." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "1:1" ], "description": "Aspect ratio of the video." }, "seed": { "type": "integer", "description": "Random seed for reproducible generation." }, "draft": { "type": "boolean", "default": false, "description": "Draft mode generates a lower-quality preview." }, "prompt_upsampling": { "type": "boolean", "default": true, "description": "Use prompt upsampling to enhance the prompt." } } } } } ``` --- # inference.pruna.p-video.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-pruna-p-video-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.pruna.p-video.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt", "image" ], "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "description": "Input image for image-to-video generation. Supports jpg, jpeg, png, webp." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Text prompt for video generation." }, "duration": { "type": "integer", "default": 5, "enum": [ 5, 10 ], "description": "Duration of the video in seconds." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Video resolution." }, "fps": { "type": "integer", "default": 24, "enum": [ 24, 48 ], "description": "Frames per second." }, "seed": { "type": "integer", "description": "Random seed for reproducible generation." }, "draft": { "type": "boolean", "default": false, "description": "Draft mode generates a lower-quality preview." }, "prompt_upsampling": { "type": "boolean", "default": true, "description": "Use prompt upsampling to enhance the prompt." } } } } } ``` --- # inference.pruna.p-video.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-pruna-p-video-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.pruna.p-video.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Text prompt for video generation." }, "duration": { "type": "integer", "default": 5, "enum": [ 5, 10 ], "description": "Duration of the video in seconds." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Video resolution." }, "fps": { "type": "integer", "default": 24, "enum": [ 24, 48 ], "description": "Frames per second." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "1:1" ], "description": "Aspect ratio of the video." }, "seed": { "type": "integer", "description": "Random seed for reproducible generation." }, "draft": { "type": "boolean", "default": false, "description": "Draft mode generates a lower-quality preview." }, "prompt_upsampling": { "type": "boolean", "default": true, "description": "Use prompt upsampling to enhance the prompt." } } } } } ``` --- # inference.qwen.image-edit.plus.img2img.v1 Source: https://docs.prodia.com/job-types/inference-qwen-image-edit-plus-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.qwen.image-edit.plus.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "It supports various combinations such as 'person + person', 'person + product', and 'person + scene'. Optimal performance is currently achieved with 1 to 3 input images." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "negative_prompt": { "type": "string", "maxLength": 4096, "description": "Description of undesired image elements." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset applies a common style to your prompt." }, "steps": { "type": "integer", "default": 50, "minimum": 20, "maximum": 100, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Width of the output image in pixels." }, "height": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.qwen.image-edit.plus.lightning.img2img.v1 Source: https://docs.prodia.com/job-types/inference-qwen-image-edit-plus-lightning-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.qwen.image-edit.plus.lightning.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "It supports various combinations such as 'person + person', 'person + product', and 'person + scene'. Optimal performance is currently achieved with 1 to 3 input images." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset applies a common style to your prompt." }, "steps": { "type": "integer", "default": 8, "minimum": 8, "maximum": 8, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Width of the output image in pixels." }, "height": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.qwen.image-edit.plus.lightning.img2img.v2 Source: https://docs.prodia.com/job-types/inference-qwen-image-edit-plus-lightning-img2img-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.qwen.image-edit.plus.lightning.img2img.v2" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "input.png", "description": "The filename of the input image." }, "description": "It supports various combinations such as 'person + person', 'person + product', and 'person + scene'. Optimal performance is currently achieved with 1 to 3 input images." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ], "description": "Style preset applies a common style to your prompt." }, "steps": { "type": "integer", "default": 4, "minimum": 4, "maximum": 4, "description": "Amount of computational iterations to run. More is typically higher quality." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Width of the output image in pixels." }, "height": { "type": "number", "minimum": 256, "maximum": 2048, "description": "Height of the output image in pixels." } } } } } ``` --- # inference.recraft.img2img.v1 Source: https://docs.prodia.com/job-types/inference-recraft-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.img2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image filename. If not specified, the first uploaded image will be used." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "Describes areas to change in the image", "examples": [ "transform into a watercolor painting" ] }, "negative_prompt": { "type": "string", "description": "Description of undesired image elements" }, "strength": { "type": "number", "minimum": 0, "maximum": 1, "default": 0, "description": "Defines difference from original image (0=almost identical, 1=minimal similarity)" }, "style_id": { "type": "string", "format": "uuid", "description": "Reference to a previously uploaded style (mutually exclusive with style parameter)" }, "style": { "type": "string", "default": "realistic_image", "description": "Style of generated images", "enum": [ "realistic_image", "digital_illustration", "vector_illustration", "icon", "logo_raster" ] }, "substyle": { "type": "string", "description": "Substyle within the chosen style category", "enum": [ "b_and_w", "enterprise", "evening_light", "faded_nostalgia", "forest_life", "hard_flash", "hdr", "motion_blur", "mystic_naturalism", "natural_light", "natural_tones", "organic_calm", "real_life_glow", "retro_realism", "retro_snapshot", "studio_portrait", "urban_drama", "village_realism", "warm_folk", "2d_art_poster", "antiquarian", "bold_fantasy", "child_book", "crosshatch", "3d", "80s", "glow", "pixel_art", "bold_stroke", "chemistry", "colored_stencil", "cosmics", "cutout", "editorial", "cartoon", "doodle_line_art", "engraving", "flat_2", "broken_line", "colored_outline", "doodle_fill", "offset_fill", "pictogram", "emblem_graffiti", "emblem_pop_art", "emblem_punk", "emblem_stamp", "emblem_vintage" ] }, "controls": { "type": "object", "additionalProperties": false, "required": [ "colors" ], "properties": { "colors": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } }, "background_color": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } } } } } } } ``` --- # inference.recraft.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-recraft-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.txt2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 1000, "examples": [ "puppies in a cloud, 4k" ] }, "negative_prompt": { "type": "string", "description": "Description of undesired image elements" }, "style_id": { "type": "string", "format": "uuid", "description": "Reference to a previously uploaded style (mutually exclusive with style parameter)" }, "style": { "type": "string", "default": "realistic_image", "description": "Style of generated images", "enum": [ "realistic_image", "digital_illustration", "vector_illustration", "icon", "logo_raster" ] }, "substyle": { "type": "string", "description": "Substyle within the chosen style category", "enum": [ "b_and_w", "enterprise", "evening_light", "faded_nostalgia", "forest_life", "hard_flash", "hdr", "motion_blur", "mystic_naturalism", "natural_light", "natural_tones", "organic_calm", "real_life_glow", "retro_realism", "retro_snapshot", "studio_portrait", "urban_drama", "village_realism", "warm_folk", "2d_art_poster", "antiquarian", "bold_fantasy", "child_book", "crosshatch", "3d", "80s", "glow", "pixel_art", "bold_stroke", "chemistry", "colored_stencil", "cosmics", "cutout", "editorial", "cartoon", "doodle_line_art", "engraving", "flat_2", "broken_line", "colored_outline", "doodle_fill", "offset_fill", "pictogram", "emblem_graffiti", "emblem_pop_art", "emblem_punk", "emblem_stamp", "emblem_vintage" ] }, "size": { "type": "string", "default": "1024x1024", "enum": [ "1024x1024", "1024x1280", "1024x1365", "1024x1434", "1024x1536", "1024x1707", "1024x1820", "1024x2048", "1280x1024", "1365x1024", "1434x1024", "1536x1024", "1707x1024", "1820x1024", "2048x1024" ] }, "text_layout": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "text", "bbox" ], "properties": { "text": { "type": "string" }, "bbox": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": 0, "maximum": 1 } } } } } }, "controls": { "type": "object", "additionalProperties": false, "required": [ "colors" ], "properties": { "colors": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } }, "background_color": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } } } } } } } ``` --- # inference.recraft.v4.pro.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-recraft-v4-pro-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.v4.pro.txt2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 10000, "examples": [ "puppies in a cloud, 4k" ] }, "size": { "type": "string", "default": "2048x2048", "enum": [ "2048x2048", "3072x1536", "1536x3072", "2560x1664", "1664x2560", "2432x1792", "1792x2432", "2304x1792", "1792x2304", "1664x2688", "2560x1792", "1792x2560", "2688x1536", "1536x2688" ] }, "text_layout": { "type": "array", "description": "Array of text elements to render on the image with bounding box positions", "items": { "type": "object", "additionalProperties": false, "required": [ "text", "bbox" ], "properties": { "text": { "type": "string", "description": "Text content to render" }, "bbox": { "type": "array", "description": "Bounding box as 4 corner points, each [x, y] normalized to 0-1 range", "minItems": 4, "maxItems": 4, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": 0, "maximum": 1 } } } } } } } } } } ``` --- # inference.recraft.v4.pro.txt2vec.v1 Source: https://docs.prodia.com/job-types/inference-recraft-v4-pro-txt2vec-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.v4.pro.txt2vec.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 10000, "examples": [ "a minimalist logo of a mountain" ] }, "size": { "type": "string", "default": "2048x2048", "enum": [ "2048x2048", "3072x1536", "1536x3072", "2560x1664", "1664x2560", "2432x1792", "1792x2432", "2304x1792", "1792x2304", "1664x2688", "2560x1792", "1792x2560", "2688x1536", "1536x2688" ] }, "controls": { "type": "object", "additionalProperties": false, "properties": { "colors": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } }, "background_color": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } } } } } } } ``` --- # inference.recraft.v4.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-recraft-v4-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.v4.txt2img.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 10000, "examples": [ "puppies in a cloud, 4k" ] }, "size": { "type": "string", "default": "1024x1024", "enum": [ "1024x1024", "1536x768", "768x1536", "1280x832", "832x1280", "1216x896", "896x1216", "1152x896", "896x1152", "832x1344", "1280x896", "896x1280", "1344x768", "768x1344" ] }, "text_layout": { "type": "array", "description": "Array of text elements to render on the image with bounding box positions", "items": { "type": "object", "additionalProperties": false, "required": [ "text", "bbox" ], "properties": { "text": { "type": "string", "description": "Text content to render" }, "bbox": { "type": "array", "description": "Bounding box as 4 corner points, each [x, y] normalized to 0-1 range", "minItems": 4, "maxItems": 4, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": 0, "maximum": 1 } } } } } } } } } } ``` --- # inference.recraft.v4.txt2vec.v1 Source: https://docs.prodia.com/job-types/inference-recraft-v4-txt2vec-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.recraft.v4.txt2vec.v1" ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 10000, "examples": [ "a minimalist logo of a mountain" ] }, "size": { "type": "string", "default": "1024x1024", "enum": [ "1024x1024", "1536x768", "768x1536", "1280x832", "832x1280", "1216x896", "896x1216", "1152x896", "896x1152", "832x1344", "1280x896", "896x1280", "1344x768", "768x1344" ] }, "controls": { "type": "object", "additionalProperties": false, "properties": { "colors": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } }, "background_color": { "type": "object", "additionalProperties": false, "required": [ "rgb" ], "properties": { "rgb": { "type": "array", "minLength": 3, "maxLength": 3, "items": { "type": "integer", "minimum": 0, "maximum": 255 } } } } } } } } } } ``` --- # inference.remove-background.v1 Source: https://docs.prodia.com/job-types/inference-remove-background-v1/ The `inference.remove-background.v1` job removes the background of an input image and returns an output image with the background removed and a black/white mask. The output image and mask are only available as `image/png`. ```json { "type": "inference.remove-background.v1" } ```
INPUT OUTPUT
rocket in a desesrt just the rocket black & white rocket mask
## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.birefnet.segment.v1", "inference.remove-background.v1", "inference.mask-background.v1" ] }, "config": { "type": "object", "properties": { "contour": { "description": "Enable contour detection for a crisp outline mask style.", "type": "boolean", "default": false }, "contour_tolerance": { "description": "Increase contour tolerance to smooth and expand the mask.", "type": "integer", "default": 0, "minimum": 0, "maximum": 128 } } } } } ``` --- # inference.runway.gen4.vid2vid.v1 Source: https://docs.prodia.com/job-types/inference-runway-gen4-vid2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.runway.gen4.vid2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "video": { "type": "string", "format": "filename", "example": "input.mp4", "description": "The input video that will be transformed." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "make it morning", "description": "Description of desired transformation or enhancement to apply to the input video." }, "aspect_ratio": { "type": "string", "enum": [ "1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672" ], "default": "1280:720", "description": "Controls the aspect ratio of the resulting video in width:height format." }, "public_figure_moderation": { "type": "string", "enum": [ "auto", "low" ], "default": "auto", "description": "Controls moderation level for public figures in the video content." }, "seed": { "type": "integer", "minimum": 1, "maximum": 4294967295, "description": "A randomness initializer for video reproducibility." } } } } } ``` --- # inference.sam2.segment.v1 Source: https://docs.prodia.com/job-types/inference-sam2-segment-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.segment.v1", "inference.sam2.segment.v1" ] } } } ``` --- # inference.sam3.segment.v1 Source: https://docs.prodia.com/job-types/inference-sam3-segment-v1/ The `inference.sam3.segment.v1` job performs text-prompted image segmentation using Meta's SAM 3 (Segment Anything Model 3). Unlike SAM 2, SAM 3 accepts natural language text prompts to identify and segment specific objects in images. ## Basic Usage ```json { "type": "inference.sam3.segment.v1", "config": { "prompt": "fish" } } ``` This returns one mask per detected instance matching the prompt. ## Configuration Options | Parameter | Type | Default | Description | | ---------------------- | ------ | ---------- | -------------------------------------------------------------------------------------------------------- | | `prompt` | string | (required) | Text describing what to segment (e.g., "yellow school bus", "person", "cat") | | `confidence_threshold` | number | 0.5 | Confidence threshold (0.0-1.0). Lower values return more masks, higher values only high-confidence masks | ## Examples ### Segment all fish in an image ```json { "type": "inference.sam3.segment.v1", "config": { "prompt": "fish" } } ``` ### High confidence detection only ```json { "type": "inference.sam3.segment.v1", "config": { "prompt": "person", "confidence_threshold": 0.9 } } ``` ### Low confidence for more detections ```json { "type": "inference.sam3.segment.v1", "config": { "prompt": "bird", "confidence_threshold": 0.3 } } ``` ## Input Requirements - **Format**: PNG, JPEG, or WebP - **Size**: 256x256 minimum, 4096x4096 maximum - **Max file size**: 10MB ## Output Returns one or more binary masks as PNG images. Each mask corresponds to a detected instance of the prompted object. Masks are grayscale images where: - White (255) = object pixels - Black (0) = background pixels ## Performance Tested on NVIDIA H100 80GB: - Model load time: \~8.3s - Average inference time: \~88ms per image - Memory usage: \~12GB VRAM ## Confidence Threshold Effects | Threshold | Typical Result | | --------- | -------------------------------------------- | | 0.3 | Many detections, may include false positives | | 0.5 | Balanced detection (default) | | 0.7 | Fewer, higher quality detections | | 0.9 | Only very confident detections | ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "enum": [ "inference.segment.v2", "inference.sam3.segment.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 500, "description": "Text prompt describing what to segment (e.g., 'yellow school bus', 'person', 'cat')." }, "confidence_threshold": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "description": "Confidence threshold for detections. Lower values return more masks, higher values only return high-confidence masks." } } } } } ``` --- # inference.sam3.segment.video.v1 Source: https://docs.prodia.com/job-types/inference-sam3-segment-video-v1/ The `inference.sam3.segment.video.v1` job performs text-prompted video segmentation using Meta's SAM 3 Video Predictor. A single text prompt applied at frame 0 is tracked forwards and backwards across the video and one output mp4 is returned. ## Basic Usage ```json { "type": "inference.sam3.segment.video.v1", "config": { "prompt": "fish" } } ``` This returns a single mp4 where every detected object mask is merged (per-frame pixel-wise union) into one black-and-white channel. ## Configuration Options | Parameter | Type | Default | Description | | ---------------------- | ------ | ---------- | ---------------------------------------------------------------------------------------------------------- | | `prompt` | string | (required) | Text describing what to segment and track across the video. | | `confidence_threshold` | number | 0.5 | Minimum SAM 3 score an object must reach to be included in the merged mask or overlay (range 0.0–1.0). | | `mode` | enum | `mask` | `mask` returns a merged B\&W mp4. `overlay` returns the SAM 3 README-style colored overlay over the input. | | `alpha` | number | 0.5 | Mask alpha used when `mode` is `overlay`. Ignored otherwise (range 0.0–1.0). | ## Examples ### Merged B\&W mask video ```json { "type": "inference.sam3.segment.video.v1", "config": { "prompt": "fish" } } ``` ### Colored overlay video ```json { "type": "inference.sam3.segment.video.v1", "config": { "prompt": "fish", "mode": "overlay", "alpha": 0.5 } } ``` ### Only high-confidence detections ```json { "type": "inference.sam3.segment.video.v1", "config": { "prompt": "person", "confidence_threshold": 0.9 } } ``` ## Input Requirements - **Format**: MP4 (`video/mp4`) - **Max file size**: 100 MB Input resolution and fps are preserved on the output. Common sizes (832×480, 1280×720) are warmed into the torch.compile cache on bootstrap. ## Output One MP4 file (H.264 / yuv420p) sent back as the `output` form field. The mp4 has the same resolution and fps as the input. - `mode=mask` (default): grayscale-style, where any pixel covered by any detected mask is white (255) and everything else is black (0). - `mode=overlay`: alpha-blended colored masks over the original frames, plus per-object bounding boxes and `id=, p=` labels, matching the SAM 3 README example. ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "enum": [ "inference.sam3.segment.video.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 500, "description": "Text prompt describing what to track and segment across the video (e.g., 'fish', 'yellow school bus', 'person')." }, "confidence_threshold": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "description": "Confidence threshold applied to per-object scores before the mask is merged or rendered." }, "mode": { "type": "string", "enum": [ "mask", "overlay" ], "default": "mask", "description": "Output style. 'mask' produces a black-and-white mp4 where white means any detected object covers that pixel. 'overlay' composites the colored masks, bounding boxes, and id/score labels from the SAM 3 visualization over the original video." }, "alpha": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "description": "Mask alpha used when mode is 'overlay'. Ignored otherwise." } } } } } ``` --- # inference.sdxl.img2img.v1 Source: https://docs.prodia.com/job-types/inference-sdxl-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.sdxl.txt2img.v1", "inference.sdxl.img2img.v1", "inference.sdxl.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "puppies in a cloud, 4k" ] }, "negative_prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "blurry" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance": { "type": "number", "default": 8 }, "conditioner": { "type": "boolean", "default": false }, "refiner": { "type": "boolean", "default": false }, "noise": { "type": "number", "default": 1 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 1000 }, "width": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 }, "height": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 } } } } } ``` --- # inference.sdxl.inpainting.v1 Source: https://docs.prodia.com/job-types/inference-sdxl-inpainting-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.sdxl.txt2img.v1", "inference.sdxl.img2img.v1", "inference.sdxl.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "puppies in a cloud, 4k" ] }, "negative_prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "blurry" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance": { "type": "number", "default": 8 }, "conditioner": { "type": "boolean", "default": false }, "refiner": { "type": "boolean", "default": false }, "noise": { "type": "number", "default": 1 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 1000 }, "width": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 }, "height": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 } } } } } ``` --- # inference.sdxl.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-sdxl-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.sdxl.txt2img.v1", "inference.sdxl.img2img.v1", "inference.sdxl.inpainting.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "puppies in a cloud, 4k" ] }, "negative_prompt": { "type": "string", "minLength": 3, "maxLength": 1024, "examples": [ "blurry" ] }, "style_preset": { "type": "string", "enum": [ "3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "neon-punk", "origami", "photographic", "pixel-art", "texture", "craft-clay" ] }, "strength": { "type": "number", "default": 0.6, "minimum": 0, "maximum": 1 }, "guidance": { "type": "number", "default": 8 }, "conditioner": { "type": "boolean", "default": false }, "refiner": { "type": "boolean", "default": false }, "noise": { "type": "number", "default": 1 }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ] }, "steps": { "type": "integer", "default": 25, "minimum": 1, "maximum": 1000 }, "width": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 }, "height": { "type": "integer", "default": 1024, "minimum": 512, "maximum": 1536 } } } } } ``` --- # inference.seedance-2.fast.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-2-fast-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance-2.fast.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video. Use alone for first-frame mode, or pair with last_frame for first-and-last-frame mode." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video. Must be used together with first_frame." }, "reference_images": { "type": "array", "minItems": 1, "maxItems": 9, "items": { "type": "string", "format": "filename", "example": "reference.png", "description": "Filename of a reference image." }, "description": "Reference images for multimodal generation. 1-9 images. Mutually exclusive with first_frame/last_frame mode." }, "reference_videos": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "reference.mp4", "description": "Filename of a reference video. Must be mp4 or mov, 2-15 seconds, total of all videos must not exceed 15 seconds." }, "description": "Reference videos for multimodal generation. 1-3 videos." }, "reference_audios": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "reference.wav", "description": "Filename of a reference audio. Must be wav or mp3, 2-15 seconds each, total must not exceed 15 seconds." }, "description": "Reference audios for multimodal generation. 1-3 audios. Cannot be used alone — must be combined with at least one reference image or video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p" ], "default": "720p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 720 pixel height use a 16:9 aspect ratio." }, "duration": { "type": "integer", "minimum": -1, "maximum": 15, "default": 5, "description": "Duration of the video in seconds. Valid values are integers in [4, 15], or -1 to let the model pick a suitable length." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "generate_audio": { "type": "boolean", "default": true, "description": "When true the output video includes synchronized audio. When false a silent video is produced." }, "return_last_frame": { "type": "boolean", "default": false, "description": "When true the last frame of the generated video is also returned as a PNG (last_frame.png) alongside the video." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance-2.fast.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-2-fast-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance-2.fast.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p" ], "default": "720p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 720 pixel height use a 16:9 aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive" ], "default": "adaptive", "description": "Controls the approximate aspect ratio of the resulting video. Use \"adaptive\" to let the model pick automatically based on the prompt." }, "duration": { "type": "integer", "minimum": -1, "maximum": 15, "default": 5, "description": "Duration of the video in seconds. Valid values are integers in [4, 15], or -1 to let the model pick a suitable length." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "generate_audio": { "type": "boolean", "default": true, "description": "When true the output video includes synchronized audio. When false a silent video is produced." }, "return_last_frame": { "type": "boolean", "default": false, "description": "When true the last frame of the generated video is also returned as a PNG (last_frame.png) alongside the video." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance-2.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-2-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance-2.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video. Use alone for first-frame mode, or pair with last_frame for first-and-last-frame mode." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video. Must be used together with first_frame." }, "reference_images": { "type": "array", "minItems": 1, "maxItems": 9, "items": { "type": "string", "format": "filename", "example": "reference.png", "description": "Filename of a reference image." }, "description": "Reference images for multimodal generation. 1-9 images. Mutually exclusive with first_frame/last_frame mode." }, "reference_videos": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "reference.mp4", "description": "Filename of a reference video. Must be mp4 or mov, 2-15 seconds, total of all videos must not exceed 15 seconds." }, "description": "Reference videos for multimodal generation. 1-3 videos." }, "reference_audios": { "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "format": "filename", "example": "reference.wav", "description": "Filename of a reference audio. Must be wav or mp3, 2-15 seconds each, total must not exceed 15 seconds." }, "description": "Reference audios for multimodal generation. 1-3 audios. Cannot be used alone — must be combined with at least one reference image or video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480, 720, or 1080 pixel height use a 16:9 aspect ratio." }, "duration": { "type": "integer", "minimum": -1, "maximum": 15, "default": 5, "description": "Duration of the video in seconds. Valid values are integers in [4, 15], or -1 to let the model pick a suitable length." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "generate_audio": { "type": "boolean", "default": true, "description": "When true the output video includes synchronized audio. When false a silent video is produced." }, "return_last_frame": { "type": "boolean", "default": false, "description": "When true the last frame of the generated video is also returned as a PNG (last_frame.png) alongside the video." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance-2.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-2-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance-2.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480, 720, or 1080 pixel height use a 16:9 aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive" ], "default": "adaptive", "description": "Controls the approximate aspect ratio of the resulting video. Use \"adaptive\" to let the model pick automatically based on the prompt." }, "duration": { "type": "integer", "minimum": -1, "maximum": 15, "default": 5, "description": "Duration of the video in seconds. Valid values are integers in [4, 15], or -1 to let the model pick a suitable length." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "generate_audio": { "type": "boolean", "default": true, "description": "When true the output video includes synchronized audio. When false a silent video is produced." }, "return_last_frame": { "type": "boolean", "default": false, "description": "When true the last frame of the generated video is also returned as a PNG (last_frame.png) alongside the video." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.lite.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-lite-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.lite.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "Set the ending frame for the video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480, 720, or 1080 pixel height use a 16:9 aspect ratio." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.lite.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-lite-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.lite.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480, 720, or 1080 pixel height use a 16:9 aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.pro.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-pro-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.pro.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 1080 pixel height use a 16:9 aspect ratio." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.pro.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-pro-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.pro.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 1080 pixel height use a 16:9 aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.proturbo.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-proturbo-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.proturbo.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "first_frame": { "type": "string", "format": "filename", "example": "first_frame.png", "description": "Set the starting frame for the video." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 1080 pixel height use a 16:9 aspect ratio." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedance.proturbo.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-seedance-proturbo-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedance.proturbo.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a flying dragon over mountains", "description": "Description of desired output." }, "resolution": { "type": "string", "enum": [ "480p", "1080p" ], "default": "1080p", "description": "This controls the general quality level of the output. Exact width and height will vary depending on the selected aspect ratio. For a video with approximately 480 or 1080 pixel height use a 16:9 aspect ratio." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "4:3", "1:1", "3:4", "9:16", "21:9" ], "default": "16:9", "description": "Controls the approximate aspect ratio of the resulting video." }, "duration": { "type": "integer", "enum": [ 5, 10 ], "default": 5, "description": "Duration of the video in seconds." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "camera_fixed": { "type": "boolean", "default": false, "description": "When set to true the model is encouraged to keep the camera from moving. This is not guaranteed to work." }, "seed": { "type": "integer", "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedream-4-5.img2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-4-5-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-4-5.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "example": "image.png", "description": "Set image to edit." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1920, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1920, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedream-4-5.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-4-5-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-4-5.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1920, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1920, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.seedream-4.img2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-4-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-4.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "example": "image.png", "description": "Set image to edit." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." } } } } } ``` --- # inference.seedream-4.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-4-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-4.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." } } } } } ``` --- # inference.seedream-5-0.lite.img2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-5-0-lite-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-5-0.lite.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "images": { "type": "array", "minItems": 1, "maxItems": 14, "items": { "type": "string", "format": "filename" }, "description": "Input images for multi-image blending." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." } } } } } ``` --- # inference.seedream-5-0.lite.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-5-0-lite-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream-5-0.lite.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 1024, "maximum": 4096, "default": 2048, "description": "Number of pixels tall." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." } } } } } ``` --- # inference.seedream.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-seedream-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.seedream.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "default": "a dancing cat under moonlight", "description": "Description of desired output." }, "width": { "type": "number", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Number of pixels wide." }, "height": { "type": "number", "minimum": 512, "maximum": 2048, "default": 1024, "description": "Number of pixels tall." }, "guidance_scale": { "type": "number", "minimum": 1, "maximum": 10, "default": 2.5, "description": "High guidance scales improve prompt adherence at the cost of reduced realism." }, "watermark": { "type": "boolean", "default": false, "description": "When set to true a watermark is added indicating the output is AI generated." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducability." } } } } } ``` --- # inference.segment.v1 Source: https://docs.prodia.com/job-types/inference-segment-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.segment.v1", "inference.sam2.segment.v1" ] } } } ``` --- # inference.segment.v2 Source: https://docs.prodia.com/job-types/inference-segment-v2/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "enum": [ "inference.segment.v2", "inference.sam3.segment.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 500, "description": "Text prompt describing what to segment (e.g., 'yellow school bus', 'person', 'cat')." }, "confidence_threshold": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "description": "Confidence threshold for detections. Lower values return more masks, higher values only return high-confidence masks." } } } } } ``` --- # inference.sora-2.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-sora-2-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.sora-2.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image to animate." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "description": "Text description of the motion or animation to apply to the image." }, "aspect_ratio": { "type": "string", "enum": [ "9:16", "16:9" ], "default": "16:9", "description": "Output video aspect ratio." }, "duration": { "type": "integer", "enum": [ 4, 8, 12 ], "default": 4, "description": "Video duration in seconds." }, "seed": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility." } } } } } ``` --- # inference.sora-2.pro.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-sora-2-pro-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.sora-2.pro.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "example": "input.png", "description": "The input image to animate." }, "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "description": "Text description of the motion or animation to apply to the image. Pro version includes synchronized audio." }, "resolution": { "type": "string", "enum": [ "720p", "1080p" ], "default": "720p", "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "enum": [ "9:16", "16:9" ], "default": "16:9", "description": "Output video aspect ratio." }, "duration": { "type": "integer", "enum": [ 4, 8, 12 ], "default": 4, "description": "Video duration in seconds." }, "seed": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility." } } } } } ``` --- # inference.sora-2.pro.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-sora-2-pro-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.sora-2.pro.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "description": "Text description of the video to generate. Pro version includes synchronized audio." }, "resolution": { "type": "string", "enum": [ "720p", "1080p" ], "default": "720p", "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "enum": [ "9:16", "16:9" ], "default": "16:9", "description": "Output video aspect ratio." }, "duration": { "type": "integer", "enum": [ 4, 8, 12 ], "default": 4, "description": "Video duration in seconds." }, "seed": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility." } } } } } ``` --- # inference.sora-2.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-sora-2-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.sora-2.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 3, "maxLength": 4096, "description": "Text description of the video to generate." }, "aspect_ratio": { "type": "string", "enum": [ "9:16", "16:9" ], "default": "16:9", "description": "Output video aspect ratio." }, "duration": { "type": "integer", "enum": [ 4, 8, 12 ], "default": 4, "description": "Video duration in seconds." }, "seed": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility." } } } } } ``` --- # inference.tenstorrent.wan2-2-lightning.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-tenstorrent-wan2-2-lightning-img2vid-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.tenstorrent.wan2-2-lightning.img2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "Text description of the video to generate from the input image.", "examples": [ "A kitten running in the moonlight" ] }, "image": { "type": "string", "format": "filename", "description": "First-frame image to animate into a video. Required at runtime; if omitted, the first uploaded blob is used.", "examples": [ "first_frame.png", "input.jpg" ] } } } } } ``` --- # inference.topaz.gigapixel-standard-2.upscale.v1 Source: https://docs.prodia.com/job-types/inference-topaz-gigapixel-standard-2-upscale-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.topaz.gigapixel-standard-2.upscale.v1" ] }, "config": { "type": "object", "properties": { "image": { "description": "The filename of the input image to upscale.", "type": "string", "format": "filename", "example": "input.png" }, "width": { "description": "Desired output width in pixels. If omitted, Topaz determines the output size.", "type": "integer", "minimum": 1, "maximum": 32000, "examples": [ 2048, 4096 ] }, "height": { "description": "Desired output height in pixels. If omitted, Topaz determines the output size.", "type": "integer", "minimum": 1, "maximum": 32000, "examples": [ 2048, 4096 ] }, "face_recovery": { "description": "Enhance facial features and recover detail in faces.", "type": "boolean", "default": false }, "subject_detection": { "description": "Target enhancement to a specific area of the image.", "type": "string", "enum": [ "foreground", "background", "all" ] } } } } } ``` --- # inference.topaz.proteus.upscale.v1 Source: https://docs.prodia.com/job-types/inference-topaz-proteus-upscale-v1/ ## Schema ```json { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.topaz.proteus.upscale.v1" ] }, "config": { "type": "object", "properties": { "video": { "description": "The filename of the input video to upscale.", "type": "string", "format": "filename", "example": "input.mp4" }, "scale": { "description": "Upscale factor. Ignored if width and height are both set.", "type": "integer", "enum": [ 2, 4 ], "default": 2 }, "width": { "description": "Desired output width in pixels. Must be provided together with height.", "type": "integer", "minimum": 1, "maximum": 16000, "examples": [ 3840, 7680 ] }, "height": { "description": "Desired output height in pixels. Must be provided together with width.", "type": "integer", "minimum": 1, "maximum": 16000, "examples": [ 2160, 4320 ] } } } } } ``` --- # inference.upscale.v1 Source: https://docs.prodia.com/job-types/inference-upscale-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.upscale.v1" ] }, "config": { "type": "object", "properties": { "upscale": { "type": "number", "enum": [ 2, 4, 8 ], "default": 2 } } } } } ``` --- # inference.veo.fast.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-veo-fast-img2vid-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "unevaluatedProperties": false, "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.fast.img2vid.v1" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "reference.png", "description": "A reference image to start the video from." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.fast.img2vid.v2 Source: https://docs.prodia.com/job-types/inference-veo-fast-img2vid-v2/ ## Schema ```json { "unevaluatedProperties": false, "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.img2vid.v2", "inference.veo.fast.img2vid.v2" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "reference.png", "description": "A reference image to start the video from." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "negative_prompt": { "type": "string", "maxLength": 2500, "description": "Text to discourage specific content generation." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "An optional image to use as the last frame of the video." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "duration_seconds": { "type": "integer", "default": 8, "enum": [ 4, 6, 8 ], "description": "Duration of the generated video in seconds." }, "person_generation": { "type": "string", "default": "allow_adult", "enum": [ "allow_adult", "dont_allow" ], "description": "Person generation policy." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.fast.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-veo-fast-txt2vid-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "unevaluatedProperties": false, "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.fast.txt2vid.v1" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.fast.txt2vid.v2 Source: https://docs.prodia.com/job-types/inference-veo-fast-txt2vid-v2/ ## Schema ```json { "unevaluatedProperties": false, "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.txt2vid.v2", "inference.veo.fast.txt2vid.v2" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "negative_prompt": { "type": "string", "maxLength": 2500, "description": "Text to discourage specific content generation." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "duration_seconds": { "type": "integer", "default": 8, "enum": [ 4, 6, 8 ], "description": "Duration of the generated video in seconds." }, "person_generation": { "type": "string", "default": "allow_adult", "enum": [ "allow_adult", "dont_allow" ], "description": "Person generation policy." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-veo-img2vid-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "unevaluatedProperties": false, "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.img2vid.v1" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "reference.png", "description": "A reference image to start the video from." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." } } } } } ``` --- # inference.veo.img2vid.v2 Source: https://docs.prodia.com/job-types/inference-veo-img2vid-v2/ ## Schema ```json { "unevaluatedProperties": false, "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.img2vid.v2", "inference.veo.fast.img2vid.v2" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "image": { "type": "string", "format": "filename", "example": "reference.png", "description": "A reference image to start the video from." }, "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "negative_prompt": { "type": "string", "maxLength": 2500, "description": "Text to discourage specific content generation." }, "last_frame": { "type": "string", "format": "filename", "example": "last_frame.png", "description": "An optional image to use as the last frame of the video." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "duration_seconds": { "type": "integer", "default": 8, "enum": [ 4, 6, 8 ], "description": "Duration of the generated video in seconds." }, "person_generation": { "type": "string", "default": "allow_adult", "enum": [ "allow_adult", "dont_allow" ], "description": "Person generation policy." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-veo-txt2vid-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "unevaluatedProperties": false, "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.txt2vid.v1" ] }, "config": { "type": "object", "unevaluatedProperties": false, "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.veo.txt2vid.v2 Source: https://docs.prodia.com/job-types/inference-veo-txt2vid-v2/ ## Schema ```json { "unevaluatedProperties": false, "type": "object", "required": [ "type", "config" ], "properties": { "type": { "type": "string", "enum": [ "inference.veo.txt2vid.v2", "inference.veo.fast.txt2vid.v2" ] }, "config": { "unevaluatedProperties": false, "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "minLength": 0, "maxLength": 2500, "examples": [ "puppies in a cloud, 4k" ], "description": "A description of the desired output." }, "negative_prompt": { "type": "string", "maxLength": 2500, "description": "Text to discourage specific content generation." }, "generate_audio": { "type": "boolean", "default": false, "description": "Add generated audio to the video." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "1080p" ], "description": "Output video resolution." }, "aspect_ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16" ], "description": "Aspect ratio of output." }, "duration_seconds": { "type": "integer", "default": 8, "enum": [ 4, 6, 8 ], "description": "Duration of the generated video in seconds." }, "person_generation": { "type": "string", "default": "allow_adult", "enum": [ "allow_adult", "dont_allow" ], "description": "Person generation policy." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "Seed for random number generation." } } } } } ``` --- # inference.vit.img2label.v1 Source: https://docs.prodia.com/job-types/inference-vit-img2label-v1/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.vit.img2label.v1", "inference.vit.img2label.v2" ] }, "config": { "type": "object", "properties": { "model": { "type": "string", "default": "Falconsai/nsfw_image_detection", "enum": [ "google/vit-base-patch16-224-in21k", "Falconsai/nsfw_image_detection", "Freepik/nsfw_image_detector" ] } } } } } ``` --- # inference.vit.img2label.v2 Source: https://docs.prodia.com/job-types/inference-vit-img2label-v2/ ## Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "inference.vit.img2label.v1", "inference.vit.img2label.v2" ] }, "config": { "type": "object", "properties": { "model": { "type": "string", "default": "Falconsai/nsfw_image_detection", "enum": [ "google/vit-base-patch16-224-in21k", "Falconsai/nsfw_image_detection", "Freepik/nsfw_image_detector" ] } } } } } ``` --- # inference.wan2-1.img2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-1-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-1.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "Same scene with morning sunlight and rising mist." ], "description": "Text description guiding the image transformation." }, "images": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "string" }, "description": "Filename of the conditioning image in the request body. If omitted, the first uploaded blob is used." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "integer", "minimum": 256, "maximum": 2048, "examples": [ 1024, 1280, 1536 ], "description": "Requested output width in pixels. Defaults to the input image's width. Inference runs at the closest pre-compiled production resolution; the output is then resampled to the requested size." }, "height": { "type": "integer", "minimum": 256, "maximum": 2048, "examples": [ 1024, 720, 1920 ], "description": "Requested output height in pixels. Defaults to the input image's height." }, "steps": { "type": "integer", "default": 20, "minimum": 1, "maximum": 50, "description": "Number of denoising steps. The BF16 I2V teacher quality plateaus around 20 steps." }, "guidance_scale": { "type": "number", "default": 5, "minimum": 1, "maximum": 12, "description": "Classifier-free guidance scale. Higher = stricter prompt adherence." } } } } } ``` --- # inference.wan2-1.lightning.img2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-1-lightning-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-1.lightning.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "Same scene with morning sunlight and rising mist." ], "description": "Text description guiding the image transformation." }, "images": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "string" }, "description": "Filename of the conditioning image in the request body. If omitted, the first uploaded blob is used." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "integer", "minimum": 256, "maximum": 2048, "examples": [ 1024, 1280, 1536 ], "description": "Requested output width in pixels. Defaults to the input image's width. Inference runs at the closest pre-compiled FP8-safe production resolution; the output is then resampled to the requested size." }, "height": { "type": "integer", "minimum": 256, "maximum": 2048, "examples": [ 1024, 720, 1920 ], "description": "Requested output height in pixels. Defaults to the input image's height." }, "steps": { "type": "integer", "default": 20, "minimum": 1, "maximum": 50, "description": "Number of denoising steps." }, "guidance_scale": { "type": "number", "default": 5, "minimum": 1, "maximum": 12, "description": "Classifier-free guidance scale." } } } } } ``` --- # inference.wan2-1.lightning.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-1-lightning-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-1.lightning.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "A photorealistic landscape: a quiet mountain lake at sunrise." ], "description": "Text description of the image to generate." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "integer", "default": 1024, "minimum": 256, "maximum": 2048, "examples": [ 1024, 1280, 1536 ], "description": "Requested output width in pixels. Inference runs at the closest pre-compiled FP8-safe production resolution; the output is then resampled to the requested size." }, "height": { "type": "integer", "default": 1024, "minimum": 256, "maximum": 2048, "examples": [ 1024, 720, 1920 ], "description": "Requested output height in pixels." }, "steps": { "type": "integer", "default": 20, "minimum": 1, "maximum": 50, "description": "Number of denoising steps." }, "guidance_scale": { "type": "number", "default": 5, "minimum": 1, "maximum": 12, "description": "Classifier-free guidance scale." } } } } } ``` --- # inference.wan2-1.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-1-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-1.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "A photorealistic landscape: a quiet mountain lake at sunrise." ], "description": "Text description of the image to generate." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for image reproducibility." }, "width": { "type": "integer", "default": 1024, "minimum": 256, "maximum": 2048, "examples": [ 1024, 1280, 1536 ], "description": "Requested output width in pixels. Inference runs at the closest pre-compiled production resolution; the output is then resampled to the requested size." }, "height": { "type": "integer", "default": 1024, "minimum": 256, "maximum": 2048, "examples": [ 1024, 720, 1920 ], "description": "Requested output height in pixels." }, "steps": { "type": "integer", "default": 20, "minimum": 1, "maximum": 50, "description": "Number of denoising steps. The BF16 teacher quality plateaus around 20 steps." }, "guidance_scale": { "type": "number", "default": 5, "minimum": 1, "maximum": 12, "description": "Classifier-free guidance scale. Higher = more prompt adherence; lower = more creativity." } } } } } ``` --- # inference.wan2-2.lightning.img2vid.v0 Source: https://docs.prodia.com/job-types/inference-wan2-2-lightning-img2vid-v0/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-2.lightning.img2vid.v0" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "A cat walking through a garden." ], "description": "Text description to guide the video generation from the input image." }, "image": { "type": "string", "format": "filename", "examples": [ "reference.png" ], "description": "Input image to animate into a video." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for video reproducibility." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "480p" ], "description": "Output resolution. 720p = 1280x720, 480p = 832x480." } } } } } ``` --- # inference.wan2-2.lightning.txt2vid.v0 Source: https://docs.prodia.com/job-types/inference-wan2-2-lightning-txt2vid-v0/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-2.lightning.txt2vid.v0" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 2500, "examples": [ "Two anthropomorphic cats boxing on a spotlighted stage." ], "description": "Text description of the video to generate." }, "seed": { "type": "integer", "examples": [ 42, 531286735183442 ], "description": "A randomness initializer for video reproducibility." }, "resolution": { "type": "string", "default": "720p", "enum": [ "720p", "480p" ], "description": "Output resolution. 720p = 1280x720, 480p = 832x480." } } } } } ``` --- # inference.wan2-7.img2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-7-img2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-7.img2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "Text description of the desired edits or style changes to apply to the input image. Supports Chinese and English.", "examples": [ "Transform this image into a watercolor painting style" ] }, "image": { "type": "string", "format": "filename", "description": "Input image to edit or use as a reference.", "examples": [ "reference.png", "input.jpg" ] }, "size": { "type": "string", "default": "2K", "enum": [ "1K", "2K" ], "description": "Output image resolution. 1K≈1024×1024 total pixels, 2K≈2048×2048. Output aspect ratio matches the input image." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducibility.", "examples": [ 42, 12345 ] } } } } } ``` --- # inference.wan2-7.img2vid.v1 Source: https://docs.prodia.com/job-types/inference-wan2-7-img2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-7.img2vid.v1" ] }, "config": { "type": "object", "additionalProperties": false, "properties": { "image": { "type": "string", "format": "filename", "description": "First-frame image to animate into a video.", "examples": [ "first_frame.png", "input.jpg" ] }, "last_frame": { "type": "string", "format": "filename", "description": "Last-frame image for start-end interpolation. Used with image to generate a video transitioning between the two frames.", "examples": [ "last_frame.png", "end.jpg" ] }, "audio": { "type": "string", "format": "filename", "description": "Driving audio for lip-sync and action timing. Supported formats: WAV, MP3. Duration: 2-30 seconds, max 15 MB. Audio exceeding video duration is trimmed; shorter audio creates silent portions.", "examples": [ "speech.mp3", "audio.wav" ] }, "prompt": { "type": "string", "maxLength": 5000, "description": "Text description of the desired video content and motion.", "examples": [ "A cat walking through a garden" ] }, "negative_prompt": { "type": "string", "maxLength": 500, "description": "Description of content to exclude from the video.", "examples": [ "low resolution, error, worst quality, deformed" ] }, "resolution": { "type": "string", "default": "720P", "enum": [ "720P", "1080P" ], "description": "Resolution tier of the generated video. Aspect ratio is preserved from the input image." }, "duration": { "type": "integer", "minimum": 2, "maximum": 15, "default": 5, "description": "Duration of the generated video in seconds (2-15)." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility.", "examples": [ 42, 12345 ] }, "prompt_extend": { "type": "boolean", "default": true, "description": "Enable intelligent prompt rewriting for better results." } } } } } ``` --- # inference.wan2-7.txt2img.v1 Source: https://docs.prodia.com/job-types/inference-wan2-7-txt2img-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-7.txt2img.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "Text description of the image to generate. Supports Chinese and English.", "examples": [ "A serene mountain landscape at sunset with vibrant colors" ] }, "size": { "type": "string", "default": "2K", "enum": [ "1K", "2K" ], "description": "Output image resolution. 1K≈1024×1024 total pixels, 2K≈2048×2048. Aspect ratio is square for text-only input." }, "thinking_mode": { "type": "boolean", "default": true, "description": "Enable thinking mode for improved image quality at the cost of longer generation time." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for image reproducibility.", "examples": [ 42, 12345 ] } } } } } ``` --- # inference.wan2-7.txt2vid.v1 Source: https://docs.prodia.com/job-types/inference-wan2-7-txt2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-7.txt2vid.v1" ] }, "config": { "type": "object", "required": [ "prompt" ], "additionalProperties": false, "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 5000, "description": "Text description of the video content and visual style.", "examples": [ "A kitten running in the moonlight" ] }, "negative_prompt": { "type": "string", "maxLength": 500, "description": "Description of content to exclude from the video.", "examples": [ "low resolution, error, worst quality, deformed" ] }, "resolution": { "type": "string", "default": "720P", "enum": [ "720P", "1080P" ], "description": "Resolution tier of the generated video. 720P outputs at up to 1280×720; 1080P outputs at up to 1920×1080." }, "ratio": { "type": "string", "default": "16:9", "enum": [ "16:9", "9:16", "1:1", "4:3", "3:4" ], "description": "Aspect ratio of the generated video." }, "duration": { "type": "integer", "minimum": 2, "maximum": 15, "default": 5, "description": "Duration of the generated video in seconds (2-15)." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility.", "examples": [ 42, 12345 ] }, "prompt_extend": { "type": "boolean", "default": true, "description": "Enable intelligent prompt rewriting for better results." } } } } } ``` --- # inference.wan2-7.vid2vid.v1 Source: https://docs.prodia.com/job-types/inference-wan2-7-vid2vid-v1/ ## Schema ```json { "type": "object", "required": [ "type", "config" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "inference.wan2-7.vid2vid.v1" ] }, "config": { "type": "object", "additionalProperties": false, "properties": { "video": { "type": "string", "format": "filename", "description": "Input video clip to continue. Supported formats: MP4, MOV. Duration: 2-10 seconds, max 100 MB.", "examples": [ "input.mp4", "clip.mov" ] }, "last_frame": { "type": "string", "format": "filename", "description": "Target last-frame image to guide the video continuation endpoint.", "examples": [ "last_frame.png", "end.jpg" ] }, "prompt": { "type": "string", "maxLength": 5000, "description": "Text description of the desired video continuation content and motion.", "examples": [ "The camera pans to reveal a mountain landscape" ] }, "negative_prompt": { "type": "string", "maxLength": 500, "description": "Description of content to exclude from the video.", "examples": [ "low resolution, error, worst quality, deformed" ] }, "resolution": { "type": "string", "default": "720P", "enum": [ "720P", "1080P" ], "description": "Resolution tier of the generated video." }, "duration": { "type": "integer", "minimum": 2, "maximum": 15, "default": 5, "description": "Total output video duration in seconds (2-15). The continuation length is this value minus the input clip duration." }, "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647, "description": "A randomness initializer for video reproducibility.", "examples": [ 42, 12345 ] }, "prompt_extend": { "type": "boolean", "default": true, "description": "Enable intelligent prompt rewriting for better results." } } } } } ``` ---