MCPcopy Create free account
hub / github.com/evilsocket/cake / vae_scale_factor

Function vae_scale_factor

cake-core/src/models/sd/sd.rs:690–697  ·  view source on GitHub ↗

Return the VAE scaling factor for a given SD version.

(version: StableDiffusionVersion)

Source from the content-addressed store, hash-verified

688
689/// Return the VAE scaling factor for a given SD version.
690pub(crate) fn vae_scale_factor(version: StableDiffusionVersion) -> f64 {
691 match version {
692 StableDiffusionVersion::V1_5
693 | StableDiffusionVersion::V2_1
694 | StableDiffusionVersion::Xl => 0.18215,
695 StableDiffusionVersion::Turbo => 0.13025,
696 }
697}
698
699fn image_preprocess<T: AsRef<std::path::Path>>(path: T) -> Result<Tensor> {
700 let img = image::ImageReader::open(path)?.decode()?;

Callers 2

generate_imageMethod · 0.85

Calls

no outgoing calls

Tested by 1