Skip to main content

Text to image

POST 

/v1/text-to-image

Create an image given a prompt describing the image. See available models at this pricing table.

Request

Header Parameters

    X-Friendli-Team string

    ID of a team to run request as.

Body

    model stringrequired

    Code of the model to use. See available model list.

    prompt stringrequired

    A text description of the desired image(s).

    negative_prompt string

    A text specifying what you don't want in your image(s).

    num_outputs integer

    Possible values: <= 16

    The number of images to generate. Must be between 1 and 16. Only 1 output will be generated when not provided.

    num_inference_steps integer

    Possible values: <= 500

    The number of inference steps for denoising process. 50 steps will be taken when not provided.

    guidance_scale number

    Guidance scale to control how much generation process adheres to the text prompt. When not provided, it is set to 7.5.

    seed integer[]

    Seed to control random procedure. If nothing is given, the API generate the seed randomly.

    response_format string

    Possible values: [raw, png, jpeg, url]

    Default value: url

    The format in which the generated images are returned.

Responses

Successfully generated image(s).

Schema
    data object[]required

    Generation data.

  • Array [
  • format stringrequired

    Possible values: [raw, png, jpeg, url]

    Format of the generated images in response.

    seed integerrequired

    Random seed used for the generation.

    b64_json binaryrequired

    The base64-encoded JSON of the generated image.

  • ]
Loading...