offgrid-sys 0.3.0

Low-level FFI bindings to llama.cpp (Vulkan/CPU), built from source.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
/* automatically generated by rust-bindgen 0.73.2 */

/// C `FILE`, opaque.
#[repr(C)]
pub struct FILE {
    _private: [u8; 0],
}
/// ggml tensor, opaque.
#[repr(C)]
pub struct ggml_tensor {
    _private: [u8; 0],
}

pub const rng_type_t_STD_DEFAULT_RNG: rng_type_t = 0;
pub const rng_type_t_CUDA_RNG: rng_type_t = 1;
pub const rng_type_t_CPU_RNG: rng_type_t = 2;
pub const rng_type_t_RNG_TYPE_COUNT: rng_type_t = 3;
pub type rng_type_t = ::std::os::raw::c_uint;
pub const sample_method_t_EULER_SAMPLE_METHOD: sample_method_t = 0;
pub const sample_method_t_EULER_A_SAMPLE_METHOD: sample_method_t = 1;
pub const sample_method_t_HEUN_SAMPLE_METHOD: sample_method_t = 2;
pub const sample_method_t_DPM2_SAMPLE_METHOD: sample_method_t = 3;
pub const sample_method_t_DPMPP2S_A_SAMPLE_METHOD: sample_method_t = 4;
pub const sample_method_t_DPMPP2M_SAMPLE_METHOD: sample_method_t = 5;
pub const sample_method_t_DPMPP2Mv2_SAMPLE_METHOD: sample_method_t = 6;
pub const sample_method_t_IPNDM_SAMPLE_METHOD: sample_method_t = 7;
pub const sample_method_t_IPNDM_V_SAMPLE_METHOD: sample_method_t = 8;
pub const sample_method_t_LCM_SAMPLE_METHOD: sample_method_t = 9;
pub const sample_method_t_DDIM_TRAILING_SAMPLE_METHOD: sample_method_t = 10;
pub const sample_method_t_TCD_SAMPLE_METHOD: sample_method_t = 11;
pub const sample_method_t_RES_MULTISTEP_SAMPLE_METHOD: sample_method_t = 12;
pub const sample_method_t_RES_2S_SAMPLE_METHOD: sample_method_t = 13;
pub const sample_method_t_ER_SDE_SAMPLE_METHOD: sample_method_t = 14;
pub const sample_method_t_EULER_CFG_PP_SAMPLE_METHOD: sample_method_t = 15;
pub const sample_method_t_EULER_A_CFG_PP_SAMPLE_METHOD: sample_method_t = 16;
pub const sample_method_t_EULER_GE_SAMPLE_METHOD: sample_method_t = 17;
pub const sample_method_t_DPMPP2M_SDE_SAMPLE_METHOD: sample_method_t = 18;
pub const sample_method_t_DPMPP2M_SDE_BT_SAMPLE_METHOD: sample_method_t = 19;
pub const sample_method_t_LMS_SAMPLE_METHOD: sample_method_t = 20;
pub const sample_method_t_SAMPLE_METHOD_COUNT: sample_method_t = 21;
pub type sample_method_t = ::std::os::raw::c_uint;
pub const scheduler_t_DISCRETE_SCHEDULER: scheduler_t = 0;
pub const scheduler_t_KARRAS_SCHEDULER: scheduler_t = 1;
pub const scheduler_t_EXPONENTIAL_SCHEDULER: scheduler_t = 2;
pub const scheduler_t_AYS_SCHEDULER: scheduler_t = 3;
pub const scheduler_t_GITS_SCHEDULER: scheduler_t = 4;
pub const scheduler_t_SGM_UNIFORM_SCHEDULER: scheduler_t = 5;
pub const scheduler_t_SIMPLE_SCHEDULER: scheduler_t = 6;
pub const scheduler_t_SMOOTHSTEP_SCHEDULER: scheduler_t = 7;
pub const scheduler_t_KL_OPTIMAL_SCHEDULER: scheduler_t = 8;
pub const scheduler_t_LCM_SCHEDULER: scheduler_t = 9;
pub const scheduler_t_BONG_TANGENT_SCHEDULER: scheduler_t = 10;
pub const scheduler_t_LTX2_SCHEDULER: scheduler_t = 11;
pub const scheduler_t_LOGIT_NORMAL_SCHEDULER: scheduler_t = 12;
pub const scheduler_t_FLUX2_SCHEDULER: scheduler_t = 13;
pub const scheduler_t_FLUX_SCHEDULER: scheduler_t = 14;
pub const scheduler_t_BETA_SCHEDULER: scheduler_t = 15;
pub const scheduler_t_LLADA_IMAGE_SCHEDULER: scheduler_t = 16;
pub const scheduler_t_SCHEDULER_COUNT: scheduler_t = 17;
pub type scheduler_t = ::std::os::raw::c_uint;
pub const prediction_t_EPS_PRED: prediction_t = 0;
pub const prediction_t_V_PRED: prediction_t = 1;
pub const prediction_t_EDM_V_PRED: prediction_t = 2;
pub const prediction_t_FLOW_PRED: prediction_t = 3;
pub const prediction_t_FLUX_FLOW_PRED: prediction_t = 4;
pub const prediction_t_SEFI_FLOW_PRED: prediction_t = 5;
pub const prediction_t_MINIT2I_FLOW_PRED: prediction_t = 6;
pub const prediction_t_SENSENOVA_U1_FLOW_PRED: prediction_t = 7;
pub const prediction_t_PREDICTION_COUNT: prediction_t = 8;
pub type prediction_t = ::std::os::raw::c_uint;
pub const sd_type_t_SD_TYPE_F32: sd_type_t = 0;
pub const sd_type_t_SD_TYPE_F16: sd_type_t = 1;
pub const sd_type_t_SD_TYPE_Q4_0: sd_type_t = 2;
pub const sd_type_t_SD_TYPE_Q4_1: sd_type_t = 3;
pub const sd_type_t_SD_TYPE_Q5_0: sd_type_t = 6;
pub const sd_type_t_SD_TYPE_Q5_1: sd_type_t = 7;
pub const sd_type_t_SD_TYPE_Q8_0: sd_type_t = 8;
pub const sd_type_t_SD_TYPE_Q8_1: sd_type_t = 9;
pub const sd_type_t_SD_TYPE_Q2_K: sd_type_t = 10;
pub const sd_type_t_SD_TYPE_Q3_K: sd_type_t = 11;
pub const sd_type_t_SD_TYPE_Q4_K: sd_type_t = 12;
pub const sd_type_t_SD_TYPE_Q5_K: sd_type_t = 13;
pub const sd_type_t_SD_TYPE_Q6_K: sd_type_t = 14;
pub const sd_type_t_SD_TYPE_Q8_K: sd_type_t = 15;
pub const sd_type_t_SD_TYPE_IQ2_XXS: sd_type_t = 16;
pub const sd_type_t_SD_TYPE_IQ2_XS: sd_type_t = 17;
pub const sd_type_t_SD_TYPE_IQ3_XXS: sd_type_t = 18;
pub const sd_type_t_SD_TYPE_IQ1_S: sd_type_t = 19;
pub const sd_type_t_SD_TYPE_IQ4_NL: sd_type_t = 20;
pub const sd_type_t_SD_TYPE_IQ3_S: sd_type_t = 21;
pub const sd_type_t_SD_TYPE_IQ2_S: sd_type_t = 22;
pub const sd_type_t_SD_TYPE_IQ4_XS: sd_type_t = 23;
pub const sd_type_t_SD_TYPE_I8: sd_type_t = 24;
pub const sd_type_t_SD_TYPE_I16: sd_type_t = 25;
pub const sd_type_t_SD_TYPE_I32: sd_type_t = 26;
pub const sd_type_t_SD_TYPE_I64: sd_type_t = 27;
pub const sd_type_t_SD_TYPE_F64: sd_type_t = 28;
pub const sd_type_t_SD_TYPE_IQ1_M: sd_type_t = 29;
pub const sd_type_t_SD_TYPE_BF16: sd_type_t = 30;
pub const sd_type_t_SD_TYPE_TQ1_0: sd_type_t = 34;
pub const sd_type_t_SD_TYPE_TQ2_0: sd_type_t = 35;
pub const sd_type_t_SD_TYPE_MXFP4: sd_type_t = 39;
pub const sd_type_t_SD_TYPE_NVFP4: sd_type_t = 40;
pub const sd_type_t_SD_TYPE_Q1_0: sd_type_t = 41;
pub const sd_type_t_SD_TYPE_Q2_0: sd_type_t = 42;
pub const sd_type_t_SD_TYPE_F8_E4M3: sd_type_t = 43;
pub const sd_type_t_SD_TYPE_F8_E5M2: sd_type_t = 44;
pub const sd_type_t_SD_TYPE_COUNT: sd_type_t = 45;
pub type sd_type_t = ::std::os::raw::c_uint;
pub const sd_log_level_t_SD_LOG_DEBUG: sd_log_level_t = 0;
pub const sd_log_level_t_SD_LOG_VERBOSE: sd_log_level_t = 1;
pub const sd_log_level_t_SD_LOG_INFO: sd_log_level_t = 2;
pub const sd_log_level_t_SD_LOG_WARN: sd_log_level_t = 3;
pub const sd_log_level_t_SD_LOG_ERROR: sd_log_level_t = 4;
pub type sd_log_level_t = ::std::os::raw::c_uint;
pub const preview_t_PREVIEW_NONE: preview_t = 0;
pub const preview_t_PREVIEW_PROJ: preview_t = 1;
pub const preview_t_PREVIEW_TAE: preview_t = 2;
pub const preview_t_PREVIEW_VAE: preview_t = 3;
pub const preview_t_PREVIEW_COUNT: preview_t = 4;
pub type preview_t = ::std::os::raw::c_uint;
pub const lora_apply_mode_t_LORA_APPLY_AUTO: lora_apply_mode_t = 0;
pub const lora_apply_mode_t_LORA_APPLY_IMMEDIATELY: lora_apply_mode_t = 1;
pub const lora_apply_mode_t_LORA_APPLY_AT_RUNTIME: lora_apply_mode_t = 2;
pub const lora_apply_mode_t_LORA_APPLY_MODE_COUNT: lora_apply_mode_t = 3;
pub type lora_apply_mode_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_tiling_params_t {
    pub enabled: bool,
    pub temporal_tiling: bool,
    pub tile_size_w: ::std::os::raw::c_int,
    pub tile_size_h: ::std::os::raw::c_int,
    pub target_overlap: f32,
    pub rel_size_w: f32,
    pub rel_size_h: f32,
    pub extra_tiling_args: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_tiling_params_t",
    ][::std::mem::size_of::<sd_tiling_params_t>() - 32usize];
    [
        "Alignment of sd_tiling_params_t",
    ][::std::mem::align_of::<sd_tiling_params_t>() - 8usize];
    [
        "Offset of field: sd_tiling_params_t::enabled",
    ][::std::mem::offset_of!(sd_tiling_params_t, enabled) - 0usize];
    [
        "Offset of field: sd_tiling_params_t::temporal_tiling",
    ][::std::mem::offset_of!(sd_tiling_params_t, temporal_tiling) - 1usize];
    [
        "Offset of field: sd_tiling_params_t::tile_size_w",
    ][::std::mem::offset_of!(sd_tiling_params_t, tile_size_w) - 4usize];
    [
        "Offset of field: sd_tiling_params_t::tile_size_h",
    ][::std::mem::offset_of!(sd_tiling_params_t, tile_size_h) - 8usize];
    [
        "Offset of field: sd_tiling_params_t::target_overlap",
    ][::std::mem::offset_of!(sd_tiling_params_t, target_overlap) - 12usize];
    [
        "Offset of field: sd_tiling_params_t::rel_size_w",
    ][::std::mem::offset_of!(sd_tiling_params_t, rel_size_w) - 16usize];
    [
        "Offset of field: sd_tiling_params_t::rel_size_h",
    ][::std::mem::offset_of!(sd_tiling_params_t, rel_size_h) - 20usize];
    [
        "Offset of field: sd_tiling_params_t::extra_tiling_args",
    ][::std::mem::offset_of!(sd_tiling_params_t, extra_tiling_args) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_embedding_t {
    pub name: *const ::std::os::raw::c_char,
    pub path: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_embedding_t"][::std::mem::size_of::<sd_embedding_t>() - 16usize];
    ["Alignment of sd_embedding_t"][::std::mem::align_of::<sd_embedding_t>() - 8usize];
    [
        "Offset of field: sd_embedding_t::name",
    ][::std::mem::offset_of!(sd_embedding_t, name) - 0usize];
    [
        "Offset of field: sd_embedding_t::path",
    ][::std::mem::offset_of!(sd_embedding_t, path) - 8usize];
};
pub const sd_vae_format_t_SD_VAE_FORMAT_AUTO: sd_vae_format_t = -1;
pub const sd_vae_format_t_SD_VAE_FORMAT_FLUX: sd_vae_format_t = 0;
pub const sd_vae_format_t_SD_VAE_FORMAT_SD3: sd_vae_format_t = 1;
pub const sd_vae_format_t_SD_VAE_FORMAT_FLUX2: sd_vae_format_t = 2;
pub const sd_vae_format_t_SD_VAE_FORMAT_WAN: sd_vae_format_t = 3;
pub const sd_vae_format_t_SD_VAE_FORMAT_COUNT: sd_vae_format_t = 4;
pub type sd_vae_format_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_ctx_params_t {
    pub model_path: *const ::std::os::raw::c_char,
    pub clip_l_path: *const ::std::os::raw::c_char,
    pub clip_g_path: *const ::std::os::raw::c_char,
    pub clip_vision_path: *const ::std::os::raw::c_char,
    pub t5xxl_path: *const ::std::os::raw::c_char,
    pub llm_path: *const ::std::os::raw::c_char,
    pub llm_vision_path: *const ::std::os::raw::c_char,
    pub diffusion_model_path: *const ::std::os::raw::c_char,
    pub high_noise_diffusion_model_path: *const ::std::os::raw::c_char,
    pub uncond_diffusion_model_path: *const ::std::os::raw::c_char,
    pub embeddings_connectors_path: *const ::std::os::raw::c_char,
    pub vae_path: *const ::std::os::raw::c_char,
    pub audio_vae_path: *const ::std::os::raw::c_char,
    pub audio_encoder_path: *const ::std::os::raw::c_char,
    pub taesd_path: *const ::std::os::raw::c_char,
    pub control_net_path: *const ::std::os::raw::c_char,
    pub ip_adapter_path: *const ::std::os::raw::c_char,
    pub motion_module_path: *const ::std::os::raw::c_char,
    pub embeddings: *const sd_embedding_t,
    pub embedding_count: u32,
    pub photo_maker_path: *const ::std::os::raw::c_char,
    pub pulid_weights_path: *const ::std::os::raw::c_char,
    pub tensor_type_rules: *const ::std::os::raw::c_char,
    pub n_threads: ::std::os::raw::c_int,
    pub wtype: sd_type_t,
    pub rng_type: rng_type_t,
    pub sampler_rng_type: rng_type_t,
    pub prediction: prediction_t,
    pub lora_apply_mode: lora_apply_mode_t,
    pub enable_mmap: bool,
    pub flash_attn: bool,
    pub diffusion_flash_attn: bool,
    pub tae_preview_only: bool,
    pub diffusion_conv_direct: bool,
    pub vae_conv_direct: bool,
    pub force_sdxl_vae_conv_scale: bool,
    pub vae_format: sd_vae_format_t,
    pub max_vram: *const ::std::os::raw::c_char,
    pub disable_prefetch: bool,
    pub eager_load: bool,
    pub backend: *const ::std::os::raw::c_char,
    pub params_backend: *const ::std::os::raw::c_char,
    pub split_mode: *const ::std::os::raw::c_char,
    pub auto_fit: bool,
    pub rpc_servers: *const ::std::os::raw::c_char,
    pub model_args: *const ::std::os::raw::c_char,
    pub disable_segmented_compute: bool,
    pub batched_cfg: bool,
    pub linear_scale: f32,
    pub attn_scale: f32,
    pub tokenizer: *const ::std::os::raw::c_char,
    pub sage_attn: bool,
    pub conditioning_cache_size: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_ctx_params_t"][::std::mem::size_of::<sd_ctx_params_t>() - 320usize];
    ["Alignment of sd_ctx_params_t"][::std::mem::align_of::<sd_ctx_params_t>() - 8usize];
    [
        "Offset of field: sd_ctx_params_t::model_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, model_path) - 0usize];
    [
        "Offset of field: sd_ctx_params_t::clip_l_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, clip_l_path) - 8usize];
    [
        "Offset of field: sd_ctx_params_t::clip_g_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, clip_g_path) - 16usize];
    [
        "Offset of field: sd_ctx_params_t::clip_vision_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, clip_vision_path) - 24usize];
    [
        "Offset of field: sd_ctx_params_t::t5xxl_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, t5xxl_path) - 32usize];
    [
        "Offset of field: sd_ctx_params_t::llm_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, llm_path) - 40usize];
    [
        "Offset of field: sd_ctx_params_t::llm_vision_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, llm_vision_path) - 48usize];
    [
        "Offset of field: sd_ctx_params_t::diffusion_model_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, diffusion_model_path) - 56usize];
    [
        "Offset of field: sd_ctx_params_t::high_noise_diffusion_model_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, high_noise_diffusion_model_path)
        - 64usize];
    [
        "Offset of field: sd_ctx_params_t::uncond_diffusion_model_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, uncond_diffusion_model_path) - 72usize];
    [
        "Offset of field: sd_ctx_params_t::embeddings_connectors_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, embeddings_connectors_path) - 80usize];
    [
        "Offset of field: sd_ctx_params_t::vae_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, vae_path) - 88usize];
    [
        "Offset of field: sd_ctx_params_t::audio_vae_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, audio_vae_path) - 96usize];
    [
        "Offset of field: sd_ctx_params_t::audio_encoder_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, audio_encoder_path) - 104usize];
    [
        "Offset of field: sd_ctx_params_t::taesd_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, taesd_path) - 112usize];
    [
        "Offset of field: sd_ctx_params_t::control_net_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, control_net_path) - 120usize];
    [
        "Offset of field: sd_ctx_params_t::ip_adapter_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, ip_adapter_path) - 128usize];
    [
        "Offset of field: sd_ctx_params_t::motion_module_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, motion_module_path) - 136usize];
    [
        "Offset of field: sd_ctx_params_t::embeddings",
    ][::std::mem::offset_of!(sd_ctx_params_t, embeddings) - 144usize];
    [
        "Offset of field: sd_ctx_params_t::embedding_count",
    ][::std::mem::offset_of!(sd_ctx_params_t, embedding_count) - 152usize];
    [
        "Offset of field: sd_ctx_params_t::photo_maker_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, photo_maker_path) - 160usize];
    [
        "Offset of field: sd_ctx_params_t::pulid_weights_path",
    ][::std::mem::offset_of!(sd_ctx_params_t, pulid_weights_path) - 168usize];
    [
        "Offset of field: sd_ctx_params_t::tensor_type_rules",
    ][::std::mem::offset_of!(sd_ctx_params_t, tensor_type_rules) - 176usize];
    [
        "Offset of field: sd_ctx_params_t::n_threads",
    ][::std::mem::offset_of!(sd_ctx_params_t, n_threads) - 184usize];
    [
        "Offset of field: sd_ctx_params_t::wtype",
    ][::std::mem::offset_of!(sd_ctx_params_t, wtype) - 188usize];
    [
        "Offset of field: sd_ctx_params_t::rng_type",
    ][::std::mem::offset_of!(sd_ctx_params_t, rng_type) - 192usize];
    [
        "Offset of field: sd_ctx_params_t::sampler_rng_type",
    ][::std::mem::offset_of!(sd_ctx_params_t, sampler_rng_type) - 196usize];
    [
        "Offset of field: sd_ctx_params_t::prediction",
    ][::std::mem::offset_of!(sd_ctx_params_t, prediction) - 200usize];
    [
        "Offset of field: sd_ctx_params_t::lora_apply_mode",
    ][::std::mem::offset_of!(sd_ctx_params_t, lora_apply_mode) - 204usize];
    [
        "Offset of field: sd_ctx_params_t::enable_mmap",
    ][::std::mem::offset_of!(sd_ctx_params_t, enable_mmap) - 208usize];
    [
        "Offset of field: sd_ctx_params_t::flash_attn",
    ][::std::mem::offset_of!(sd_ctx_params_t, flash_attn) - 209usize];
    [
        "Offset of field: sd_ctx_params_t::diffusion_flash_attn",
    ][::std::mem::offset_of!(sd_ctx_params_t, diffusion_flash_attn) - 210usize];
    [
        "Offset of field: sd_ctx_params_t::tae_preview_only",
    ][::std::mem::offset_of!(sd_ctx_params_t, tae_preview_only) - 211usize];
    [
        "Offset of field: sd_ctx_params_t::diffusion_conv_direct",
    ][::std::mem::offset_of!(sd_ctx_params_t, diffusion_conv_direct) - 212usize];
    [
        "Offset of field: sd_ctx_params_t::vae_conv_direct",
    ][::std::mem::offset_of!(sd_ctx_params_t, vae_conv_direct) - 213usize];
    [
        "Offset of field: sd_ctx_params_t::force_sdxl_vae_conv_scale",
    ][::std::mem::offset_of!(sd_ctx_params_t, force_sdxl_vae_conv_scale) - 214usize];
    [
        "Offset of field: sd_ctx_params_t::vae_format",
    ][::std::mem::offset_of!(sd_ctx_params_t, vae_format) - 216usize];
    [
        "Offset of field: sd_ctx_params_t::max_vram",
    ][::std::mem::offset_of!(sd_ctx_params_t, max_vram) - 224usize];
    [
        "Offset of field: sd_ctx_params_t::disable_prefetch",
    ][::std::mem::offset_of!(sd_ctx_params_t, disable_prefetch) - 232usize];
    [
        "Offset of field: sd_ctx_params_t::eager_load",
    ][::std::mem::offset_of!(sd_ctx_params_t, eager_load) - 233usize];
    [
        "Offset of field: sd_ctx_params_t::backend",
    ][::std::mem::offset_of!(sd_ctx_params_t, backend) - 240usize];
    [
        "Offset of field: sd_ctx_params_t::params_backend",
    ][::std::mem::offset_of!(sd_ctx_params_t, params_backend) - 248usize];
    [
        "Offset of field: sd_ctx_params_t::split_mode",
    ][::std::mem::offset_of!(sd_ctx_params_t, split_mode) - 256usize];
    [
        "Offset of field: sd_ctx_params_t::auto_fit",
    ][::std::mem::offset_of!(sd_ctx_params_t, auto_fit) - 264usize];
    [
        "Offset of field: sd_ctx_params_t::rpc_servers",
    ][::std::mem::offset_of!(sd_ctx_params_t, rpc_servers) - 272usize];
    [
        "Offset of field: sd_ctx_params_t::model_args",
    ][::std::mem::offset_of!(sd_ctx_params_t, model_args) - 280usize];
    [
        "Offset of field: sd_ctx_params_t::disable_segmented_compute",
    ][::std::mem::offset_of!(sd_ctx_params_t, disable_segmented_compute) - 288usize];
    [
        "Offset of field: sd_ctx_params_t::batched_cfg",
    ][::std::mem::offset_of!(sd_ctx_params_t, batched_cfg) - 289usize];
    [
        "Offset of field: sd_ctx_params_t::linear_scale",
    ][::std::mem::offset_of!(sd_ctx_params_t, linear_scale) - 292usize];
    [
        "Offset of field: sd_ctx_params_t::attn_scale",
    ][::std::mem::offset_of!(sd_ctx_params_t, attn_scale) - 296usize];
    [
        "Offset of field: sd_ctx_params_t::tokenizer",
    ][::std::mem::offset_of!(sd_ctx_params_t, tokenizer) - 304usize];
    [
        "Offset of field: sd_ctx_params_t::sage_attn",
    ][::std::mem::offset_of!(sd_ctx_params_t, sage_attn) - 312usize];
    [
        "Offset of field: sd_ctx_params_t::conditioning_cache_size",
    ][::std::mem::offset_of!(sd_ctx_params_t, conditioning_cache_size) - 316usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_audio_t {
    pub sample_rate: u32,
    pub channels: u32,
    pub sample_count: u64,
    pub data: *mut f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_audio_t"][::std::mem::size_of::<sd_audio_t>() - 24usize];
    ["Alignment of sd_audio_t"][::std::mem::align_of::<sd_audio_t>() - 8usize];
    [
        "Offset of field: sd_audio_t::sample_rate",
    ][::std::mem::offset_of!(sd_audio_t, sample_rate) - 0usize];
    [
        "Offset of field: sd_audio_t::channels",
    ][::std::mem::offset_of!(sd_audio_t, channels) - 4usize];
    [
        "Offset of field: sd_audio_t::sample_count",
    ][::std::mem::offset_of!(sd_audio_t, sample_count) - 8usize];
    [
        "Offset of field: sd_audio_t::data",
    ][::std::mem::offset_of!(sd_audio_t, data) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_image_t {
    pub width: u32,
    pub height: u32,
    pub channel: u32,
    pub data: *mut u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_image_t"][::std::mem::size_of::<sd_image_t>() - 24usize];
    ["Alignment of sd_image_t"][::std::mem::align_of::<sd_image_t>() - 8usize];
    [
        "Offset of field: sd_image_t::width",
    ][::std::mem::offset_of!(sd_image_t, width) - 0usize];
    [
        "Offset of field: sd_image_t::height",
    ][::std::mem::offset_of!(sd_image_t, height) - 4usize];
    [
        "Offset of field: sd_image_t::channel",
    ][::std::mem::offset_of!(sd_image_t, channel) - 8usize];
    [
        "Offset of field: sd_image_t::data",
    ][::std::mem::offset_of!(sd_image_t, data) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_image_preprocess_params_t {
    pub rules: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_image_preprocess_params_t",
    ][::std::mem::size_of::<sd_image_preprocess_params_t>() - 8usize];
    [
        "Alignment of sd_image_preprocess_params_t",
    ][::std::mem::align_of::<sd_image_preprocess_params_t>() - 8usize];
    [
        "Offset of field: sd_image_preprocess_params_t::rules",
    ][::std::mem::offset_of!(sd_image_preprocess_params_t, rules) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_ref_video_t {
    pub frames: *mut sd_image_t,
    pub frame_count: ::std::os::raw::c_int,
    pub fps: ::std::os::raw::c_int,
    pub audio: sd_audio_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_ref_video_t"][::std::mem::size_of::<sd_ref_video_t>() - 40usize];
    ["Alignment of sd_ref_video_t"][::std::mem::align_of::<sd_ref_video_t>() - 8usize];
    [
        "Offset of field: sd_ref_video_t::frames",
    ][::std::mem::offset_of!(sd_ref_video_t, frames) - 0usize];
    [
        "Offset of field: sd_ref_video_t::frame_count",
    ][::std::mem::offset_of!(sd_ref_video_t, frame_count) - 8usize];
    [
        "Offset of field: sd_ref_video_t::fps",
    ][::std::mem::offset_of!(sd_ref_video_t, fps) - 12usize];
    [
        "Offset of field: sd_ref_video_t::audio",
    ][::std::mem::offset_of!(sd_ref_video_t, audio) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_slg_params_t {
    pub layers: *mut ::std::os::raw::c_int,
    pub layer_count: usize,
    pub layer_start: f32,
    pub layer_end: f32,
    pub scale: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_slg_params_t"][::std::mem::size_of::<sd_slg_params_t>() - 32usize];
    ["Alignment of sd_slg_params_t"][::std::mem::align_of::<sd_slg_params_t>() - 8usize];
    [
        "Offset of field: sd_slg_params_t::layers",
    ][::std::mem::offset_of!(sd_slg_params_t, layers) - 0usize];
    [
        "Offset of field: sd_slg_params_t::layer_count",
    ][::std::mem::offset_of!(sd_slg_params_t, layer_count) - 8usize];
    [
        "Offset of field: sd_slg_params_t::layer_start",
    ][::std::mem::offset_of!(sd_slg_params_t, layer_start) - 16usize];
    [
        "Offset of field: sd_slg_params_t::layer_end",
    ][::std::mem::offset_of!(sd_slg_params_t, layer_end) - 20usize];
    [
        "Offset of field: sd_slg_params_t::scale",
    ][::std::mem::offset_of!(sd_slg_params_t, scale) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_guidance_params_t {
    pub txt_cfg: f32,
    pub img_cfg: f32,
    pub distilled_guidance: f32,
    pub slg: sd_slg_params_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_guidance_params_t",
    ][::std::mem::size_of::<sd_guidance_params_t>() - 48usize];
    [
        "Alignment of sd_guidance_params_t",
    ][::std::mem::align_of::<sd_guidance_params_t>() - 8usize];
    [
        "Offset of field: sd_guidance_params_t::txt_cfg",
    ][::std::mem::offset_of!(sd_guidance_params_t, txt_cfg) - 0usize];
    [
        "Offset of field: sd_guidance_params_t::img_cfg",
    ][::std::mem::offset_of!(sd_guidance_params_t, img_cfg) - 4usize];
    [
        "Offset of field: sd_guidance_params_t::distilled_guidance",
    ][::std::mem::offset_of!(sd_guidance_params_t, distilled_guidance) - 8usize];
    [
        "Offset of field: sd_guidance_params_t::slg",
    ][::std::mem::offset_of!(sd_guidance_params_t, slg) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_sample_params_t {
    pub guidance: sd_guidance_params_t,
    pub scheduler: scheduler_t,
    pub sample_method: sample_method_t,
    pub sample_steps: ::std::os::raw::c_int,
    pub eta: f32,
    pub shifted_timestep: ::std::os::raw::c_int,
    pub custom_sigmas: *mut f32,
    pub custom_sigmas_count: ::std::os::raw::c_int,
    pub flow_shift: f32,
    pub extra_sample_args: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_sample_params_t",
    ][::std::mem::size_of::<sd_sample_params_t>() - 96usize];
    [
        "Alignment of sd_sample_params_t",
    ][::std::mem::align_of::<sd_sample_params_t>() - 8usize];
    [
        "Offset of field: sd_sample_params_t::guidance",
    ][::std::mem::offset_of!(sd_sample_params_t, guidance) - 0usize];
    [
        "Offset of field: sd_sample_params_t::scheduler",
    ][::std::mem::offset_of!(sd_sample_params_t, scheduler) - 48usize];
    [
        "Offset of field: sd_sample_params_t::sample_method",
    ][::std::mem::offset_of!(sd_sample_params_t, sample_method) - 52usize];
    [
        "Offset of field: sd_sample_params_t::sample_steps",
    ][::std::mem::offset_of!(sd_sample_params_t, sample_steps) - 56usize];
    [
        "Offset of field: sd_sample_params_t::eta",
    ][::std::mem::offset_of!(sd_sample_params_t, eta) - 60usize];
    [
        "Offset of field: sd_sample_params_t::shifted_timestep",
    ][::std::mem::offset_of!(sd_sample_params_t, shifted_timestep) - 64usize];
    [
        "Offset of field: sd_sample_params_t::custom_sigmas",
    ][::std::mem::offset_of!(sd_sample_params_t, custom_sigmas) - 72usize];
    [
        "Offset of field: sd_sample_params_t::custom_sigmas_count",
    ][::std::mem::offset_of!(sd_sample_params_t, custom_sigmas_count) - 80usize];
    [
        "Offset of field: sd_sample_params_t::flow_shift",
    ][::std::mem::offset_of!(sd_sample_params_t, flow_shift) - 84usize];
    [
        "Offset of field: sd_sample_params_t::extra_sample_args",
    ][::std::mem::offset_of!(sd_sample_params_t, extra_sample_args) - 88usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_pm_params_t {
    pub id_images: *mut sd_image_t,
    pub id_images_count: ::std::os::raw::c_int,
    pub id_embed_path: *const ::std::os::raw::c_char,
    pub style_strength: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_pm_params_t"][::std::mem::size_of::<sd_pm_params_t>() - 32usize];
    ["Alignment of sd_pm_params_t"][::std::mem::align_of::<sd_pm_params_t>() - 8usize];
    [
        "Offset of field: sd_pm_params_t::id_images",
    ][::std::mem::offset_of!(sd_pm_params_t, id_images) - 0usize];
    [
        "Offset of field: sd_pm_params_t::id_images_count",
    ][::std::mem::offset_of!(sd_pm_params_t, id_images_count) - 8usize];
    [
        "Offset of field: sd_pm_params_t::id_embed_path",
    ][::std::mem::offset_of!(sd_pm_params_t, id_embed_path) - 16usize];
    [
        "Offset of field: sd_pm_params_t::style_strength",
    ][::std::mem::offset_of!(sd_pm_params_t, style_strength) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_pulid_params_t {
    pub id_embedding_path: *const ::std::os::raw::c_char,
    pub id_weight: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_pulid_params_t"][::std::mem::size_of::<sd_pulid_params_t>() - 16usize];
    [
        "Alignment of sd_pulid_params_t",
    ][::std::mem::align_of::<sd_pulid_params_t>() - 8usize];
    [
        "Offset of field: sd_pulid_params_t::id_embedding_path",
    ][::std::mem::offset_of!(sd_pulid_params_t, id_embedding_path) - 0usize];
    [
        "Offset of field: sd_pulid_params_t::id_weight",
    ][::std::mem::offset_of!(sd_pulid_params_t, id_weight) - 8usize];
};
pub const sd_cache_mode_t_SD_CACHE_DISABLED: sd_cache_mode_t = 0;
pub const sd_cache_mode_t_SD_CACHE_EASYCACHE: sd_cache_mode_t = 1;
pub const sd_cache_mode_t_SD_CACHE_UCACHE: sd_cache_mode_t = 2;
pub const sd_cache_mode_t_SD_CACHE_DBCACHE: sd_cache_mode_t = 3;
pub const sd_cache_mode_t_SD_CACHE_TAYLORSEER: sd_cache_mode_t = 4;
pub const sd_cache_mode_t_SD_CACHE_CACHE_DIT: sd_cache_mode_t = 5;
pub const sd_cache_mode_t_SD_CACHE_SPECTRUM: sd_cache_mode_t = 6;
pub type sd_cache_mode_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_cache_params_t {
    pub mode: sd_cache_mode_t,
    pub reuse_threshold: f32,
    pub start_percent: f32,
    pub end_percent: f32,
    pub error_decay_rate: f32,
    pub use_relative_threshold: bool,
    pub reset_error_on_compute: bool,
    pub Fn_compute_blocks: ::std::os::raw::c_int,
    pub Bn_compute_blocks: ::std::os::raw::c_int,
    pub residual_diff_threshold: f32,
    pub max_warmup_steps: ::std::os::raw::c_int,
    pub max_cached_steps: ::std::os::raw::c_int,
    pub max_continuous_cached_steps: ::std::os::raw::c_int,
    pub taylorseer_n_derivatives: ::std::os::raw::c_int,
    pub taylorseer_skip_interval: ::std::os::raw::c_int,
    pub scm_mask: *const ::std::os::raw::c_char,
    pub scm_policy_dynamic: bool,
    pub spectrum_w: f32,
    pub spectrum_m: ::std::os::raw::c_int,
    pub spectrum_lam: f32,
    pub spectrum_window_size: ::std::os::raw::c_int,
    pub spectrum_flex_window: f32,
    pub spectrum_warmup_steps: ::std::os::raw::c_int,
    pub spectrum_stop_percent: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_cache_params_t"][::std::mem::size_of::<sd_cache_params_t>() - 96usize];
    [
        "Alignment of sd_cache_params_t",
    ][::std::mem::align_of::<sd_cache_params_t>() - 8usize];
    [
        "Offset of field: sd_cache_params_t::mode",
    ][::std::mem::offset_of!(sd_cache_params_t, mode) - 0usize];
    [
        "Offset of field: sd_cache_params_t::reuse_threshold",
    ][::std::mem::offset_of!(sd_cache_params_t, reuse_threshold) - 4usize];
    [
        "Offset of field: sd_cache_params_t::start_percent",
    ][::std::mem::offset_of!(sd_cache_params_t, start_percent) - 8usize];
    [
        "Offset of field: sd_cache_params_t::end_percent",
    ][::std::mem::offset_of!(sd_cache_params_t, end_percent) - 12usize];
    [
        "Offset of field: sd_cache_params_t::error_decay_rate",
    ][::std::mem::offset_of!(sd_cache_params_t, error_decay_rate) - 16usize];
    [
        "Offset of field: sd_cache_params_t::use_relative_threshold",
    ][::std::mem::offset_of!(sd_cache_params_t, use_relative_threshold) - 20usize];
    [
        "Offset of field: sd_cache_params_t::reset_error_on_compute",
    ][::std::mem::offset_of!(sd_cache_params_t, reset_error_on_compute) - 21usize];
    [
        "Offset of field: sd_cache_params_t::Fn_compute_blocks",
    ][::std::mem::offset_of!(sd_cache_params_t, Fn_compute_blocks) - 24usize];
    [
        "Offset of field: sd_cache_params_t::Bn_compute_blocks",
    ][::std::mem::offset_of!(sd_cache_params_t, Bn_compute_blocks) - 28usize];
    [
        "Offset of field: sd_cache_params_t::residual_diff_threshold",
    ][::std::mem::offset_of!(sd_cache_params_t, residual_diff_threshold) - 32usize];
    [
        "Offset of field: sd_cache_params_t::max_warmup_steps",
    ][::std::mem::offset_of!(sd_cache_params_t, max_warmup_steps) - 36usize];
    [
        "Offset of field: sd_cache_params_t::max_cached_steps",
    ][::std::mem::offset_of!(sd_cache_params_t, max_cached_steps) - 40usize];
    [
        "Offset of field: sd_cache_params_t::max_continuous_cached_steps",
    ][::std::mem::offset_of!(sd_cache_params_t, max_continuous_cached_steps) - 44usize];
    [
        "Offset of field: sd_cache_params_t::taylorseer_n_derivatives",
    ][::std::mem::offset_of!(sd_cache_params_t, taylorseer_n_derivatives) - 48usize];
    [
        "Offset of field: sd_cache_params_t::taylorseer_skip_interval",
    ][::std::mem::offset_of!(sd_cache_params_t, taylorseer_skip_interval) - 52usize];
    [
        "Offset of field: sd_cache_params_t::scm_mask",
    ][::std::mem::offset_of!(sd_cache_params_t, scm_mask) - 56usize];
    [
        "Offset of field: sd_cache_params_t::scm_policy_dynamic",
    ][::std::mem::offset_of!(sd_cache_params_t, scm_policy_dynamic) - 64usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_w",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_w) - 68usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_m",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_m) - 72usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_lam",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_lam) - 76usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_window_size",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_window_size) - 80usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_flex_window",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_flex_window) - 84usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_warmup_steps",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_warmup_steps) - 88usize];
    [
        "Offset of field: sd_cache_params_t::spectrum_stop_percent",
    ][::std::mem::offset_of!(sd_cache_params_t, spectrum_stop_percent) - 92usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_lora_t {
    pub is_high_noise: bool,
    pub multiplier: f32,
    pub path: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_lora_t"][::std::mem::size_of::<sd_lora_t>() - 16usize];
    ["Alignment of sd_lora_t"][::std::mem::align_of::<sd_lora_t>() - 8usize];
    [
        "Offset of field: sd_lora_t::is_high_noise",
    ][::std::mem::offset_of!(sd_lora_t, is_high_noise) - 0usize];
    [
        "Offset of field: sd_lora_t::multiplier",
    ][::std::mem::offset_of!(sd_lora_t, multiplier) - 4usize];
    [
        "Offset of field: sd_lora_t::path",
    ][::std::mem::offset_of!(sd_lora_t, path) - 8usize];
};
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_NONE: sd_hires_upscaler_t = 0;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT: sd_hires_upscaler_t = 1;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT_NEAREST: sd_hires_upscaler_t = 2;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT_NEAREST_EXACT: sd_hires_upscaler_t = 3;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT_ANTIALIASED: sd_hires_upscaler_t = 4;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT_BICUBIC: sd_hires_upscaler_t = 5;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LATENT_BICUBIC_ANTIALIASED: sd_hires_upscaler_t = 6;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_LANCZOS: sd_hires_upscaler_t = 7;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_NEAREST: sd_hires_upscaler_t = 8;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_MODEL: sd_hires_upscaler_t = 9;
pub const sd_hires_upscaler_t_SD_HIRES_UPSCALER_COUNT: sd_hires_upscaler_t = 10;
pub type sd_hires_upscaler_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_hires_params_t {
    pub enabled: bool,
    pub upscaler: sd_hires_upscaler_t,
    pub model_path: *const ::std::os::raw::c_char,
    pub scale: f32,
    pub target_width: ::std::os::raw::c_int,
    pub target_height: ::std::os::raw::c_int,
    pub steps: ::std::os::raw::c_int,
    pub denoising_strength: f32,
    pub upscale_tile_size: ::std::os::raw::c_int,
    pub custom_sigmas: *mut f32,
    pub custom_sigmas_count: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_hires_params_t"][::std::mem::size_of::<sd_hires_params_t>() - 56usize];
    [
        "Alignment of sd_hires_params_t",
    ][::std::mem::align_of::<sd_hires_params_t>() - 8usize];
    [
        "Offset of field: sd_hires_params_t::enabled",
    ][::std::mem::offset_of!(sd_hires_params_t, enabled) - 0usize];
    [
        "Offset of field: sd_hires_params_t::upscaler",
    ][::std::mem::offset_of!(sd_hires_params_t, upscaler) - 4usize];
    [
        "Offset of field: sd_hires_params_t::model_path",
    ][::std::mem::offset_of!(sd_hires_params_t, model_path) - 8usize];
    [
        "Offset of field: sd_hires_params_t::scale",
    ][::std::mem::offset_of!(sd_hires_params_t, scale) - 16usize];
    [
        "Offset of field: sd_hires_params_t::target_width",
    ][::std::mem::offset_of!(sd_hires_params_t, target_width) - 20usize];
    [
        "Offset of field: sd_hires_params_t::target_height",
    ][::std::mem::offset_of!(sd_hires_params_t, target_height) - 24usize];
    [
        "Offset of field: sd_hires_params_t::steps",
    ][::std::mem::offset_of!(sd_hires_params_t, steps) - 28usize];
    [
        "Offset of field: sd_hires_params_t::denoising_strength",
    ][::std::mem::offset_of!(sd_hires_params_t, denoising_strength) - 32usize];
    [
        "Offset of field: sd_hires_params_t::upscale_tile_size",
    ][::std::mem::offset_of!(sd_hires_params_t, upscale_tile_size) - 36usize];
    [
        "Offset of field: sd_hires_params_t::custom_sigmas",
    ][::std::mem::offset_of!(sd_hires_params_t, custom_sigmas) - 40usize];
    [
        "Offset of field: sd_hires_params_t::custom_sigmas_count",
    ][::std::mem::offset_of!(sd_hires_params_t, custom_sigmas_count) - 48usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_img_gen_params_t {
    pub loras: *const sd_lora_t,
    pub lora_count: u32,
    pub prompt: *const ::std::os::raw::c_char,
    pub negative_prompt: *const ::std::os::raw::c_char,
    pub clip_skip: ::std::os::raw::c_int,
    pub init_image: sd_image_t,
    pub ref_images: *mut sd_image_t,
    pub ref_images_count: ::std::os::raw::c_int,
    pub ref_image_args: *const ::std::os::raw::c_char,
    pub mask_image: sd_image_t,
    pub width: ::std::os::raw::c_int,
    pub height: ::std::os::raw::c_int,
    pub sample_params: sd_sample_params_t,
    pub strength: f32,
    pub seed: i64,
    pub batch_count: ::std::os::raw::c_int,
    pub control_image: sd_image_t,
    pub control_strength: f32,
    pub ip_adapter_image: sd_image_t,
    pub ip_adapter_strength: f32,
    pub pm_params: sd_pm_params_t,
    pub pulid_params: sd_pulid_params_t,
    pub vae_tiling_params: sd_tiling_params_t,
    pub cache: sd_cache_params_t,
    pub hires: sd_hires_params_t,
    pub qwen_image_layers: ::std::os::raw::c_int,
    pub circular_x: bool,
    pub circular_y: bool,
    pub image_preprocess: sd_image_preprocess_params_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_img_gen_params_t",
    ][::std::mem::size_of::<sd_img_gen_params_t>() - 552usize];
    [
        "Alignment of sd_img_gen_params_t",
    ][::std::mem::align_of::<sd_img_gen_params_t>() - 8usize];
    [
        "Offset of field: sd_img_gen_params_t::loras",
    ][::std::mem::offset_of!(sd_img_gen_params_t, loras) - 0usize];
    [
        "Offset of field: sd_img_gen_params_t::lora_count",
    ][::std::mem::offset_of!(sd_img_gen_params_t, lora_count) - 8usize];
    [
        "Offset of field: sd_img_gen_params_t::prompt",
    ][::std::mem::offset_of!(sd_img_gen_params_t, prompt) - 16usize];
    [
        "Offset of field: sd_img_gen_params_t::negative_prompt",
    ][::std::mem::offset_of!(sd_img_gen_params_t, negative_prompt) - 24usize];
    [
        "Offset of field: sd_img_gen_params_t::clip_skip",
    ][::std::mem::offset_of!(sd_img_gen_params_t, clip_skip) - 32usize];
    [
        "Offset of field: sd_img_gen_params_t::init_image",
    ][::std::mem::offset_of!(sd_img_gen_params_t, init_image) - 40usize];
    [
        "Offset of field: sd_img_gen_params_t::ref_images",
    ][::std::mem::offset_of!(sd_img_gen_params_t, ref_images) - 64usize];
    [
        "Offset of field: sd_img_gen_params_t::ref_images_count",
    ][::std::mem::offset_of!(sd_img_gen_params_t, ref_images_count) - 72usize];
    [
        "Offset of field: sd_img_gen_params_t::ref_image_args",
    ][::std::mem::offset_of!(sd_img_gen_params_t, ref_image_args) - 80usize];
    [
        "Offset of field: sd_img_gen_params_t::mask_image",
    ][::std::mem::offset_of!(sd_img_gen_params_t, mask_image) - 88usize];
    [
        "Offset of field: sd_img_gen_params_t::width",
    ][::std::mem::offset_of!(sd_img_gen_params_t, width) - 112usize];
    [
        "Offset of field: sd_img_gen_params_t::height",
    ][::std::mem::offset_of!(sd_img_gen_params_t, height) - 116usize];
    [
        "Offset of field: sd_img_gen_params_t::sample_params",
    ][::std::mem::offset_of!(sd_img_gen_params_t, sample_params) - 120usize];
    [
        "Offset of field: sd_img_gen_params_t::strength",
    ][::std::mem::offset_of!(sd_img_gen_params_t, strength) - 216usize];
    [
        "Offset of field: sd_img_gen_params_t::seed",
    ][::std::mem::offset_of!(sd_img_gen_params_t, seed) - 224usize];
    [
        "Offset of field: sd_img_gen_params_t::batch_count",
    ][::std::mem::offset_of!(sd_img_gen_params_t, batch_count) - 232usize];
    [
        "Offset of field: sd_img_gen_params_t::control_image",
    ][::std::mem::offset_of!(sd_img_gen_params_t, control_image) - 240usize];
    [
        "Offset of field: sd_img_gen_params_t::control_strength",
    ][::std::mem::offset_of!(sd_img_gen_params_t, control_strength) - 264usize];
    [
        "Offset of field: sd_img_gen_params_t::ip_adapter_image",
    ][::std::mem::offset_of!(sd_img_gen_params_t, ip_adapter_image) - 272usize];
    [
        "Offset of field: sd_img_gen_params_t::ip_adapter_strength",
    ][::std::mem::offset_of!(sd_img_gen_params_t, ip_adapter_strength) - 296usize];
    [
        "Offset of field: sd_img_gen_params_t::pm_params",
    ][::std::mem::offset_of!(sd_img_gen_params_t, pm_params) - 304usize];
    [
        "Offset of field: sd_img_gen_params_t::pulid_params",
    ][::std::mem::offset_of!(sd_img_gen_params_t, pulid_params) - 336usize];
    [
        "Offset of field: sd_img_gen_params_t::vae_tiling_params",
    ][::std::mem::offset_of!(sd_img_gen_params_t, vae_tiling_params) - 352usize];
    [
        "Offset of field: sd_img_gen_params_t::cache",
    ][::std::mem::offset_of!(sd_img_gen_params_t, cache) - 384usize];
    [
        "Offset of field: sd_img_gen_params_t::hires",
    ][::std::mem::offset_of!(sd_img_gen_params_t, hires) - 480usize];
    [
        "Offset of field: sd_img_gen_params_t::qwen_image_layers",
    ][::std::mem::offset_of!(sd_img_gen_params_t, qwen_image_layers) - 536usize];
    [
        "Offset of field: sd_img_gen_params_t::circular_x",
    ][::std::mem::offset_of!(sd_img_gen_params_t, circular_x) - 540usize];
    [
        "Offset of field: sd_img_gen_params_t::circular_y",
    ][::std::mem::offset_of!(sd_img_gen_params_t, circular_y) - 541usize];
    [
        "Offset of field: sd_img_gen_params_t::image_preprocess",
    ][::std::mem::offset_of!(sd_img_gen_params_t, image_preprocess) - 544usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_vid_gen_params_t {
    pub loras: *const sd_lora_t,
    pub lora_count: u32,
    pub prompt: *const ::std::os::raw::c_char,
    pub negative_prompt: *const ::std::os::raw::c_char,
    pub clip_skip: ::std::os::raw::c_int,
    pub init_image: sd_image_t,
    pub end_image: sd_image_t,
    pub ref_images: *mut sd_image_t,
    pub ref_images_count: ::std::os::raw::c_int,
    pub ref_videos: *mut sd_ref_video_t,
    pub ref_videos_count: ::std::os::raw::c_int,
    pub ref_audios: *mut sd_audio_t,
    pub ref_audios_count: ::std::os::raw::c_int,
    pub control_frames: *mut sd_image_t,
    pub control_frames_size: ::std::os::raw::c_int,
    pub width: ::std::os::raw::c_int,
    pub height: ::std::os::raw::c_int,
    pub sample_params: sd_sample_params_t,
    pub high_noise_sample_params: sd_sample_params_t,
    pub moe_boundary: f32,
    pub strength: f32,
    pub seed: i64,
    pub video_frames: ::std::os::raw::c_int,
    pub fps: ::std::os::raw::c_int,
    pub vace_strength: f32,
    pub vae_tiling_params: sd_tiling_params_t,
    pub cache: sd_cache_params_t,
    pub hires: sd_hires_params_t,
    pub circular_x: bool,
    pub circular_y: bool,
    pub image_preprocess: sd_image_preprocess_params_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_vid_gen_params_t",
    ][::std::mem::size_of::<sd_vid_gen_params_t>() - 584usize];
    [
        "Alignment of sd_vid_gen_params_t",
    ][::std::mem::align_of::<sd_vid_gen_params_t>() - 8usize];
    [
        "Offset of field: sd_vid_gen_params_t::loras",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, loras) - 0usize];
    [
        "Offset of field: sd_vid_gen_params_t::lora_count",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, lora_count) - 8usize];
    [
        "Offset of field: sd_vid_gen_params_t::prompt",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, prompt) - 16usize];
    [
        "Offset of field: sd_vid_gen_params_t::negative_prompt",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, negative_prompt) - 24usize];
    [
        "Offset of field: sd_vid_gen_params_t::clip_skip",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, clip_skip) - 32usize];
    [
        "Offset of field: sd_vid_gen_params_t::init_image",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, init_image) - 40usize];
    [
        "Offset of field: sd_vid_gen_params_t::end_image",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, end_image) - 64usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_images",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_images) - 88usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_images_count",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_images_count) - 96usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_videos",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_videos) - 104usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_videos_count",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_videos_count) - 112usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_audios",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_audios) - 120usize];
    [
        "Offset of field: sd_vid_gen_params_t::ref_audios_count",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, ref_audios_count) - 128usize];
    [
        "Offset of field: sd_vid_gen_params_t::control_frames",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, control_frames) - 136usize];
    [
        "Offset of field: sd_vid_gen_params_t::control_frames_size",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, control_frames_size) - 144usize];
    [
        "Offset of field: sd_vid_gen_params_t::width",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, width) - 148usize];
    [
        "Offset of field: sd_vid_gen_params_t::height",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, height) - 152usize];
    [
        "Offset of field: sd_vid_gen_params_t::sample_params",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, sample_params) - 160usize];
    [
        "Offset of field: sd_vid_gen_params_t::high_noise_sample_params",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, high_noise_sample_params) - 256usize];
    [
        "Offset of field: sd_vid_gen_params_t::moe_boundary",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, moe_boundary) - 352usize];
    [
        "Offset of field: sd_vid_gen_params_t::strength",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, strength) - 356usize];
    [
        "Offset of field: sd_vid_gen_params_t::seed",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, seed) - 360usize];
    [
        "Offset of field: sd_vid_gen_params_t::video_frames",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, video_frames) - 368usize];
    [
        "Offset of field: sd_vid_gen_params_t::fps",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, fps) - 372usize];
    [
        "Offset of field: sd_vid_gen_params_t::vace_strength",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, vace_strength) - 376usize];
    [
        "Offset of field: sd_vid_gen_params_t::vae_tiling_params",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, vae_tiling_params) - 384usize];
    [
        "Offset of field: sd_vid_gen_params_t::cache",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, cache) - 416usize];
    [
        "Offset of field: sd_vid_gen_params_t::hires",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, hires) - 512usize];
    [
        "Offset of field: sd_vid_gen_params_t::circular_x",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, circular_x) - 568usize];
    [
        "Offset of field: sd_vid_gen_params_t::circular_y",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, circular_y) - 569usize];
    [
        "Offset of field: sd_vid_gen_params_t::image_preprocess",
    ][::std::mem::offset_of!(sd_vid_gen_params_t, image_preprocess) - 576usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct sd_ctx_t {
    _unused: [u8; 0],
}
pub type sd_log_cb_t = ::std::option::Option<
    unsafe extern "C" fn(
        level: sd_log_level_t,
        text: *const ::std::os::raw::c_char,
        data: *mut ::std::os::raw::c_void,
    ),
>;
pub type sd_progress_cb_t = ::std::option::Option<
    unsafe extern "C" fn(
        step: ::std::os::raw::c_int,
        steps: ::std::os::raw::c_int,
        time: f32,
        data: *mut ::std::os::raw::c_void,
    ),
>;
pub type sd_preview_cb_t = ::std::option::Option<
    unsafe extern "C" fn(
        step: ::std::os::raw::c_int,
        frame_count: ::std::os::raw::c_int,
        frames: *mut sd_image_t,
        is_noisy: bool,
        data: *mut ::std::os::raw::c_void,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_preview_info_t {
    pub sample_pass: ::std::os::raw::c_int,
    pub total_steps: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sd_preview_info_t"][::std::mem::size_of::<sd_preview_info_t>() - 8usize];
    [
        "Alignment of sd_preview_info_t",
    ][::std::mem::align_of::<sd_preview_info_t>() - 4usize];
    [
        "Offset of field: sd_preview_info_t::sample_pass",
    ][::std::mem::offset_of!(sd_preview_info_t, sample_pass) - 0usize];
    [
        "Offset of field: sd_preview_info_t::total_steps",
    ][::std::mem::offset_of!(sd_preview_info_t, total_steps) - 4usize];
};
pub type sd_graph_eval_callback_t = ::std::option::Option<
    unsafe extern "C" fn(
        t: *mut ggml_tensor,
        ask: bool,
        user_data: *mut ::std::os::raw::c_void,
    ) -> bool,
>;
unsafe extern "C" {
    pub fn sd_set_log_callback(
        sd_log_cb: sd_log_cb_t,
        data: *mut ::std::os::raw::c_void,
    );
}
unsafe extern "C" {
    pub fn sd_set_progress_callback(
        cb: sd_progress_cb_t,
        data: *mut ::std::os::raw::c_void,
    );
}
unsafe extern "C" {
    pub fn sd_set_preview_callback(
        cb: sd_preview_cb_t,
        mode: preview_t,
        interval: ::std::os::raw::c_int,
        denoised: bool,
        noisy: bool,
        data: *mut ::std::os::raw::c_void,
    );
}
unsafe extern "C" {
    pub fn sd_get_preview_info() -> sd_preview_info_t;
}
unsafe extern "C" {
    pub fn sd_set_backend_eval_callback(
        cb: sd_graph_eval_callback_t,
        data: *mut ::std::os::raw::c_void,
    );
}
unsafe extern "C" {
    pub fn sd_get_num_physical_cores() -> i32;
}
unsafe extern "C" {
    pub fn sd_get_system_info() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn sd_ctx_supports_image_generation(sd_ctx: *const sd_ctx_t) -> bool;
}
unsafe extern "C" {
    pub fn sd_ctx_supports_video_generation(sd_ctx: *const sd_ctx_t) -> bool;
}
unsafe extern "C" {
    pub fn sd_ctx_load_control_net(
        sd_ctx: *mut sd_ctx_t,
        path: *const ::std::os::raw::c_char,
    ) -> bool;
}
unsafe extern "C" {
    pub fn sd_ctx_unload_control_net(sd_ctx: *mut sd_ctx_t) -> bool;
}
unsafe extern "C" {
    pub fn sd_ctx_has_control_net(sd_ctx: *const sd_ctx_t) -> bool;
}
unsafe extern "C" {
    pub fn sd_type_name(type_: sd_type_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_sd_type(str_: *const ::std::os::raw::c_char) -> sd_type_t;
}
unsafe extern "C" {
    pub fn sd_rng_type_name(rng_type: rng_type_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_rng_type(str_: *const ::std::os::raw::c_char) -> rng_type_t;
}
unsafe extern "C" {
    pub fn sd_sample_method_name(
        sample_method: sample_method_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_sample_method(str_: *const ::std::os::raw::c_char) -> sample_method_t;
}
unsafe extern "C" {
    pub fn sd_scheduler_name(scheduler: scheduler_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_scheduler(str_: *const ::std::os::raw::c_char) -> scheduler_t;
}
unsafe extern "C" {
    pub fn sd_prediction_name(prediction: prediction_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_prediction(str_: *const ::std::os::raw::c_char) -> prediction_t;
}
unsafe extern "C" {
    pub fn sd_preview_name(preview: preview_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_preview(str_: *const ::std::os::raw::c_char) -> preview_t;
}
unsafe extern "C" {
    pub fn sd_lora_apply_mode_name(
        mode: lora_apply_mode_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_lora_apply_mode(
        str_: *const ::std::os::raw::c_char,
    ) -> lora_apply_mode_t;
}
unsafe extern "C" {
    pub fn sd_hires_upscaler_name(
        upscaler: sd_hires_upscaler_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn str_to_sd_hires_upscaler(
        str_: *const ::std::os::raw::c_char,
    ) -> sd_hires_upscaler_t;
}
unsafe extern "C" {
    pub fn sd_cache_params_init(cache_params: *mut sd_cache_params_t);
}
unsafe extern "C" {
    pub fn sd_hires_params_init(hires_params: *mut sd_hires_params_t);
}
unsafe extern "C" {
    pub fn sd_ctx_params_init(sd_ctx_params: *mut sd_ctx_params_t);
}
unsafe extern "C" {
    pub fn sd_ctx_params_to_str(
        sd_ctx_params: *const sd_ctx_params_t,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn new_sd_ctx(sd_ctx_params: *const sd_ctx_params_t) -> *mut sd_ctx_t;
}
unsafe extern "C" {
    pub fn free_sd_ctx(sd_ctx: *mut sd_ctx_t);
}
unsafe extern "C" {
    pub fn sd_sample_params_init(sample_params: *mut sd_sample_params_t);
}
unsafe extern "C" {
    pub fn sd_sample_params_to_str(
        sample_params: *const sd_sample_params_t,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn sd_get_model_version_name(
        sd_ctx: *const sd_ctx_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn sd_get_default_sample_method(sd_ctx: *const sd_ctx_t) -> sample_method_t;
}
unsafe extern "C" {
    pub fn sd_get_default_scheduler(
        sd_ctx: *const sd_ctx_t,
        sample_method: sample_method_t,
    ) -> scheduler_t;
}
unsafe extern "C" {
    pub fn sd_img_gen_params_init(sd_img_gen_params: *mut sd_img_gen_params_t);
}
unsafe extern "C" {
    pub fn sd_img_gen_params_to_str(
        sd_img_gen_params: *const sd_img_gen_params_t,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn generate_image(
        sd_ctx: *mut sd_ctx_t,
        sd_img_gen_params: *const sd_img_gen_params_t,
        images_out: *mut *mut sd_image_t,
        num_images_out: *mut ::std::os::raw::c_int,
    ) -> bool;
}
pub const sd_cancel_mode_t_SD_CANCEL_ALL: sd_cancel_mode_t = 0;
pub const sd_cancel_mode_t_SD_CANCEL_NEW_LATENTS: sd_cancel_mode_t = 1;
pub const sd_cancel_mode_t_SD_CANCEL_RESET: sd_cancel_mode_t = 2;
pub type sd_cancel_mode_t = ::std::os::raw::c_uint;
unsafe extern "C" {
    pub fn sd_cancel_generation(sd_ctx: *mut sd_ctx_t, mode: sd_cancel_mode_t);
}
unsafe extern "C" {
    pub fn sd_vid_gen_params_init(sd_vid_gen_params: *mut sd_vid_gen_params_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_adetailer_params_t {
    pub prompt: *const ::std::os::raw::c_char,
    pub negative_prompt: *const ::std::os::raw::c_char,
    pub extra_ad_args: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    [
        "Size of sd_adetailer_params_t",
    ][::std::mem::size_of::<sd_adetailer_params_t>() - 24usize];
    [
        "Alignment of sd_adetailer_params_t",
    ][::std::mem::align_of::<sd_adetailer_params_t>() - 8usize];
    [
        "Offset of field: sd_adetailer_params_t::prompt",
    ][::std::mem::offset_of!(sd_adetailer_params_t, prompt) - 0usize];
    [
        "Offset of field: sd_adetailer_params_t::negative_prompt",
    ][::std::mem::offset_of!(sd_adetailer_params_t, negative_prompt) - 8usize];
    [
        "Offset of field: sd_adetailer_params_t::extra_ad_args",
    ][::std::mem::offset_of!(sd_adetailer_params_t, extra_ad_args) - 16usize];
};
unsafe extern "C" {
    pub fn sd_commit() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn sd_version() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn sd_list_devices(
        buffer: *mut ::std::os::raw::c_char,
        buffer_size: usize,
    ) -> usize;
}
unsafe extern "C" {
    pub fn free_sd_images(
        result_images: *mut sd_image_t,
        num_images: ::std::os::raw::c_int,
    );
}