POST
/
pub
/
v1
/
generations

Adding ControlNet support for Flux

  • List all available ControlNets for Flux using List Controlnets API GET /pub/v1/controlnets?type=flux

    Response
    {
        "data": [
            {
                "base_model": "flux",
                "name": "Canny"
            },
            {
                "base_model": "flux",
                "name": "Depth"
            }
        ]
    }
    
  • Use the control_net in the request body with flux models and styles to generate images with ControlNet/Pose Lock

control_net when used with Flux Model or Style, the final output image aspect ratio will be of the same aspect ratio as the controlnet image associated with the asset_id.

The resize_mode and control_mode parameters are not supported for control_net when used with Flux Model or Style.

Example Requests

Introducing Flux models and styles

Flux model:
Place the name Flux in model field and you are good to go.

{
    .
    .
    model: "Flux",
    "prompt": {
        "negative": "",
        "positive": "a man looking into the camera."
    }
    .
    .
}

Note:

  1. For Flux, only Facelock, Characters and ControlNet are supported.
  2. weight and enable_facelock fields of character doesn’t apply for flux.
  3. control_net when used with Flux Model or Style, the final output image aspect ratio will be of the same aspect ratio as the controlnet image associated with the asset_id.
  4. resize_mode and control_mode fields of control_net doesn’t apply for flux.
  5. The only other fields relevant for flux are: aspect_ratio, batch_size, prompt and seed.

Flux styles:

  1. Query the list styles endpoint GET /pub/v1/styles?type=flux to view all available flux styles.
  2. To use styles, populate the style_detail field with name and base_model values.
    {
        .
        .
        "style_detail": {
            "name": "Black & White",
            "base_model": "flux",
        },
        "prompt": {
            "negative": "",
            "positive": "a man looking into the camera."
        }
        .
        .
    }
    

Note: Please start using this new field style_detail in request and response body for sd and sdxl generations as well. We will be gradually removing the older field style support.


When using the generation array, ensure that each object contains only one of the following properties: segment, style, model, true_touch, or narrator. These properties have a priority order as follows:

  1. segment
  2. style
  3. model
  4. true_touch
  5. narrator

If multiple properties are provided, the one with the highest priority will be used.

The narrator can be generated either by using a script paired with a voice(List all the available voices using GET /pub/v1/voices endpoint) or by utilizing an existing audio asset.

segment, true_touch and narrator generations only acknowledge parameters that are passed within their own objects.

For narrator generation make sure that video asset meets the following conditions to avoid generation failure:

  1. The maximum supported frame rate for a video asset is 30 FPS, calculated by dividing the total number of frames by the total duration.
  2. Maximum height and width of the video asset should be 1080 and 1920 respectively.

Headers

X-API-KEY
string
required

API key needed to access our public endpoints. You can find yours under the 'Account' section of the website

Body

application/json · object[]
aspect_ratio
enum<string>

The aspect ratio of the image for the generation

Available options:
1:1,
2:3,
3:2,
4:5,
16:9,
9:16
batch_size
integer

The batch size of the generation (Max permissible value depends on your subscription plan). Visit RenderNet pricing for more details

cfg_scale
number

AI guidance for this generation. Higher the value, the output will be closer to the prompt (but may result in distorted images after a point)

Required range: 4 < x < 12
character
object

If you want to create images of a character, use the character’s name in the positive prompt. Example: {character_name} riding a bike

control_net
object

The control net(pose control) for the generation if you want to use (optional)

facelock
object

The face you want to restore for the generation if you want to use (optional)

loras
object[]

Query the list resources endpoint GET /pub/v1/loras to view all available LoRAs. You can add multiple LoRAs to a single generation. Make sure your LoRAs have the same base model (SD 1.5 / SDXL) as your selected style/model.

model
string

Query the list models endpoint GET /pub/v1/models to view all available models.

narrator
object

For Narrator generation, pass either script or audio_asset_id along with other required details in narrator payload.

prompt
object

The prompt for the generation

quality
enum<string>

The quality of the image for the generation (Case Sensitive)

Available options:
Plus,
Regular
sampler
enum<string>

The sampler you want to use for the generation (Case Sensitive)

Available options:
DPM++ 2M Karras,
DPM++ 2M SDE Karras,
DPM++ 2S a Karras,
DPM++ SDE,
DPM++ SDE Karras,
Euler a
seed
integer

The seed for the generation (randomized if you don't want to use a seed)

segment
object

Changes the input asset image based on the find and replace prompts

steps
integer

The number of steps you want AI to take for the generation

Required range: 10 < x < 30
style
string

Query the list styles endpoint GET /pub/v1/styles to view all available styles.

style_detail
object

Query the list styles endpoint GET /pub/v1/styles to view all available styles.

true_touch
object

Enhances and upscales the input image passed in the asset_id

Response

201 - application/json
data
object
err
object

The error if the request was not successful