Generate Image
POST
/api/image/generate
const url = 'https://example.com/api/image/generate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"workflow":"flux_gguf_q4_1024","character":"example","characters":[{"id":"example","role":"example","reference_image":"example","lora_strength":1}],"lora_checkpoint":"latest","prompt":"portrait of a woman, natural window light, sharp focus","negative":"blurry, low quality, watermark","description":"The ridge at dusk, second pass","width":1,"height":1,"seed":1,"filename_prefix":"images/character_portrait","steps":1,"cfg":1,"sampler":"example","scheduler":"example","guidance":4,"unet":"example","clip":"example","vae":"example","lora_strength":1,"image":"images/source.png","denoise":1,"checkpoint":"sd_xl_base_1.0.safetensors","workflow_params":{},"provider":"local-gpu-1","submit":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/image/generate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "workflow": "flux_gguf_q4_1024", "character": "example", "characters": [ { "id": "example", "role": "example", "reference_image": "example", "lora_strength": 1 } ], "lora_checkpoint": "latest", "prompt": "portrait of a woman, natural window light, sharp focus", "negative": "blurry, low quality, watermark", "description": "The ridge at dusk, second pass", "width": 1, "height": 1, "seed": 1, "filename_prefix": "images/character_portrait", "steps": 1, "cfg": 1, "sampler": "example", "scheduler": "example", "guidance": 4, "unet": "example", "clip": "example", "vae": "example", "lora_strength": 1, "image": "images/source.png", "denoise": 1, "checkpoint": "sd_xl_base_1.0.safetensors", "workflow_params": {}, "provider": "local-gpu-1", "submit": true }'Submit a single image generation job.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ImageGenerateRequest
object
workflow
required
Workflow
Workflow id to run (e.g. from GET /api/workflows)
string
characters
prompt
required
Prompt
Positive prompt. Character triggers are auto-injected if missing.
string
guidance
Guidance
number
lora_strength
Lora Strength
number
provider
required
Provider
Provider id (see GET /api/providers)
string
submit
Submit
False returns workflow JSON without queueing
boolean
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
ImageGenerateResponse
object
ok
required
Ok
boolean
workflow
required
Workflow
string
Examplegenerated
{ "ok": true, "workflow": "example", "checkpoint": "example", "lora_name": "example", "prompt_id": "example", "number": 1, "node_errors": {}, "graph": {}}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}