Generate an Image

Generate an image by providing a text description. Generations usually take bettween 4-20 seconds per image. Total generation time depends on the number of steps and noOfImages you select. This endpoint will submit the generation job and return immediately. To retrieve the results you must provide a webhook URL or query/poll the Get a Single Image Job endpoint.

Path Params
string
required

The ID of the model to use to generate images. This can be a custom model, or a public model. To view the list of public models, visit: https://docs.tryleap.ai/public-models

Body Params

The parameters to use to generate the image.

string
required
Defaults to A photo of an astronaut riding a horse

A text description of the image you what you want to generate.

string
Defaults to asymmetric, watermarks

A text description of what the image should try to avoid generating.

number
Defaults to 50

How many steps the AI will take to generate the image. Lower is faster but less detailed, higher is slower more detailed.

number
Defaults to 1024

The width of the image to use for the inference. Must be a multiple of 8. For best results use 1024x1024 for SDXL, and 512x512 for other models.

number
Defaults to 1024

The height of the image to use for the inference. Must be a multiple of 8. For best results use 1024x1024 for SDXL, and 512x512 for other models.

number
Defaults to 1

The number of images to generate, up to 4.

number
Defaults to 7

The higher the prompt strength, the closer the generated image will be to the prompt. Must be between 0 and 30.

number
Defaults to 4523184

A random number to use as a seed when generating the image. This is helpful if you want to generate the same image multiple times. If you want to generate different images, keep this empty or provide a random number.

string

An optional webhook URL that will be called with a POST request when the image generation request completes.

Response

Language
Credentials
Bearer
JWT
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json