Create Image Generation

Creates a generation for the text prompt

post/v1/image/generation

Request

  • The document declares no server URL.
  • Auth: OAuth 2 (password, token URL token)

Request body

model_namestring required
heightinteger required
widthinteger required
promptstring required
prompt_2string nullable
negative_promptstring nullable
negative_prompt_2string nullable
backendstring

backend=auto will automatically select the backend from ['torch', 'tvm']. The torch backend supports various resolutions, but is slower. The tvm backend is faster, but only supports specific heights and widths.

seedinteger nullable

Random noise seed, default a random seed

cfg_scalenumber

Higher guidance scale encourages to generate images that are closely linked to the text prompt

samplerstring nullable
stepsinteger
style_presetstring nullable
enable_refinerboolean
controlnet_namestring nullable

If the controlnet_name is provided, please also send the image as the guidance of generation

controlnet_imagestring nullable

The ControlNet input condition to provide guidance to the generation

imagestring nullable
loraobject
strengthnumber nullable

Example request

{
  "model_name": "SDXL1.0-base",
  "height": 1024,
  "width": 1024,
  "prompt": "a photo of an astronaut riding a horse on mars"
}

Response

Successful Response

inference_timenumber required

Changes

No recorded changes to this operation across all 1 revision of this API.