mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-08 11:01:35 +00:00
Some boilerplate done.
This commit is contained in:
1 parent
20b95c090e
commit
bcd806e7f0
6 files changed
+21
-3
No files matched your search
@@ -76,6 +76,8 @@ pub async fn do_process_single_job(job_state: &JobState, job: &AvailableDownload
|
||||
return Err(anyhow!("Bad download URL: `{}`", &job.download_url));
|
||||
}
|
||||
|
||||
// TODO USE THIS DOWNLOADER
|
||||
|
||||
let download_filename = match job_state.sidecar_configs.google_drive_downloader.download_file(&job.download_url, &temp_dir).await {
|
||||
Ok(filename) => filename,
|
||||
Err(e) => {
|
||||
|
||||
@@ -17,6 +17,7 @@ use crate::job::job_types::lipsync::process_single_lipsync_job::process_single_l
|
||||
use crate::job::job_types::tts::process_single_tts_job::process_single_tts_job;
|
||||
use crate::job::job_types::vc::process_single_vc_job::process_single_vc_job;
|
||||
use crate::job::job_types::videofilter::process_single_vf_job::process_single_vf_job;
|
||||
use crate::job::job_types::imagegen::process_single_ig_job::process_single_ig_job;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
|
||||
pub async fn process_single_job(
|
||||
@@ -186,6 +187,9 @@ async fn do_process_single_job(
|
||||
InferenceCategory::VideoFilter => {
|
||||
process_single_vf_job(job_dependencies, job).await?
|
||||
}
|
||||
InferenceCategory::ImageGeneration => {
|
||||
process_single_ig_job(job_dependencies, job).await?
|
||||
}
|
||||
};
|
||||
|
||||
let maybe_entity_type = job_success_result.maybe_result_entity
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod lipsync;
|
||||
pub mod tts;
|
||||
pub mod vc;
|
||||
pub(crate) mod videofilter;
|
||||
pub(crate) mod videofilter;
|
||||
pub mod imagegen;
|
||||
+1
-1
@@ -16,7 +16,7 @@ use crate::util::scoped_temp_dir_creator::ScopedTempDirCreator;
|
||||
pub struct ModelFile {
|
||||
pub filesystem_path: PathBuf,
|
||||
}
|
||||
|
||||
// TODO replace this with remote cloud file manager.
|
||||
pub async fn download_model_file(
|
||||
model_record: &Option<RetrievedModelWeight>,
|
||||
public_bucket_client: &BucketClient,
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ use crate::util::scoped_temp_dir_creator::ScopedTempDirCreator;
|
||||
pub struct VideoFile {
|
||||
pub filesystem_path: PathBuf,
|
||||
}
|
||||
|
||||
// TODO replace this with remote cloud file manager.
|
||||
pub async fn download_video_file(
|
||||
video_source: &VideofilterVideoSource,
|
||||
public_bucket_client: &BucketClient,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use enums::by_table::generic_inference_jobs::inference_model_type::InferenceModelType;
|
||||
use errors::AnyhowResult;
|
||||
use sqlx::pool::maybe;
|
||||
|
||||
use crate::job::job_types::lipsync::sad_talker::sad_talker_dependencies::SadTalkerDependencies;
|
||||
use crate::job::job_types::tts::tacotron2_v2_early_fakeyou::tacotron2_dependencies::Tacotron2Dependencies;
|
||||
@@ -8,6 +9,8 @@ use crate::job::job_types::tts::vits::vits_dependencies::VitsDependencies;
|
||||
use crate::job::job_types::vc::rvc_v2::rvc_v2_dependencies::RvcV2Dependencies;
|
||||
use crate::job::job_types::vc::so_vits_svc::svc_dependencies::SvcDependencies;
|
||||
use crate::job::job_types::videofilter::rerender_a_video::rerender_dependencies::RerenderDependencies;
|
||||
use crate::job::job_types::imagegen::sd::stable_diffusion_dependencies::StableDiffusionDependencies;
|
||||
|
||||
use crate::util::scoped_execution::ScopedExecution;
|
||||
|
||||
pub struct JobSpecificDependencies {
|
||||
@@ -18,6 +21,7 @@ pub struct JobSpecificDependencies {
|
||||
pub maybe_vall_e_x_dependencies: Option<VallExDependencies>,
|
||||
pub maybe_vits_dependencies: Option<VitsDependencies>,
|
||||
pub maybe_rerender_dependencies: Option<RerenderDependencies>,
|
||||
pub maybe_stable_diffusion_dependencies: Option<StableDiffusionDependencies>,
|
||||
}
|
||||
|
||||
impl JobSpecificDependencies {
|
||||
@@ -30,6 +34,7 @@ impl JobSpecificDependencies {
|
||||
let mut maybe_vall_e_x_dependencies = None;
|
||||
let mut maybe_vits_dependencies = None;
|
||||
let mut maybe_rerender_dependencies = None;
|
||||
let mut maybe_stable_diffusion_dependencies = None;
|
||||
|
||||
if scoped_execution.can_run_job(InferenceModelType::RvcV2) {
|
||||
print_with_space("Setting RVCv2 dependencies...");
|
||||
@@ -65,6 +70,11 @@ impl JobSpecificDependencies {
|
||||
print_with_space("Setting Rerender dependencies...");
|
||||
maybe_rerender_dependencies = Some(RerenderDependencies::setup()?);
|
||||
}
|
||||
|
||||
if scoped_execution.can_run_job(job_model_type::StableDiffusion) {
|
||||
print_with_space("Setting Stable Diffusion dependencies...");
|
||||
maybe_stable_diffusion_dependencies = Some(StableDiffusionDependencies::setup()?);
|
||||
}
|
||||
|
||||
Ok(JobSpecificDependencies {
|
||||
maybe_rvc_v2_dependencies,
|
||||
@@ -74,6 +84,7 @@ impl JobSpecificDependencies {
|
||||
maybe_vall_e_x_dependencies,
|
||||
maybe_vits_dependencies,
|
||||
maybe_rerender_dependencies,
|
||||
maybe_stable_diffusion_dependencies
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user