From e06f67231272ed46494ebef47df9187f96d7f33d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 21 Apr 2024 12:34:14 -0400 Subject: [PATCH] change prefix and suffix --- .../workflow/comfy_ui/job_outputs.rs | 1 + .../workflow/comfy_ui/process_job.rs | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/job_outputs.rs b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/job_outputs.rs index 61941b8a59..f97a319946 100644 --- a/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/job_outputs.rs +++ b/crates/service/job/inference_job/src/job/job_types/workflow/comfy_ui/job_outputs.rs @@ -1,5 +1,6 @@ use std::path::PathBuf; +// TODO(bt,2024-04-21): This doesn't need to be a state machine. We can generate the paths we need upfront. pub struct JobOutputsStageOne { /// Filesystem path of the downloaded original video pub original_video_path: PathBuf, 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 ebde4099d9..cc37ddcd00 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 @@ -546,14 +546,15 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result "video", - "image/png" => "image", - "image/jpeg" => "image", - _ => return Err(ProcessSingleJobError::Other(anyhow!("Mimetype not supported: {}", mimetype))), + // Extension is really a "suffix" and should have the leading period to act as an extension. + let ext = if ext.starts_with(".") { + ext.to_string() + } else { + format!(".{ext}") }; + const PREFIX: &str = "storyteller_"; + // determine media type from mime type let media_type = match mimetype.as_str() { "video/mp4" => MediaFileType::Video, @@ -575,8 +576,8 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result) -> Result