mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
new video inputs to vst
This commit is contained in:
1 parent
ea1435ad6e
commit
62d4e260a0
4 files changed
+54
-16
No files matched your search
@@ -58,6 +58,24 @@ pub struct WorkflowArgs {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_input_file: Option<MediaFileToken>,
|
||||
|
||||
#[serde(rename = "df")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_input_depth_file: Option<MediaFileToken>,
|
||||
|
||||
#[serde(rename = "nf")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_input_normal_file: Option<MediaFileToken>,
|
||||
|
||||
#[serde(rename = "of")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_input_outline_file: Option<MediaFileToken>,
|
||||
|
||||
// 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<MediaFileToken>,
|
||||
|
||||
#[serde(rename = "out")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_output_path: Option<String>,
|
||||
@@ -127,12 +145,6 @@ pub struct WorkflowArgs {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub travel_prompt: Option<String>,
|
||||
|
||||
// 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<MediaFileToken>,
|
||||
|
||||
#[deprecated(note = "Use `lipsync_enabled` instead")]
|
||||
#[serde(rename = "el")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
||||
+3
@@ -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),
|
||||
|
||||
+30
-10
@@ -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<MediaFileToken>,
|
||||
|
||||
/// Optional: the normal map video file
|
||||
/// The underlying media file must be a video.
|
||||
input_normal_file: Option<MediaFileToken>,
|
||||
|
||||
/// Optional: the outline video file
|
||||
/// The underlying media file must be a video.
|
||||
input_outline_file: Option<MediaFileToken>,
|
||||
|
||||
/// Optional: Global IP-Adapter image.
|
||||
/// The underlying media file must be an image.
|
||||
global_ipa_media_token: Option<MediaFileToken>,
|
||||
|
||||
/// The positive prompt (optional)
|
||||
prompt: Option<String>,
|
||||
|
||||
@@ -120,10 +136,6 @@ pub struct EnqueueVideoStyleTransferRequest {
|
||||
/// Optional visibility setting override.
|
||||
creator_set_visibility: Option<Visibility>,
|
||||
|
||||
/// Optional Global IP-Adapter image.
|
||||
/// The underlying media file must be an image.
|
||||
global_ipa_media_token: Option<MediaFileToken>,
|
||||
|
||||
/// 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<MediaFileToken> {
|
||||
maybe_token
|
||||
.filter(|t| t.as_str().trim_or_empty().is_some())
|
||||
.map(|t| t.clone())
|
||||
}
|
||||
+3
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user