mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
rename field
This commit is contained in:
1 parent
314e195039
commit
b11e365dec
3 files changed
+10
-10
No files matched your search
+2
-2
@@ -21,12 +21,12 @@ pub struct Seedance1p5ProMultiFunctionVideoGenRequest {
|
||||
/// Source of the starting frame.
|
||||
/// If present, we're doing image-to-video.
|
||||
/// If absent, we're doing text-to-video.
|
||||
pub image_media_token: Option<MediaFileToken>,
|
||||
pub start_frame_image_media_token: Option<MediaFileToken>,
|
||||
|
||||
/// Optional.
|
||||
/// Only for image-to-video.
|
||||
/// Source of the ending frame.
|
||||
pub end_image_media_token: Option<MediaFileToken>,
|
||||
pub end_frame_image_media_token: Option<MediaFileToken>,
|
||||
|
||||
/// Optional.
|
||||
pub resolution: Option<Seedance1p5ProMultiFunctionVideoGenResolution>,
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ pub async fn execute_artcraft_seedance1p5_pro(
|
||||
let request = Seedance1p5ProMultiFunctionVideoGenRequest {
|
||||
uuid_idempotency_token: plan.idempotency_token.clone(),
|
||||
prompt: plan.prompt.map(|p| p.to_string()),
|
||||
image_media_token: plan.start_frame.map(|t| t.to_owned()),
|
||||
end_image_media_token: plan.end_frame.map(|t| t.to_owned()),
|
||||
start_frame_image_media_token: plan.start_frame.map(|t| t.to_owned()),
|
||||
end_frame_image_media_token: plan.end_frame.map(|t| t.to_owned()),
|
||||
aspect_ratio: plan.aspect_ratio,
|
||||
duration: plan.duration,
|
||||
resolution: plan.resolution,
|
||||
|
||||
+6
-6
@@ -153,11 +153,11 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler(
|
||||
// Collect media tokens to look up
|
||||
let mut query_media_tokens = Vec::new();
|
||||
|
||||
if let Some(start_frame_token) = request.image_media_token.as_ref() {
|
||||
if let Some(start_frame_token) = request.start_frame_image_media_token.as_ref() {
|
||||
query_media_tokens.push(start_frame_token.to_owned());
|
||||
}
|
||||
|
||||
if let Some(end_frame_token) = request.end_image_media_token.as_ref() {
|
||||
if let Some(end_frame_token) = request.end_frame_image_media_token.as_ref() {
|
||||
query_media_tokens.push(end_frame_token.to_owned());
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler(
|
||||
).await?
|
||||
};
|
||||
|
||||
let maybe_image_url = match request.image_media_token.as_ref() {
|
||||
let maybe_image_url = match request.start_frame_image_media_token.as_ref() {
|
||||
None => None,
|
||||
Some(token) => match image_urls_by_token.get(token) {
|
||||
Some(url) => Some(url.to_string()),
|
||||
@@ -183,7 +183,7 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler(
|
||||
}
|
||||
};
|
||||
|
||||
let maybe_end_image_url = match request.end_image_media_token.as_ref() {
|
||||
let maybe_end_image_url = match request.end_frame_image_media_token.as_ref() {
|
||||
None => None,
|
||||
Some(token) => match image_urls_by_token.get(token) {
|
||||
Some(url) => Some(url.to_string()),
|
||||
@@ -323,14 +323,14 @@ pub async fn seedance_1p5_pro_multi_function_video_gen_handler(
|
||||
if let Some(token) = prompt_token.as_ref() {
|
||||
let mut context_items = Vec::with_capacity(2);
|
||||
|
||||
if let Some(media_token) = &request.image_media_token {
|
||||
if let Some(media_token) = &request.start_frame_image_media_token {
|
||||
context_items.push(PromptContextItem {
|
||||
media_token: media_token.clone(),
|
||||
context_semantic_type: PromptContextSemanticType::VidStartFrame,
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(media_token) = &request.end_image_media_token {
|
||||
if let Some(media_token) = &request.end_frame_image_media_token {
|
||||
context_items.push(PromptContextItem {
|
||||
media_token: media_token.clone(),
|
||||
context_semantic_type: PromptContextSemanticType::VidEndFrame,
|
||||
|
||||
Reference in new issue
Block a user