Images

Create image

POST
/images/generations

Use an image model to generate an image for a given prompt.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

prompt*string

A description of the desired images. Maximum length varies by model.

model*|

The model to use for image generation. See all of Together AI's image models

steps?integer

Number of generation steps.

Default20
image_url?string

URL of an image to use for image models that support it.

seed?integer

Seed used for generation. Can be used to reproduce image generations.

n?integer

Number of image results to generate.

Default1
height?integer

Height of the image to generate in number of pixels.

Default1024
width?integer

Width of the image to generate in number of pixels.

Default1024
negative_prompt?string

The prompt or prompts not to guide the image generation.

response_format?string

Format of the image response. Can be either a base64 string or a URL.

Value in

  • "base64"
  • "url"
guidance_scale?number

Adjusts the alignment of the generated image with the input prompt. Higher values (e.g., 8-10) make the output more faithful to the prompt, while lower values (e.g., 1-5) encourage more creative freedom.

Default3.5
output_format?string

The format of the image response. Can be either be jpeg or png. Defaults to jpeg.

Default"jpeg"

Value in

  • "jpeg"
  • "png"
image_loras?array<>

An array of objects that define LoRAs (Low-Rank Adaptations) to influence the generated image.

reference_images?array<>

An array of image URLs that guide the overall appearance and style of the generated image. These reference images influence the visual characteristics consistently across the generation.

disable_safety_checker?boolean

If true, disables the safety checker for image generation.

Response Body

application/json

curl -X POST "https://example.com/images/generations" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string",    "model": "black-forest-labs/FLUX.1-schnell-Free"  }'
{  "id": "string",  "model": "string",  "object": "list",  "data": [    {      "index": 0,      "b64_json": "string",      "type": "b64_json"    }  ]}