Image

Generate images from text.


POSThttp://localhost:33322/v1/image/generations

Create image

Given a text prompt, generate 1 or more images according to the prompt.

Required attributes

  • Name
    prompt
    Type
    string
    Description

    A description of the images to be generated.

  • Name
    model
    Type
    string
    Description

    The model used for image generations. (WARNING: At the moment only "stable-diffusion-2-1" is allowed)

    • If the model name is "default", the chat model from the configuration is used (see Documentation » Configuration for details).

    • If the model name is a valid model name recognized by Edgen, it is what is used.

Optional attributes

  • Name
    width
    Type
    integer
    Description

    The width of the generated image.

  • Name
    height
    Type
    integer
    Description

    The height of the generated image.

  • Name
    uncond_prompt
    Type
    string
    Description

    The optional unconditional prompt.

  • Name
    steps
    Type
    integer
    Description

    The number of steps to be used in the diffusion process.

  • Name
    images
    Type
    integer
    Description

    The number of images to generate. Default: 1

  • Name
    seed
    Type
    integer
    Description

    The random number generator seed to use for the generation. By default, a random seed is used.

  • Name
    guidance_scale
    Type
    float
    Description

    The guidance scale to use for generation, that is, how much should the model follow the prompt. Values below 1 disable guidance. (the prompt is ignored)

  • Name
    vae_scale
    Type
    float
    Description

    The Variational Auto-Encoder scale to use for generation. Required if model is not a pre-made descriptor name. This value should probably not be set, if model is a pre-made descriptor name.

  • Default

Request

POST
/v1/chat/completions
curl http://localhost:33322/v1/image/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer no-key-required" \
-d '{
"model": "stable-diffusion-2-1",
"prompt": "A rusty robot"
}'

Response

{"images": [[123, 234, ..., 231, 213]]}