Skip to main content

ModelConfig

Struct ModelConfig 

Source
pub struct ModelConfig {
Show 29 fields pub transformer: Option<String>, pub transformer_shards: Option<Vec<String>>, pub vae: Option<String>, pub spatial_upscaler: Option<String>, pub temporal_upscaler: Option<String>, pub distilled_lora: Option<String>, pub t5_encoder: Option<String>, pub clip_encoder: Option<String>, pub t5_tokenizer: Option<String>, pub clip_tokenizer: Option<String>, pub clip_encoder_2: Option<String>, pub clip_tokenizer_2: Option<String>, pub text_encoder_files: Option<Vec<String>>, pub text_tokenizer: Option<String>, pub decoder: Option<String>, pub default_steps: Option<u32>, pub default_guidance: Option<f64>, pub default_width: Option<u32>, pub default_height: Option<u32>, pub is_schnell: Option<bool>, pub is_turbo: Option<bool>, pub scheduler: Option<Scheduler>, pub negative_prompt: Option<String>, pub lora: Option<String>, pub lora_scale: Option<f64>, pub default_frames: Option<u32>, pub default_fps: Option<u32>, pub description: Option<String>, pub family: Option<String>,
}
Expand description

Per-model file path + default settings configuration.

Fields§

§transformer: Option<String>§transformer_shards: Option<Vec<String>>

Multi-shard transformer paths (Z-Image BF16); empty means use single transformer

§vae: Option<String>§spatial_upscaler: Option<String>

LTX latent upsampler / spatial upscaler weights.

§temporal_upscaler: Option<String>

Optional temporal upscaler weights for LTX-2/LTX-2.3.

§distilled_lora: Option<String>

Optional distilled LoRA bundled with a model manifest.

§t5_encoder: Option<String>§clip_encoder: Option<String>§t5_tokenizer: Option<String>§clip_tokenizer: Option<String>§clip_encoder_2: Option<String>

CLIP-G / OpenCLIP encoder path (SDXL only)

§clip_tokenizer_2: Option<String>

CLIP-G / OpenCLIP tokenizer path (SDXL only)

§text_encoder_files: Option<Vec<String>>

Generic text encoder shard paths (Qwen3 for Z-Image)

§text_tokenizer: Option<String>

Generic text encoder tokenizer path (Qwen3 for Z-Image)

§decoder: Option<String>

Stage B decoder weights path (Wuerstchen only)

§default_steps: Option<u32>

Default inference steps (e.g. 4 for schnell, 25 for dev)

§default_guidance: Option<f64>

Default guidance scale (0.0 for schnell, 3.5 for dev finetuned)

§default_width: Option<u32>

Default output width

§default_height: Option<u32>

Default output height

§is_schnell: Option<bool>

Whether this model uses the schnell (distilled) timestep schedule. If None, auto-detected from the transformer filename.

§is_turbo: Option<bool>

Whether this model uses a turbo (few-step distilled) schedule. If None, auto-detected from the model name.

§scheduler: Option<Scheduler>

Scheduler algorithm for UNet-based models (SD1.5, SDXL). Ignored by flow-matching models.

§negative_prompt: Option<String>

Per-model default negative prompt for CFG-based models.

§lora: Option<String>

Default LoRA adapter path for this model.

§lora_scale: Option<f64>

Default LoRA scale for this model (0.0-2.0).

§default_frames: Option<u32>

Default number of video frames for video models (e.g. 25 for ltx-video).

§default_fps: Option<u32>

Default video FPS for video models (e.g. 24 for ltx-video).

§description: Option<String>§family: Option<String>

Implementations§

Source§

impl ModelConfig

Source

pub fn all_file_paths(&self) -> Vec<String>

Collect all file path strings from this model config into a flat list. Used for reference counting when determining which files are shared.

Source

pub fn disk_usage(&self) -> (u64, f64)

Total disk usage of all model files: (bytes, gigabytes).

Sums the file sizes of all paths referenced by this config entry. Missing files are silently skipped.

Source

pub fn effective_steps(&self, global_cfg: &Config) -> u32

Effective steps: model default → global fallback → hardcoded default.

Source

pub fn effective_guidance(&self) -> f64

Effective guidance.

Source

pub fn effective_width(&self, global_cfg: &Config) -> u32

Effective width.

Source

pub fn effective_height(&self, global_cfg: &Config) -> u32

Effective height.

Source

pub fn effective_negative_prompt(&self, global_cfg: &Config) -> Option<String>

Effective negative prompt: per-model override → global default → None.

Source

pub fn effective_lora(&self) -> Option<(String, f64)>

Effective LoRA config: per-model default path and scale, or None.

Source

pub fn effective_frames(&self) -> Option<u32>

Effective video frames: per-model default, or None for image-only models.

Source

pub fn effective_fps(&self) -> Option<u32>

Effective video FPS: per-model default, or None for image-only models.

Trait Implementations§

Source§

impl Clone for ModelConfig

Source§

fn clone(&self) -> ModelConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelConfig

Source§

fn default() -> ModelConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ModelConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ModelConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,