Struct stable_diffusion_trainer::trainer::parameters::Parameters
source · pub struct Parameters {
pub prompt: Prompt,
pub dataset: TrainingDataSet,
pub output: Output,
pub network: Network,
pub training: Training,
}Expand description
The parameters structure.
Fields§
§prompt: PromptThe prompt to use for the training process.
dataset: TrainingDataSetThe dataset to use for the training process.
output: OutputThe output to use for the training process.
network: NetworkThe network to use for the training process.
training: TrainingThe training to use for the training process.
Implementations§
source§impl Parameters
impl Parameters
sourcepub fn new(prompt: Prompt, dataset: TrainingDataSet, output: Output) -> Self
pub fn new(prompt: Prompt, dataset: TrainingDataSet, output: Output) -> Self
Create a new parameters structure.
Examples found in repository?
examples/train-lora.rs (line 11)
3 4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let kohya_ss = std::env::var("KOHYA_SS_PATH").expect("KOHYA_SS_PATH not set");
let environment = Environment::new().with_kohya_ss(kohya_ss);
let prompt = Prompt::new("bacana", "white dog");
let image_data_set = ImageDataSet::from_dir("examples/training/lora/bacana/images");
let data_set = TrainingDataSet::new(image_data_set);
let output = Output::new("{prompt.instance}({prompt.class})d{network.dimension}a{network.alpha}", "examples/training/lora/bacana/output");
let parameters = Parameters::new(prompt, data_set, output);
Trainer::new()
.with_environment(environment)
.start(¶meters);
}sourcepub fn with_network(self, network: Network) -> Self
pub fn with_network(self, network: Network) -> Self
Set the network configuration to use for the training process.
sourcepub fn with_training(self, training: Training) -> Self
pub fn with_training(self, training: Training) -> Self
Set the training configuration to use for the training process.
Trait Implementations§
source§impl Debug for Parameters
impl Debug for Parameters
source§impl<'de> Deserialize<'de> for Parameters
impl<'de> Deserialize<'de> for Parameters
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnwindSafe for Parameters
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more