v1

latestOpenAPI 3.1.02026-07-24306.9 KB

Image Generation

post/api/models/external/v1

Request body

promptstring required

The text prompt for the image

negative_promptstring

What you don’t want in the image

filter_model'Playground_v2.5' | 'Photorealism' | 'Playground_v3' required

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

widthinteger

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

heightinteger

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

num_inference_stepsinteger

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

guidance_scaleinteger

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

scheduler'DPMPP_2M_K' | 'EULER_A' | 'DDIM' | 'PLMS' | 'EULER' | 'HEUN' | 'DPM2' | 'DPM2_A' | 'LMS' | 'LMS_NIHANTH' | 'DPMPP_2M' | 'DPMPP_2M_LU' | 'DPMPP_2M_SDE' | 'DPMPP_2M_SDE_K' | 'DPMPP_2M_SDE_LU' | 'DPMPP_SDE' | 'DPMPP_SDE_K' | 'LMS_K'

Representing the scheduler to use

seedinteger

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

init_imagestring

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

strengthstring

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

expand_promptboolean

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

verify_prompt_safetyboolean

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_topicsstring[]

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_filter'cartoon' | 'vibrant_glass' | 'dreamy_stickers' | 'ultra_lighting' | 'watercolor' | 'macro_realism' | 'delicate_detail' | 'radiant_symmetry' | 'lush_illustration' | 'saturated_space' | 'neon_mecha' | 'ethereal_low_poly' | 'warm_box' | 'cinematic' | 'cinematic_warm' | 'wasteland' | 'flat_palette' | 'ominous_escape' | 'spielberg' | 'royalistic' | 'masterpiece' | 'wall_art' | 'haze' | 'black_and_white_3d' | 'cinematic_dimensions' | 'futuristic_illumination' | 'photorealistic' | 'cinematic_cold' | 'cute_low_poly_3d' | 'nikon_mode' | 'yellow_fog' | 'moody_impressions' | 'portrait' | 'hypersonic' | 'closeup' | 'old-timey'

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

Response

200

imagesstring[]
nsfw_content_detectedboolean[]

Example response

{
  "images": [
    "b64 encoded image here"
  ]
}
All 3 operations