---
title: "Image To Image"
method: POST
path: "/api/generate/image-to-image"
tags: ["generate"]
---

# Image To Image

`POST /api/generate/image-to-image`

## Request

- The document declares no server URL.
- Auth: none declared

Apply image transformations to a provided image.

## Request body `multipart/form-data`

- BodyGenImageToImage
  - `prompt` string, required: Text prompt(s) to guide image generation.
  - `image` string, binary, required: Uploaded image to modify with the pipeline.
  - `model_id` string: Hugging Face model ID used for image generation.
  - `loras` string: A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}.
  - `strength` number: Degree of transformation applied to the reference image (0 to 1).
  - `guidance_scale` number: Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality).
  - `image_guidance_scale` number: Degree to which the generated image is pushed towards the initial image.
  - `negative_prompt` string: Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1.
  - `safety_check` boolean: Perform a safety check to estimate if generated images could be offensive or harmful.
  - `seed` integer: Seed for random number generation.
  - `num_inference_steps` integer: Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength.
  - `num_images_per_prompt` integer: Number of images to generate per prompt.

## Response `200`

Successful Response

- ImageResponse: Response model for image generation.
  - `images` Media[], required: The generated images.
    - `url` string, required: The URL where the media can be accessed.
    - `seed` integer, required: The seed used to generate the media.
    - `nsfw` boolean, required: Whether the media was flagged as NSFW.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `422`: Validation Error
- `500`: Internal Server Error
- `default`: Error

## Changes

- **2025-10-30** `dfc937fc0d2c`: 6 breaking, 3 info
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `400`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `401`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `500`
  - removed the required property `oneOf[subschema #1: HTTPError]/detail/msg` from the response with the `400` status
  - …5 more
- **2025-10-30** `f5d01b71ba9a`: 3 breaking, 6 info
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `400`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `401`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `500`
  - removed `#/components/schemas/APIError` from the `oneOf[subschema #1: HTTPError]/detail` response property `allOf` list for the response status `400`
  - …5 more
- **2024-10-03** `cbf999b9a7cf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/livepeer/apis/livepeer-ai-api/changes/api/generate/image-to-image/post.md)

---

[API](https://skmtc.dev/livepeer/apis/livepeer-ai-api.md) - [All operations](https://skmtc.dev/livepeer/apis/livepeer-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/livepeer/apis/livepeer-ai-api/revisions/dfc937fc0d2c?raw)
