Submit a text-to-image task - sd_txt2img
API description
Generates images from text using Stable Diffusion.
Prerequisites
If you have integrated the Video Factory SDK, see Previous Version SDK Reference.
Authorization
To obtain an AK/SK, see API Authorization.
Endpoint
https://openai.edu-aliyun.comPath
/scc/sd_txt2imgRequest 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 VAE decoder. Common options include the following: Automatic "None": Disables the VAE. "sdxl_vae.safetensors": The VAE used with XL models. | |||
clip_skip | int | The number of CLIP layers to skip at the end. | |||
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 | Number of iterations | |||
cfg_scale | double | Prompt relevance. | |||
width | integer | The width of the image. | |||
height | integer | The height of the image. | |||
sampler_name | string | The sampler. | |||
seed | long | The random seed. | |||
alwayson_scripts | object | Input parameters for plugins. | |||
controlnet | object | ControlNet parameters. | |||
units | array | A list of control units. | |||
module | string | The ControlNet preprocessor. | |||
model | string | The ControlNet model. | |||
input_image | string | The ControlNet reference image. | |||
guidance_start | integer | The point at which ControlNet starts to take effect. The value ranges from 0 to 1. The default value is 0. | |||
guidance_end | integer | The point at which ControlNet stops taking effect. | |||
weight | double | The control strength. The value ranges from 0 to 2. A larger weight results in a more pronounced effect on the image. The default value is 1. | |||
Data parameters
Name | Type | Description |
taskId | string | The ID of the image generation task. |
status | string | The task status. Valid values: `succeeded`: The task was successful. `failed`: The task failed. `running`: The task is in progress. `waiting`: The task is in a queue. |
To retrieve the result of the image generation task, see Query image generation results - sd_get_result.