---
title: "Image-to-image with prompt"
method: POST
path: "/v1/generation/{engine_id}/image-to-image"
tags: ["Version1.Image"]
---

# Image-to-image with prompt

`POST /v1/generation/{engine_id}/image-to-image`

Produce an image from an existing image using a text prompt. 
### How to control strength of generation
To preserve only roughly 35% of the initial image, pass in either `init_image_mode=IMAGE_STRENGTH` and `image_strength=0.35` or `init_image_mode=STEP_SCHEDULE` and `step_schedule_start=0.65`.  Both of these are equivalent, however `init_image_mode=STEP_SCHEDULE` also lets you pass in `step_schedule_end`, which can provide an extra level of control for those who need it.  For more details, see the specific fields below.  

> NOTE: Only **Version 1** engines will work with this endpoint.

## Path parameters

- `engine_id` string, required

## Headers

- `Organization` string
- `Stability-Client-ID` string
- `Stability-Client-Version` string

## Response `200`

Generation successful.

- object — An array of results from the generation request, where each image is a base64 encoded PNG.
  - `artifacts` Image[]
    - `base64` string — Image encoded in base64
    - `finishReason` 'SUCCESS' | 'ERROR' | 'CONTENT_FILTERED'
    - `seed` number — The seed associated with this image

## Other responses

- `400` — bad_request: one or more parameters were invalid.
- `401` — unauthorized: API key missing or invalid
- `403` — permission_denied: You lack the necessary permissions to perform this action
- `404` — not_found: The requested resource/engine was not found
- `500` — server_error: Some unexpected server error occurred

---

[API](https://skmtc.net/nod-ai/apis/stabilityai-rest-api.md) · [All operations](https://skmtc.net/nod-ai/apis/stabilityai-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nod-ai/stabilityai-rest-api/versions/ea57a82c5c16/schema)
