diff --git a/crates/service/job/inference_job/config/inference-job.development.env b/crates/service/job/inference_job/config/inference-job.development.env index 3b828e203a..9e1d5e5807 100644 --- a/crates/service/job/inference_job/config/inference-job.development.env +++ b/crates/service/job/inference_job/config/inference-job.development.env @@ -146,12 +146,12 @@ MOCAPNET_INFERENCE_EXECUTABLE_OR_COMMAND="pythonVirtualEnvironment/bin/python -m # ComfyUI # # # # ================================= # -COMFY_INFERENCE_ROOT_DIRECTORY="/home/salt/clone/storyteller-ml/image_generation/ComfyUI" +COMFY_INFERENCE_ROOT_DIRECTORY="/home/salt/clone/storyteller/storyteller-ml/workflows/comfy/ComfyUI/" COMFY_INFERENCE_EXECUTABLE_OR_COMMAND="venv/bin/python ../ComfyLauncher/ComfyRunner.py" -# TODO(bt,2024-02-10): Not sure what these should be -COMFY_MOUNTS_DIRECTORY="NOT_SURE_YET" -COMFY_WORKFLOW_BUCKET_PATH="NOT_SURE_YET" +# directory to where files should be downloaded to (default to just the comfy directory) +COMFY_MOUNTS_DIRECTORY="/home/salt/clone/storyteller/storyteller-ml/workflows/comfy/ComfyUI/" +COMFY_VIDEO_PROCESSING_SCRIPT="/home/salt/clone/storyteller/storyteller-ml/workflows/comfy/format_video.py" # ================================= # # # diff --git a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/comfy_ui_inference_command.rs b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/comfy_ui_inference_command.rs index 707932c08d..f5999aef88 100644 --- a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/comfy_ui_inference_command.rs +++ b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/comfy_ui_inference_command.rs @@ -41,6 +41,9 @@ pub struct ComfyInferenceCommand { // Where to mount the filesystem pub(crate) mounts_directory: PathBuf, + // Video processing script + pub(crate) processing_script: PathBuf, + /// Config file to use config_path: Option, @@ -112,11 +115,15 @@ impl ComfyInferenceCommand { let mounts_directory = easyenv::get_env_pathbuf_required( "COMFY_MOUNTS_DIRECTORY")?; + let processing_script = easyenv::get_env_pathbuf_required( + "COMFY_VIDEO_PROCESSING_SCRIPT")?; + Ok(Self { comfy_root_code_directory, executable_or_command, config_path, mounts_directory, + processing_script, maybe_virtual_env_activation_command, maybe_docker_options, maybe_execution_timeout, diff --git a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/process_job.rs b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/process_job.rs index 37e7683170..2f10c23f6d 100644 --- a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/process_job.rs +++ b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/process_job.rs @@ -1,5 +1,6 @@ use std::fs::{File, read_to_string}; use std::path::{Path, PathBuf}; +use std::process::Command; use std::time::Instant; use anyhow::{anyhow, Result}; @@ -275,6 +276,7 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result = None; + let mut maybe_original_input_path: Option = None; match job_args.maybe_input_file { Some(input_file) => { let input_dir = root_comfy_path.join("input"); @@ -294,7 +296,7 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result) -> Result {} } @@ -383,6 +418,9 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result) -> Result