Image Generation

All response images are base64 PNG.

Body Params
string
required

The text prompt for the image

string

What you don’t want in the image

string
enum
required

String representing which model to use. If no value is set, our latest model will be used.

Allowed:
int32
Defaults to 1024

For Playground v3, width and height must be divisible by 32

int32
Defaults to 1024

For Playground v3, width and height must be divisible by 32

int32
Defaults to 50

The number of iterations to take in the diffusion. Roughly corresponds to the resulting image’s detail and quality. Maximum 150.

int32

Default: 3 with Playground_v2, 7 with other models. Scale for the amount of influence the prompt will have on the resulting image

string
enum
Defaults to DPMPP_2M_K

Representing the scheduler to use

int32
Defaults to null

0 < seed < 2^16. Used to seed the random number generator

string

Base64 representation of the initial image for img2img. We support PIL image formats: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html

string

For img2img, how much of the image will be reproduced (0 reproduces the init_image, 1 will be entirely new)

boolean
Defaults to false

Uses an LLM to generate a prompt that is more aesthetic, diverse, and interesting

boolean
Defaults to false

Run a model to verify that the prompt is safe across a number of bases. This may add up to 500ms of latency

prompt_rejection_topics
array of strings

A list of topics that should be rejected if the user prompt references / contains. Will be rejected with error code PROMPT_UNSAFE. For example: gambling, brand logos

prompt_rejection_topics
string
enum

Filter to apply to the prompt of the image. These do not use a separate image model.

Responses

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