#[repr(C)]
pub struct FILE {
_private: [u8; 0],
}
#[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,
);
}