From e0180712f7f809eac4e85be2faca5e4fef939152 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 22 Jun 2024 19:34:47 -0400 Subject: [PATCH] pass ipa file and strength to comfy --- .../comfy_ui_inference_command.rs | 17 +++++++++++++++++ .../video_style_transfer/process_job.rs | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/comfy_ui_inference_command.rs b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/comfy_ui_inference_command.rs index d1c6f8c719..fec51406ed 100644 --- a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/comfy_ui_inference_command.rs +++ b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/comfy_ui_inference_command.rs @@ -96,6 +96,9 @@ pub struct InferenceArgs<'s> { pub use_cinematic: bool, pub maybe_strength: Option, + + pub global_ipa_image_filename: Option, + pub global_ipa_strength: Option, } #[derive(Debug)] @@ -293,6 +296,20 @@ impl ComfyInferenceCommand { command.push_str(" "); } + if let Some(global_ipa_image_filename) = &args.global_ipa_image_filename { + // NB: This is very dangerous. We're not handling escaping well. + command.push_str(" --global_ipa_image_filename "); + command.push_str(&format!("'{}'", global_ipa_image_filename)); + command.push_str(" "); + } + + if let Some(global_ipa_strength) = &args.global_ipa_strength { + command.push_str(" --global_ipa_strength "); + command.push_str(&format!("{}", global_ipa_strength)); + command.push_str(" "); + } + + if let Some(docker_options) = self.maybe_docker_options.as_ref() { command = docker_options.to_command_string(&command); } diff --git a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/process_job.rs b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/process_job.rs index 0362fdceb6..ba6fdb1eb1 100644 --- a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/process_job.rs +++ b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/video_style_transfer/process_job.rs @@ -322,6 +322,10 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result