POST
/
api
/
v1
/
client
/
txt2img
Text to Image
curl --request POST \
  --url http://localhost:8000/api/v1/client/txt2img \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "a cat floating in a nebula, photorealistic",
  "model": "Flux1schnell",
  "width": 1024,
  "height": 1024,
  "steps": 4,
  "guidance": 1,
  "seed": -1,
  "negative_prompt": "<string>",
  "loras": [
    {
      "name": "<string>",
      "weight": 1
    }
  ],
  "webhook_url": "<string>"
}
'
{
  "data": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Authorizations

Authorization
string
header
required

API key obtained from the ModelBeam dashboard

Body

application/json
prompt
string
required

Text description of the image to generate

Minimum string length: 1
Example:

"a cat floating in a nebula, photorealistic"

model
string
required

Model slug from /models endpoint

Example:

"Flux1schnell"

width
integer
required

Image width in pixels

Required range: 256 <= x <= 2048
Example:

1024

height
integer
required

Image height in pixels

Required range: 256 <= x <= 2048
Example:

1024

steps
integer
required

Number of inference steps

Required range: 1 <= x <= 50
Example:

4

guidance
number
default:1

CFG scale / guidance strength

Required range: 0 <= x <= 20
seed
integer
default:-1

Random seed (-1 for random)

negative_prompt
string

What to avoid in the image

loras
object[]

LoRA adapters to apply

webhook_url
string

HTTPS URL for status notifications

Maximum string length: 2048

Response

Generation job created

data
object