Create a generation task
POST /task
Start to generate a new image.
Request Body required
Create a generation task with parameters.
object
The schema fully defines the parameters allowed for the image generation tasks we currently support. You can learn about the specific functions of some parameters by searching for the term “stable diffusion glossary.”
object
What you want to see in the generated image. The prompt is a short sentence or a few words that describe the content of the image.
We support partial “attention” or “emphasis” in prompts with round brackets like A1111 WebUI or ComfyUI. But Square brackets and curly braces are not supported.
Whether to apply ControlNet Tile for image upscaling. Only available when using both the upscale and mediaId field.
The image you input when using i2i. The mediaId and mediaUrl can only pass in one.
The image you input when using i2i. The mediaId and mediaUrl can only pass in one.
The negative prompts are used to guide the model to avoid generating certain content. The negative prompts are a short sentence or a few words that describe the content you do not want to see in the generated image. Usually, even if you don’t pass this parameter, we will provide some common parameters.
The number of steps to sample from the model. The higher the value the more specific the picture will be. It also means higher time and cost. Each model will have its own default values. This value is usually between 20 and 25.
The method used to sample from the model. Each model will have its own default values. You can learn about the parameter values we support through our documentation.
The Classifier-Free Guidance (CFG) scale controls how closely the AI follows your prompts. Also, when the scale is low, AI tends to produce softer, painterly pictures. We will not strictly limit the value of this parameter. But we recommend keeping the scale below 7.
The id of the model version in model market. You can find the URL of the model version.
This field will use Hires Fix to upscale your final image.
Sampling method used for Hires Fix phase.
Method used for upscaling the image before applying diffusion model to it.
Strength of the denoising process in the Hires fix phase.
Sampling steps of the Hires fix phase.
This field is used to control the multiple of enlargement.
This field control what model to use to enlarge the image.
When you are using text to image this field control the size of the result image.
When you are using text to image this field control the size of the result image.
The strength field allow you to specify how much the existing picture should be altered to look like a different one. At maximum strength, you will get pictures with the Variation seed, at minimum - pictures with the original Seed
ControlNet is a term that could refer to various concepts depending on the context.
object
The reference image id for the control net.
The type of the control net.
Currently, we support the following types: dwpose
, openpose_full
, canny
, depth
, hed
, mlsd
, openpose
, seg
, normal
, scribble
.
You can learn the details of each type in our generation panel.
LoRA in the context of stable diffusion is a machine learning technique for fine-tuning generative models to adjust their outputs without extensive retraining. It allows for efficient model customization and control over the generated content. The format of the lora field is a JSON object. The key is the version id of the lora model in the model market. The value is the weight of the lora to be applied. The weight is a float number between 0 and 1.
object
LatentCouple is a technology to determine the region of the latent space that reflects your sub-prompts. You can reference the original project to learn the details.
object
The type of the latent couple. The value can be “rect”.
The number of divisions in the latent space.
The positions of the latent couple.
The weights of the latent couple.
The mask image you input when using i2i with inpainting. The maskMediaId and maskMediaUrl can only pass in one.
The mask image you input when using i2i with inpainting. The maskMediaId and maskMediaUrl can only pass in one.
The number of images to generate in one task.
Whether to apply the After-Detailer to the image for face fixing.
Specify the number of last layers of CLIP model to stop at
The id of the VAE model version in model market. VAE models can help you adjust the saturations and coloring for your image. Explore with our available options to enhance your images.
object
You can use this field to specify which workflow you want to execute. The format is {username}/{workflowUniqueId}:{versionName}
.
The inputs field is used to call the workflow with the specified inputs.
object
IP-adapter (Image Prompt adapter) is a Stable Diffusion add-on for using images as prompts. You can use it to copy the style, composition, or a face in the reference image.
object
The reference images media id list.
The URL to receive the task status update. The callback URL should be a public URL that can be accessed by our server. We will send a POST request to the callback URL with the task status update.
Responses
200
Successful operation
object
The unique identifier for the task.
The status of the task.
The time the task was created.
The time the task was last updated.
The outputs of the task.
object
The media IDs generated by the task. You can use these IDs to fetch detailed information about the generated media.
The images you generate are usually not permanently retained. You need to retrieve your images as soon as possible.
The public URL of the images generated by the task.
The images you generate are usually not permanently retained. You need to retrieve your images as soon as possible. If an image is not available, it MAY be replaced by null in the array.
Headers
A unique identifier for the request. This is useful for debugging and tracing requests.
422
Validation exception
Headers
A unique identifier for the request. This is useful for debugging and tracing requests.
429
Too many requests
Headers
A unique identifier for the request. This is useful for debugging and tracing requests.