Skip to main content
POST
Image to Image V2
The Image-to-Image V2 API is deprecated and will be removed in the future.

POST Image to Image V2

This is the image-to-image endpoint. Only a task_id will be returned. You should use the task_id to call the /v2/progress API endpoint in order to retrieve the image generation results. The output is provided in the format of ā€œimage/pngā€. We will gradually phase out the V2 endpoints, and it is recommended to use the V3 endpoints to generate images.

Request Headers

string
required

Request Body

object
string¦null
required
Positive prompt words, separated by commas. If you want to use LoRA, you can call the /v3/model endpoint with the parameter filter.types=lora to retrieve the sd_name_in_api field as the model_name. Remember that the format for LoRA models is <lora:$sd_name:$weight>.
string¦null
Negative prompt words, separated by commas.
string¦null
required
This denoising process is called sampling because Stable Diffusion generates a new sample image at each step.
Enum: DPM++ 2M Karras, DPM++ SDE Karras, DPM++ 2M SDE Exponential, DPM++ 2M SDE Karras, Euler a, Euler, LMS, Heun, DPM2, DPM2 a, DPM++ 2S a, DPM++ 2M, DPM++ SDE, DPM++ 2M SDE, DPM++ 2M SDE Heun, DPM++ 2M SDE Heun Karras, DPM++ 2M SDE Heun Exponential, DPM++ 3M SDE, DPM++ 3M SDE Karras, DPM++ 3M SDE Exponential, DPM fast, DPM adaptive, LMS Karras, DPM2 Karras, DPM2 a Karras, DPM++ 2S a Karras, Restart, DDIM, PLMS, UniPC
integer¦null
required
Number of images generated in a single generation. Range: [0, 8]
integer¦null
required
Number of generations. Range: [0, 8]
integer¦null
required
Think of steps as iterations of the image creation process. Range: (0, 50]
number¦null
required
This setting indicates how closely Stable Diffusion will adhere to your prompt. Range: (0, 30]
integer¦null
A seed is a number from which Stable Diffusion generates noise.
integer
required
Height of the image. Range: (0, 2048]
integer
required
Width of the image. Range: (0, 2048]
string
required
Name of the stable diffusion model. You can call the /v3/model endpoint with the parameter filter.types=checkpoint to retrieve the sd_name_in_api field as the model_name.
string[]
required
number¦null
Indicates how much to transform the reference init_images. Must be between 0 and 1. init_images will be used as a starting point, with more noise added as the strength increases. The number of denoising steps depends on the amount of noise initially added. When denoising_strength is 1, added noise will be maximum, and the denoising process will run for the full number of iterations specified in steps. A value of 1, therefore, essentially ignores init_images.
boolean¦null
Enable Stable Diffusion restore faces plugin.
string¦null
VAE(Variational Auto Encoder),sd_vae can be access in api /v3/model with query params filter.types=vae to retrieve the sd_name field as the sd_vae.
integer¦null
This parameter indicates the number of layers to stop from the bottom during optimization, so clip_skip on 2 would mean, that in SD1.x model where the CLIP has 12 layers, you would stop at 10th layer.
string
Base64 of png, mask of inpaintings.
integer
Sets the degree of blurring of the border of the filled area.
integer¦null
Resize mode, while, 0 represent Just resize, 1 represent Crop and resize, 2 represent Resize and fill, 3 represent Just resize(latent upscale)
Enum: 0, 1, 2, 3
integer¦null
Image cfg scale
integer¦null
How to redraw the filled areas. 0: fill, Redraw based on the surrounding color 1: original, Redraw based on the original image 2: latent noise, Change back to noise and redraw 3: latent nothing, based on the color of the filled area
Enum: 0, 1, 2, 3
integer¦null
Specify whether to apply or protect the filled area. 0: Whole picture the entire illustration and change the filled parts. 1: Only masked Draws only the filled area and then restores the original image.
Enum: 0, 1
integer¦null
This settings controls how many additional pixels can be used as a reference point for only masked mode. You can increase the amount if you are having trouble with producing a proper image. This is a numerical value for how much margin to set when Only masked is selected. The downside of increasing this value is that it will decrease the quality of output. Guidance: https://civitai.com/articles/161/basic-inpainting-guide
integer
Specify whether to invert the mask. 0 - Inpaint Masked 1 - Inpaint Not Masked
Enum: 0, 1
number
Noise multiplier for img2img in settings. This scaling factor is applied to the random latent tensor for img2img. Lowering it reduces flickering.
integer
Image storage time (seconds). Range [0, 604800]
object
Refiner infos to enhances the image details.
object[]¦null
ControlNet.

Response

integer
string
object

Example

request
response
Last modified on July 24, 2026