You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/server/server_doc.yaml
+65-43Lines changed: 65 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ info:
3
3
title: sd.cpp HTTP Server
4
4
description: |
5
5
API documentation for the sd.cpp HTTP server.
6
-
6
+
7
7
**Note on Model Loading:** This server allows changing loaded models dynamically via the `/generate_image` POST request by providing the `id` of the model found in the `/models` endpoint.
8
8
- ID `-1`: Keep current model.
9
9
- ID `-2`: Unload model.
@@ -35,14 +35,14 @@ paths:
35
35
content:
36
36
application/json:
37
37
schema:
38
-
$ref: '#/components/schemas/GenerationRequest'
38
+
$ref: "#/components/schemas/GenerationRequest"
39
39
responses:
40
-
'200':
40
+
"200":
41
41
description: Successful generation
42
42
content:
43
43
application/json:
44
44
schema:
45
-
$ref: '#/components/schemas/GenerationResponse'
45
+
$ref: "#/components/schemas/GenerationResponse"
46
46
47
47
/txt2img:
48
48
post:
@@ -56,14 +56,14 @@ paths:
56
56
content:
57
57
application/json:
58
58
schema:
59
-
$ref: '#/components/schemas/GenerationRequest'
59
+
$ref: "#/components/schemas/GenerationRequest"
60
60
responses:
61
-
'200':
61
+
"200":
62
62
description: Successful generation
63
63
content:
64
64
application/json:
65
65
schema:
66
-
$ref: '#/components/schemas/GenerationResponse'
66
+
$ref: "#/components/schemas/GenerationResponse"
67
67
68
68
/result:
69
69
get:
@@ -79,13 +79,13 @@ paths:
79
79
required: true
80
80
description: The ID of the generation task.
81
81
responses:
82
-
'200':
82
+
"200":
83
83
description: Task result found
84
84
content:
85
85
application/json:
86
86
schema:
87
-
$ref: '#/components/schemas/ResultResponse'
88
-
'404':
87
+
$ref: "#/components/schemas/ResultResponse"
88
+
"404":
89
89
description: Task not found
90
90
content:
91
91
text/plain:
@@ -100,7 +100,7 @@ paths:
100
100
summary: Get Current Parameters
101
101
description: Returns the current configuration of the server (last used generation params and current system context).
102
102
responses:
103
-
'200':
103
+
"200":
104
104
description: Current parameters
105
105
content:
106
106
application/json:
@@ -121,29 +121,29 @@ paths:
121
121
summary: List all available models
122
122
description: Returns lists of models, VAEs, LoRAs, embeddings, etc., available on the filesystem. Use the `id` from these lists to switch models in `/generate_image`.
123
123
responses:
124
-
'200':
124
+
"200":
125
125
description: List of assets
126
126
content:
127
127
application/json:
128
128
schema:
129
129
type: object
130
130
properties:
131
131
models:
132
-
$ref: '#/components/schemas/ModelList'
132
+
$ref: "#/components/schemas/ModelList"
133
133
diffusion_models:
134
-
$ref: '#/components/schemas/ModelList'
134
+
$ref: "#/components/schemas/ModelList"
135
135
text_encoders:
136
-
$ref: '#/components/schemas/ModelList'
136
+
$ref: "#/components/schemas/ModelList"
137
137
vision_models:
138
-
$ref: '#/components/schemas/ModelList'
138
+
$ref: "#/components/schemas/ModelList"
139
139
vaes:
140
-
$ref: '#/components/schemas/ModelList'
140
+
$ref: "#/components/schemas/ModelList"
141
141
taes:
142
-
$ref: '#/components/schemas/ModelList'
142
+
$ref: "#/components/schemas/ModelList"
143
143
control_nets:
144
-
$ref: '#/components/schemas/ModelList'
144
+
$ref: "#/components/schemas/ModelList"
145
145
photo_makers:
146
-
$ref: '#/components/schemas/ModelList'
146
+
$ref: "#/components/schemas/ModelList"
147
147
loras:
148
148
type: array
149
149
items:
@@ -164,7 +164,7 @@ paths:
164
164
summary: Get currently loaded models
165
165
description: Returns the filenames of the currently loaded models in memory.
166
166
responses:
167
-
'200':
167
+
"200":
168
168
description: Currently loaded models
169
169
content:
170
170
application/json:
@@ -192,7 +192,7 @@ paths:
192
192
- Options
193
193
summary: Get available schedulers
194
194
responses:
195
-
'200':
195
+
"200":
196
196
description: List of scheduler names
197
197
content:
198
198
application/json:
@@ -208,7 +208,7 @@ paths:
208
208
deprecated: true
209
209
description: Use /schedulers instead.
210
210
responses:
211
-
'200':
211
+
"200":
212
212
description: List of scheduler names
213
213
content:
214
214
application/json:
@@ -222,7 +222,7 @@ paths:
222
222
- Options
223
223
summary: Get available sampling methods
224
224
responses:
225
-
'200':
225
+
"200":
226
226
description: List of sampling methods
227
227
content:
228
228
application/json:
@@ -237,7 +237,7 @@ paths:
237
237
summary: Get weight types
238
238
description: Available quantization types (e.g., f32, f16, q4_0).
239
239
responses:
240
-
'200':
240
+
"200":
241
241
description: List of types
242
242
content:
243
243
application/json:
@@ -253,7 +253,7 @@ paths:
253
253
deprecated: true
254
254
description: Use /wtypes instead.
255
255
responses:
256
-
'200':
256
+
"200":
257
257
description: List of types
258
258
content:
259
259
application/json:
@@ -267,7 +267,7 @@ paths:
267
267
- Options
268
268
summary: Get RNG types
269
269
responses:
270
-
'200':
270
+
"200":
271
271
description: List of RNG types
272
272
content:
273
273
application/json:
@@ -281,7 +281,7 @@ paths:
281
281
- Options
282
282
summary: Get Prediction types
283
283
responses:
284
-
'200':
284
+
"200":
285
285
description: List of prediction types
286
286
content:
287
287
application/json:
@@ -295,21 +295,21 @@ paths:
295
295
- Options
296
296
summary: Get Preview methods
297
297
responses:
298
-
'200':
298
+
"200":
299
299
description: List of preview methods
300
300
content:
301
301
application/json:
302
302
schema:
303
303
type: array
304
304
items: { type: string }
305
-
305
+
306
306
/lora_apply_modes:
307
307
get:
308
308
tags:
309
309
- Options
310
310
summary: Get LoRA apply modes
311
311
responses:
312
-
'200':
312
+
"200":
313
313
description: List of apply modes
314
314
content:
315
315
application/json:
@@ -363,15 +363,12 @@ components:
363
363
deprecated: true
364
364
description: Not implemented
365
365
366
-
367
366
GenerationResponse:
368
367
type: object
369
368
properties:
370
369
task_id:
371
370
type: string
372
-
description: Task ID if processed asynchronously.
373
-
status:
374
-
type: string
371
+
description: Task ID
375
372
376
373
# The complex request body parsing logic
377
374
GenerationRequest:
@@ -400,14 +397,16 @@ components:
400
397
type: integer
401
398
format: int64
402
399
default: -1
400
+
description: Seed for the RNG. -1 for random seed.
403
401
strength:
404
402
type: number
405
403
format: float
406
404
description: Img2Img strength.
407
405
control_strength:
408
406
type: number
409
407
format: float
410
-
408
+
description: ControlNet strength.
409
+
411
410
# --- Booleans ---
412
411
auto_resize_ref_image:
413
412
type: boolean
@@ -432,6 +431,9 @@ components:
432
431
type: array
433
432
items: { type: string }
434
433
description: Array of base64 encoded reference images (for edit models).
434
+
preview_method:
435
+
type: string
436
+
description: Method used for preview generation.
435
437
436
438
# --- Structured Parameters ---
437
439
sample_params:
@@ -446,8 +448,10 @@ components:
446
448
format: float
447
449
scheduler:
448
450
type: string
451
+
description: Scheduler name. Call /schedulers endpoint for available options.
449
452
sample_method:
450
453
type: string
454
+
description: Sampling method name. Call /sample_methods endpoint for available options.
451
455
guidance:
452
456
type: object
453
457
properties:
@@ -457,11 +461,14 @@ components:
457
461
img_cfg:
458
462
type: number
459
463
format: float
464
+
description: Advanced option, used for editing and inpaint models
460
465
distilled_guidance:
461
466
type: number
462
467
format: float
468
+
description: Used for guidance-distilled models such as Flux.1[Dev]
463
469
slg:
464
470
type: object
471
+
description: Skip-Layer Guidance (Advanced, can improve results on SD3.5 models)
465
472
properties:
466
473
layer_start:
467
474
type: number
@@ -474,6 +481,7 @@ components:
474
481
format: float
475
482
layers:
476
483
type: array
484
+
description: Array of layers to skip for SLG pass
477
485
items:
478
486
type: integer
479
487
@@ -501,7 +509,7 @@ components:
501
509
- type: integer
502
510
- type: string
503
511
- type: array
504
-
items:
512
+
items:
505
513
type: integer
506
514
507
515
pm_params:
@@ -513,14 +521,12 @@ components:
513
521
format: float
514
522
id_embed_path:
515
523
type: string
524
+
description: Path to the ID embedding file for PhotoMaker-v2. Should correspond exactly to the id_images.
516
525
id_images:
517
526
type: array
518
527
description: Array of base64 encoded ID images for PhotoMaker.
519
528
items:
520
529
type: string
521
-
preview_method:
522
-
type: string
523
-
description: Method used for preview generation.
524
530
525
531
# --- Context / System Parameters (Trigger Reloads) ---
526
532
n_threads:
@@ -536,11 +542,12 @@ components:
536
542
type: string
537
543
lora_apply_mode:
538
544
type: string
539
-
545
+
540
546
vae_decode_only:
541
547
type: boolean
542
548
free_params_immediately:
543
549
type: boolean
550
+
description: Free parameters immediately after generation. Enabling it will cause the model to reload on every generation.
544
551
offload_params_to_cpu:
545
552
type: boolean
546
553
keep_clip_on_cpu:
@@ -553,9 +560,24 @@ components:
553
560
type: boolean
554
561
taesd_preview:
555
562
type: boolean
563
+
description: Prevents TAE model from replacing VAE when decoding the final image, only uisng TAE for preview
564
+
diffusion_conv_direct:
565
+
type: boolean
566
+
vae_conv_direct:
567
+
type: boolean
568
+
force_sdxl_vae_conv_scale:
569
+
type: boolean
570
+
chroma_use_dit_mask:
571
+
type: boolean
572
+
description: Better results with Chroma models when kept to true; but might cause issues on some backends
573
+
chroma_use_t5_mask:
574
+
type: boolean
575
+
description: Should be kept to false unless you know what you are doing
556
576
chroma_t5_mask_pad:
557
577
type: integer
558
-
578
+
flow_shift:
579
+
type: float
580
+
559
581
# --- Model Loading (Index based) ---
560
582
# Index: -1 (Keep), -2 (Unload), >=0 (Load from list)
0 commit comments