use new docker

This commit is contained in:
salt committed 2024-03-05 05:56:29 -08:00
1 parent 44f6226088
commit 0c1f26eec2
3 files changed
+24 -1

No files matched your search

@@ -152,6 +152,7 @@ COMFY_INFERENCE_EXECUTABLE_OR_COMMAND="venv/bin/python ../ComfyLauncher/ComfyRun
# 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"
COMFY_SETUP_SCRIPT="/home/salt/clone/storyteller/storyteller-ml/workflows/comfy/install.py"
# ================================= #
# #
@@ -1,4 +1,5 @@
use std::path::PathBuf;
use std::process::Command;
use errors::AnyhowResult;
use crate::job::job_types::workflow::comfy_ui::comfy_ui_inference_command::ComfyInferenceCommand;
@@ -10,8 +11,23 @@ pub struct ComfyDependencies {
impl ComfyDependencies {
pub fn setup() -> AnyhowResult<Self> {
// run the setup scripts for the comfy dependencies
let inference_command = ComfyInferenceCommand::from_env()?;
// check to see if the flag file exists
if PathBuf::from("comfy_setup_complete").exists() {
println!("Comfy setup already complete");
} else {
// if the flag file does not exist, run the setup script
// run setup script
let comfy_setup_script = inference_command.clone().comfy_setup_script;
let output = Command::new("python3")
.arg(comfy_setup_script)
.output()
.expect("failed to run comfyui setup script");
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
}
Ok(Self {
inference_command: ComfyInferenceCommand::from_env()?,
inference_command: inference_command,
dependency_tokens: RequiredModels::init(),
})
}
@@ -44,6 +44,8 @@ pub struct ComfyInferenceCommand {
// Video processing script
pub(crate) processing_script: PathBuf,
pub(crate) comfy_setup_script: PathBuf,
/// Config file to use
config_path: Option<PathBuf>,
@@ -95,6 +97,9 @@ impl ComfyInferenceCommand {
}
};
let comfy_setup_script = easyenv::get_env_pathbuf_required(
"COMFY_SETUP_SCRIPT")?;
let maybe_virtual_env_activation_command = easyenv::get_env_string_optional(
"COMFY_INFERENCE_MAYBE_VENV_COMMAND");
@@ -124,6 +129,7 @@ impl ComfyInferenceCommand {
config_path,
mounts_directory,
processing_script,
comfy_setup_script,
maybe_virtual_env_activation_command,
maybe_docker_options,
maybe_execution_timeout,