Submit an image-to-image task - sd_img2img
Description
This operation generates an image from an existing image using Stable Diffusion (SD).
Prerequisites
The AI Creation Workshop software development kit (SDK) is integrated. For more information, see SDK Reference for earlier versions.
Authorization
This operation uses an AccessKey pair (AccessKey ID and AccessKey secret) for authentication. For information about how to obtain an AccessKey pair, see API authorization.
Endpoint
https://openai.edu-aliyun.comRequest path
/scc/sd_img2imgRequest headers
Name | Type | Description | |
X-SP-RESOURCE-CONFIG-ID | string | The ID of the resource pool configuration. This parameter is optional. For more information about the format, see Resource pool configuration parameters. | |
Request parameters
Name | Type | Description |
stable_diffusion_model | string | The image generation model. This is the model file name on the platform. |
sd_vae | string | The Variational Autoencoder (VAE) decoder. Common options include the following: Automatic "None": Disables the VAE. "sdxl_vae.safetensors": The VAE used with XL models. |
init_images | list | A list of initial images. For more information about the image format, see Image field format. |
denoising_strength | double | Repaint Intensity |
prompt | string | The positive prompt. |
negtive_prompt | string | The negative prompt. |
batch_size | integer | The number of images to generate in each batch. |
steps | integer | The number of iteration steps. |
cfg_scale | double | The prompt relevance. |
width | integer | The image width. |
height | integer | The image height. |
sampler_name | string | The sampler. |
seed | long | The random seed. |
data parameters
Name | Type | Description |
taskId | string | The ID of the image generation task. |
status | string | The task status. A value of succeeded indicates that the task is successful. A value of failed indicates that the task failed. A value of running indicates that the task is in progress. A value of waiting indicates that the task is in a queue. |
To query the result of an image generation task, see Query an image generation result - sd_get_result.