---
title: "Image generations"
method: POST
path: "/v1/images/generations"
tags: ["Container.Image"]
---

# Image generations

`POST /v1/images/generations`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/v1/images/generations`
- Auth: none declared
- TypeScript: <https://skmtc.dev/friendli/apis/friendli-suite-api-reference/docs/v1/images/generations/post.ts> (a function with typed inputs; its response is checked against the schema)

Given a description, the model generates image.

## Request body

- ContainerImageGenerationBody
  - `model` string, nullable: Routes the request to a specific adapter.
  - `prompt` string, required: A text description of the desired image.
  - `num_inference_steps` integer: The number of inference steps to use during image generation. Defaults to 20. Supported range: [1, 50].
  - `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. Defaults to 0. This parameter may be irrelevant for certain models, such as `FLUX.Schnell`.
  - `seed` integer, nullable: The seed to use for image generation.
  - `response_format` 'raw' | 'jpeg', nullable: The format in which the generated image will be returned. One of `raw` and `jpeg`.
  - `control_images` ImageInput[], nullable: Optional input images used to condition or guide the generation process (e.g., for ControlNet or image editing models). This field is only applicable when using ControlNet or image editing models.
    - `image` string, required: An input image, provided either as a URL or a base64-encoded string. Maximum supported image size is 50 MiB.
  - `controlnet_weights` number[], nullable: A list of weights that determine the influence of each ControlNet model in the generation process. Each value must be within [0, 1], where 0 disables the corresponding ControlNet and 1 applies it fully. When multiple ControlNet models are used, the list length must match the number of control images. If omitted, all ControlNet models default to full influence (1.0). This field is only applicable when using ControlNet models.

## Response `200`

Successfully generated image.

- ContainerImageGenerateSuccess
  - `image` string, binary, required: The base64-encoded image.

## Other responses

- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/friendli/apis/friendli-suite-api-reference.md) - [All operations](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/revisions/38fb43993a11?raw)
