diff --git a/crates/lib/mysql_queries/src/payloads/generic_inference_args/workflow_payload.rs b/crates/lib/mysql_queries/src/payloads/generic_inference_args/workflow_payload.rs index c5a746bc6f..d168c7b8ad 100644 --- a/crates/lib/mysql_queries/src/payloads/generic_inference_args/workflow_payload.rs +++ b/crates/lib/mysql_queries/src/payloads/generic_inference_args/workflow_payload.rs @@ -58,6 +58,24 @@ pub struct WorkflowArgs { #[serde(skip_serializing_if = "Option::is_none")] pub maybe_input_file: Option, + #[serde(rename = "df")] + #[serde(skip_serializing_if = "Option::is_none")] + pub maybe_input_depth_file: Option, + + #[serde(rename = "nf")] + #[serde(skip_serializing_if = "Option::is_none")] + pub maybe_input_normal_file: Option, + + #[serde(rename = "of")] + #[serde(skip_serializing_if = "Option::is_none")] + pub maybe_input_outline_file: Option, + + // Optional global IP Adapter image media file token + // This will apply to the entire workflow / video + #[serde(rename = "gi")] + #[serde(skip_serializing_if = "Option::is_none")] + pub global_ip_adapter_token: Option, + #[serde(rename = "out")] #[serde(skip_serializing_if = "Option::is_none")] pub maybe_output_path: Option, @@ -127,12 +145,6 @@ pub struct WorkflowArgs { #[serde(skip_serializing_if = "Option::is_none")] pub travel_prompt: Option, - // Optional global IP Adapter image media file token - // This will apply to the entire workflow / video - #[serde(rename = "gi")] - #[serde(skip_serializing_if = "Option::is_none")] - pub global_ip_adapter_token: Option, - #[deprecated(note = "Use `lipsync_enabled` instead")] #[serde(rename = "el")] #[serde(skip_serializing_if = "Option::is_none")] diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_comfy_ui_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_comfy_ui_handler.rs index ce4f2bc463..52334e6230 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_comfy_ui_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_comfy_ui_handler.rs @@ -259,6 +259,9 @@ pub async fn enqueue_comfy_ui_handler( maybe_json_modifications: request.maybe_json_modifications.clone(), maybe_workflow_config: request.maybe_workflow_config.clone(), maybe_input_file: request.maybe_input_file.clone(), + maybe_input_depth_file: None, + maybe_input_normal_file: None, + maybe_input_outline_file: None, maybe_output_path: request.maybe_output_path.clone(), creator_visibility:Some(set_visibility), trim_start_seconds: Some(trim_start_seconds), diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_video_style_transfer_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_video_style_transfer_handler.rs index f4c959a2fe..1634133582 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_video_style_transfer_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_video_style_transfer_handler.rs @@ -72,6 +72,22 @@ pub struct EnqueueVideoStyleTransferRequest { /// The input video media file (required) input_file: MediaFileToken, + /// Optional: the depth video file + /// The underlying media file must be a video. + input_depth_file: Option, + + /// Optional: the normal map video file + /// The underlying media file must be a video. + input_normal_file: Option, + + /// Optional: the outline video file + /// The underlying media file must be a video. + input_outline_file: Option, + + /// Optional: Global IP-Adapter image. + /// The underlying media file must be an image. + global_ipa_media_token: Option, + /// The positive prompt (optional) prompt: Option, @@ -120,10 +136,6 @@ pub struct EnqueueVideoStyleTransferRequest { /// Optional visibility setting override. creator_set_visibility: Option, - /// Optional Global IP-Adapter image. - /// The underlying media file must be an image. - global_ipa_media_token: Option, - /// To use prompt traveling, enqueue a prompt with this. /// /// An example of a prompt travel section: @@ -393,17 +405,18 @@ pub async fn enqueue_video_style_transfer_handler( negative_prompt: request.negative_prompt.new_string_trim_or_empty(), travel_prompt: coordinated_args.travel_prompt.new_string_trim_or_empty(), - // Other inputs + // Input files maybe_input_file: Some(request.input_file.clone()), + maybe_input_depth_file: empty_token_to_null(request.input_depth_file.as_ref()), + maybe_input_normal_file: empty_token_to_null(request.input_normal_file.as_ref()), + maybe_input_outline_file: empty_token_to_null(request.input_outline_file.as_ref()), + global_ip_adapter_token: empty_token_to_null(request.global_ipa_media_token.as_ref()), + + // Other inputs style_name: Some(request.style), creator_visibility: Some(set_visibility), trim_start_milliseconds: Some(trim_start_millis), trim_end_milliseconds: Some(trim_end_millis), - global_ip_adapter_token: request.global_ipa_media_token - .as_ref() - // NB: Frontend is mistakenly sending empty string - ignore it - .filter(|t| t.as_str().trim_or_empty().is_some()) - .map(|t| t.clone()), strength: maybe_strength, frame_skip: request.frame_skip, @@ -486,3 +499,10 @@ pub async fn enqueue_video_style_transfer_handler( .content_type("application/json") .body(body)) } + +// NB: Frontend is mistakenly sending empty string tokens - ignore those +fn empty_token_to_null(maybe_token: Option<&MediaFileToken>) -> Option { + maybe_token + .filter(|t| t.as_str().trim_or_empty().is_some()) + .map(|t| t.clone()) +} diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_workflow_upload_request.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_workflow_upload_request.rs index a285ff7e88..56201b7255 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_workflow_upload_request.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/workflows/enqueue_workflow_upload_request.rs @@ -237,6 +237,9 @@ pub async fn enqueue_workflow_upload_request( maybe_json_modifications: None, maybe_workflow_config: None, maybe_input_file: None, + maybe_input_depth_file: None, + maybe_input_normal_file: None, + maybe_input_outline_file: None, maybe_output_path: None, trim_start_seconds: None, trim_end_seconds: None,