From 2972d5407792ca9c852a0eb94ea65c4ac896a87d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 1 Mar 2024 03:14:24 -0500 Subject: [PATCH] debugging errors --- .../workflow/comfy_ui/process_job.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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 233d01b063..7787d5b4e2 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 @@ -296,27 +296,38 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result {} } + // Download Input file if specified let mut maybe_input_path: Option = None; let mut maybe_original_input_path: Option = None; + match job_args.maybe_input_file { - Some(input_file) => { + Some(input_media_file_token) => { let input_dir = root_comfy_path.join("input"); // make if not exist if !input_dir.exists() { - std::fs::create_dir_all(&input_dir).unwrap(); + std::fs::create_dir_all(&input_dir) + .map_err(|err| ProcessSingleJobError::IoError(err))?; } + + info!("Querying input media file by token: {:?}", &input_media_file_token); + let retrieved_input_record = get_media_file( - input_file, + input_media_file_token, false, &deps.db.mysql_pool - ).await?.ok_or_else(|| ProcessSingleJobError::Other(anyhow!("Input file not found")))?; + ).await?.ok_or_else(|| { + error!("input media_file not found: {:?}", &input_media_file_token); + ProcessSingleJobError::Other(anyhow!("input media_file not found: {:?}", input_media_file_token)) + })?; let media_file_bucket_path = MediaFileBucketPath::from_object_hash( &retrieved_input_record.public_bucket_directory_hash, retrieved_input_record.maybe_public_bucket_prefix.as_deref(), retrieved_input_record.maybe_public_bucket_extension.as_deref()); + info!("Input media file cloud bucket path: {:?}", media_file_bucket_path.get_full_object_path_str()); + //let input_filename = format!("input.{}", retrieved_input_record.maybe_public_bucket_extension.unwrap()); let input_filename = "video.mp4".to_string(); let input_path = path_to_string(input_dir.join(input_filename));