A1111-compatible HTTP API served by FastAPI. Default port 8890, interactive docs at http://localhost:8890/docs.
- Base URL:
http://<host>:8890 - All
/sdapi/v1/*endpoints are protected by the API token (see Authentication). - Generation is queued: the API shares the single worker with the WebUI through the queue manager. A request while another one is running waits in the FIFO queue instead of failing.
- The API is wired for the model selected via
POST /sdapi/v1/options(used by Open WebUI) or thedefault_modelkey inconfig.txt.
Set FOOOSTI_API_TOKEN in docker-compose.yml to require a token.
Every /sdapi/v1/* request must then send it in the x-api-token header:
x-api-token: your-secret-token
- Wrong or missing token →
401{"detail": "invalid API token"}. - Empty
FOOOSTI_API_TOKEN→ endpoints are unauthenticated (the server prints a warning on startup). - Comparison uses a constant-time check (
hmac.compare_digest).
Landing page / banner. No auth.
Response — plain text:
Fooosti is running
Health probe. No auth.
Response:
{ "status": "ok" }Current options (A1111-compatible).
Response:
{
"sd_model_checkpoint": "juggernautXL_v8Rundiffusion.safetensors",
"sd_vae": "None"
}Persist options. A1111 clients (e.g. Open WebUI) POST back the dict they got from GET to switch the model.
Request:
{
"sd_model_checkpoint": "NoobAI-XL-Vpred-v1.0.safetensors"
}- Only
sd_model_checkpointis applied — it is written todefault_modelinconfig.txtand used by the next generation. - Response: the updated options object (same shape as
GET /sdapi/v1/options). - Invalid body →
400.
List available checkpoints from data/models/checkpoints/.
Response:
[
{ "title": "juggernautXL_v8Rundiffusion.safetensors", "model_name": "juggernautXL_v8Rundiffusion.safetensors", "hash": "" }
]Generate an image. Request body (Txt2ImgRequest):
Request:
{
"prompt": "a beautiful landscape at sunset, vibrant colors, detailed",
"negative_prompt": "worst quality, low quality, blurry, watermark",
"steps": 28,
"width": 832,
"height": 1216,
"batch_size": 1,
"cfg_scale": 4.5,
"seed": -1,
"sampler_name": "euler",
"scheduler_name": "simple",
"style_selections": ["Fooocus V2"],
"performance": "Speed",
"base_model_name": "NoobAI-XL-Vpred-v1.0.safetensors",
"sharpness": 2.0,
"metadata_scheme": "none"
}| Field | Type | Constraints |
|---|---|---|
prompt |
string | max 10000, default "" |
negative_prompt |
string | max 10000, default "" |
steps |
int | 1–200 |
width |
int | 16–2048 |
height |
int | 16–2048 |
batch_size |
int | 1–8 |
cfg_scale |
float | 1.0–30.0 |
seed |
int | -1 = random |
sampler_name |
string | any known sampler, e.g. euler, dpmpp_2m_sde |
scheduler_name |
string | any known scheduler, e.g. simple, karras |
style_selections |
string[] | style presets |
performance |
string | e.g. Speed, Quality |
base_model_name |
string | checkpoint filename only; path components are stripped |
sharpness |
float | |
metadata_scheme |
string |
All fields optional — omitted ones use current defaults from config.txt.
Response:
{
"images": ["data:image/png;base64,iVBORw0KGgo..."],
"parameters": { "prompt": "...", "...": "..." },
"info": "{\"prompt\": \"...\"}"
}images— array of base64-encoded data URIs (one per batch).- Errors:
500with{"detail": "..."}on failure or timeout. - The request waits in the queue while another generation is running (no
429); the timeout includes queue wait time. - Generation timeout default: 7200 s (
FOOOSTI_GENERATION_TIMEOUT).
Live progress of the in-flight generation.
Request:
GET /sdapi/v1/progress?skip_current_image=false
Response:
{
"progress": 0.42,
"eta_relative": 12.5,
"state": {
"skipped": false,
"interrupted": false,
"job": "txt2img",
"job_count": 1,
"job_no": 0,
"job_timestamp": "",
"sampling_step": 12,
"sampling_steps": 28
},
"current_image": null
}current_imageis a base64 preview; passskip_current_image=trueto omit it.- Idle (no task running) →
progress: 0.0.
Abort the in-flight generation. Request body: {}. Response: {}.
Skip the current image of the in-flight generation. Request body: {}. Response: {}.