Compare commits

...
Author SHA1 Message Date
Michael Chung ba8e273847 Merge branch 'master' into feature/weights_upload_v2
# Conflicts:
#	crates/service/job/inference_job/src/job/job_types/mod.rs
#	crates/service/web/storyteller_web/src/http_server/endpoints/media_files/upload/drain_multipart_request.rs
#	crates/service/web/storyteller_web/src/http_server/endpoints/weights/mod.rs
#	crates/service/web/storyteller_web/src/http_server/endpoints/weights/upload_weight.rs
#	crates/service/web/storyteller_web/src/routes.rs
2023-12-21 21:12:42 -05:00
Michael Chung 0b4e3a6640 Add template test files. 2023-12-11 21:53:25 -05:00
Michael Chung a33ed7c897 compilation 2023-12-11 19:29:37 -05:00
Michael Chung e190721ece Ok inital commit for server side need to run inference on the specific model once downloaded
to verify that the model is compatible with our infrastructure.
2023-12-11 15:11:28 -05:00
11 changed files with 29 additions and 1 deletions
@@ -64,6 +64,11 @@ pub enum GenericDownloadType {
#[serde(rename = "vits")]
#[sqlx(rename = "vits")]
Vits,
// SD models
#[serde(rename = "sd_15")]
#[sqlx(rename = "sd_15")]
StableDiffusion15,
}
/// NB: Legacy API for older code.
@@ -78,6 +83,7 @@ impl GenericDownloadType {
Self::SoVitsSvc => "so_vits_svc",
Self::Tacotron2 => "tacotron2",
Self::Vits => "vits",
Self::StableDiffusion15 => "sd_15"
}
}
@@ -91,6 +97,7 @@ impl GenericDownloadType {
"so_vits_svc" => Ok(Self::SoVitsSvc),
"tacotron2" => Ok(Self::Tacotron2),
"vits" => Ok(Self::Vits),
"sd_15" => Ok(Self::StableDiffusion15),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -107,6 +114,7 @@ impl GenericDownloadType {
Self::SoVitsSvc,
Self::Tacotron2,
Self::Vits,
Self::StableDiffusion15,
])
}
}
@@ -126,6 +134,7 @@ mod tests {
assert_serialization(GenericDownloadType::SoVitsSvc, "so_vits_svc");
assert_serialization(GenericDownloadType::Tacotron2, "tacotron2");
assert_serialization(GenericDownloadType::Vits, "vits");
assert_serialization(GenericDownloadType::StableDiffusion15, "sd_15");
}
#[test]
@@ -138,6 +147,7 @@ mod tests {
assert_eq!(GenericDownloadType::SoVitsSvc.to_str(), "so_vits_svc");
assert_eq!(GenericDownloadType::Tacotron2.to_str(), "tacotron2");
assert_eq!(GenericDownloadType::Vits.to_str(), "vits");
assert_eq!(GenericDownloadType::StableDiffusion15.to_str(), "sd_15");
}
#[test]
@@ -150,13 +160,14 @@ mod tests {
assert_eq!(GenericDownloadType::from_str("so_vits_svc").unwrap(), GenericDownloadType::SoVitsSvc);
assert_eq!(GenericDownloadType::from_str("tacotron2").unwrap(), GenericDownloadType::Tacotron2);
assert_eq!(GenericDownloadType::from_str("vits").unwrap(), GenericDownloadType::Vits);
assert_eq!(GenericDownloadType::from_str("sd_15").unwrap(), GenericDownloadType::StableDiffusion15);
}
#[test]
fn all_variants() {
// Static check
let mut variants = GenericDownloadType::all_variants();
assert_eq!(variants.len(), 8);
assert_eq!(variants.len(), 9);
assert_eq!(variants.pop_first(), Some(GenericDownloadType::HifiGan));
assert_eq!(variants.pop_first(), Some(GenericDownloadType::HifiGanRocketVc));
assert_eq!(variants.pop_first(), Some(GenericDownloadType::HifiGanSoVitsSvc));
@@ -165,6 +176,7 @@ mod tests {
assert_eq!(variants.pop_first(), Some(GenericDownloadType::SoVitsSvc));
assert_eq!(variants.pop_first(), Some(GenericDownloadType::Tacotron2));
assert_eq!(variants.pop_first(), Some(GenericDownloadType::Vits));
assert_eq!(variants.pop_first(), Some(GenericDownloadType::StableDiffusion15));
assert_eq!(variants.pop_first(), None);
// Generated check
@@ -112,6 +112,17 @@ pub async fn dispatch_job_to_handler<'a, 'b: 'a>(args: DispatchJobToHandlerArgs<
).await?;
entity_token = results.entity_token.clone();
entity_type = results.entity_type.clone();
},
GenericDownloadType::StableDiffusion15 => {
let results = process_vits_model(
args.job_runner_state,
args.job,
args.temp_dir,
args.download_filename,
args.redis_logger,
).await?;
entity_token = results.entity_token.clone();
entity_type = results.entity_type.clone();
}
}
@@ -0,0 +1,5 @@
pub mod model_downloaders;
pub mod pretrained_sd15_model;
pub mod process_job;
pub mod sd15_dependencies;
pub mod sd15_inference_command;