diff --git a/crates/api_clients/artcraft/artcraft_router/src/api/common_resolution.rs b/crates/api_clients/artcraft/artcraft_router/src/api/common_resolution.rs index 69d89c7cc9..6a77bbcd60 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/api/common_resolution.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/api/common_resolution.rs @@ -5,7 +5,7 @@ use serde_derive::{Deserialize, Serialize}; /// In the case a model doesn't support the resolution, gracefully pick the nearest option. #[derive(Copy, Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] -pub enum CommonVideoResolution { +pub enum CommonResolution { /// Models: Nano Banana Pro OneK, /// Models: Nano Banana Pro diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/cost/artcraft/estimate_image_cost_artcraft_nano_banana_pro.rs b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/cost/artcraft/estimate_image_cost_artcraft_nano_banana_pro.rs index c6d1791f0e..dbcb07a7b0 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/cost/artcraft/estimate_image_cost_artcraft_nano_banana_pro.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/cost/artcraft/estimate_image_cost_artcraft_nano_banana_pro.rs @@ -37,12 +37,12 @@ pub(crate) fn estimate_image_cost_artcraft_nano_banana_pro( #[cfg(test)] mod tests { use crate::api::common_image_model::CommonImageModel; - use crate::api::common_resolution::CommonVideoResolution; + use crate::api::common_resolution::CommonResolution; use crate::api::provider::Provider; use crate::client::request_mismatch_mitigation_strategy::RequestMismatchMitigationStrategy; use crate::generate::generate_image::generate_image_request::GenerateImageRequest; - fn estimate_usd_cents(resolution: Option, image_batch_count: u16) -> u64 { + fn estimate_usd_cents(resolution: Option, image_batch_count: u16) -> u64 { let request = GenerateImageRequest { model: CommonImageModel::NanaBananaPro, provider: Provider::Artcraft, @@ -65,15 +65,15 @@ mod tests { fn test_estimate_cost_usd_cents() { // 1K/2K: $0.15/image = 15 cents assert_eq!(estimate_usd_cents(None, 1), 15); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::OneK), 1), 15); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::TwoK), 1), 15); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::OneK), 2), 30); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::OneK), 3), 45); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::OneK), 4), 60); + assert_eq!(estimate_usd_cents(Some(CommonResolution::OneK), 1), 15); + assert_eq!(estimate_usd_cents(Some(CommonResolution::TwoK), 1), 15); + assert_eq!(estimate_usd_cents(Some(CommonResolution::OneK), 2), 30); + assert_eq!(estimate_usd_cents(Some(CommonResolution::OneK), 3), 45); + assert_eq!(estimate_usd_cents(Some(CommonResolution::OneK), 4), 60); // 4K: $0.30/image = 30 cents - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::FourK), 1), 30); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::FourK), 2), 60); - assert_eq!(estimate_usd_cents(Some(CommonVideoResolution::FourK), 4), 120); + assert_eq!(estimate_usd_cents(Some(CommonResolution::FourK), 1), 30); + assert_eq!(estimate_usd_cents(Some(CommonResolution::FourK), 2), 60); + assert_eq!(estimate_usd_cents(Some(CommonResolution::FourK), 4), 120); } } diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/execute/artcraft/generate_image_artcraft_nano_banana_pro.rs b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/execute/artcraft/generate_image_artcraft_nano_banana_pro.rs index a92cd32f62..660068b475 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/execute/artcraft/generate_image_artcraft_nano_banana_pro.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/execute/artcraft/generate_image_artcraft_nano_banana_pro.rs @@ -35,7 +35,7 @@ pub async fn execute_artcraft_nano_banana_pro( #[cfg(test)] mod tests { use crate::api::common_aspect_ratio::CommonAspectRatio; - use crate::api::common_resolution::CommonVideoResolution; + use crate::api::common_resolution::CommonResolution; use crate::api::image_list_ref::ImageListRef; use crate::generate::generate_image::generate_image_request::GenerateImageRequest; use crate::generate::generate_image::image_generation_plan::ImageGenerationPlan; @@ -48,7 +48,7 @@ mod tests { let client = get_artcraft_client(); let request = GenerateImageRequest { aspect_ratio: Some(CommonAspectRatio::WideSixteenByNine), - resolution: Some(CommonVideoResolution::OneK), + resolution: Some(CommonResolution::OneK), image_batch_count: Some(1), prompt: Some("a cat walking through a cyberpunk city at night"), ..base_image_request() @@ -70,7 +70,7 @@ mod tests { let client = get_artcraft_client(); let request = GenerateImageRequest { aspect_ratio: Some(CommonAspectRatio::Square), - resolution: Some(CommonVideoResolution::OneK), + resolution: Some(CommonResolution::OneK), image_batch_count: Some(4), prompt: Some("a dog surfing a wave, cinematic"), ..base_image_request() @@ -101,7 +101,7 @@ mod tests { prompt: Some("Add the man in the first image into the fantasy scene in the second image. Keep his hoodie and attire, but match the vibe of the fantasy scene."), image_inputs: Some(ImageListRef::MediaFileTokens(&image_tokens)), aspect_ratio: Some(CommonAspectRatio::Auto), // edit mode: preserve source dimensions - resolution: Some(CommonVideoResolution::OneK), + resolution: Some(CommonResolution::OneK), image_batch_count: Some(1), ..base_image_request() }; diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/generate_image_request.rs b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/generate_image_request.rs index 5eb341ba18..3b29afe0ba 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/generate_image_request.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/generate_image_request.rs @@ -1,6 +1,6 @@ use crate::api::common_aspect_ratio::CommonAspectRatio; use crate::api::common_image_model::CommonImageModel; -use crate::api::common_resolution::CommonVideoResolution; +use crate::api::common_resolution::CommonResolution; use crate::api::image_list_ref::ImageListRef; use crate::api::provider::Provider; use crate::client::request_mismatch_mitigation_strategy::RequestMismatchMitigationStrategy; @@ -24,7 +24,7 @@ pub struct GenerateImageRequest<'a> { pub image_inputs: Option>, /// The resolution to use. - pub resolution: Option, + pub resolution: Option, /// The aspect ratio to use. pub aspect_ratio: Option, diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/plan/artcraft/plan_generate_image_artcraft_nano_banana_pro.rs b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/plan/artcraft/plan_generate_image_artcraft_nano_banana_pro.rs index b0133cdbdf..b8356108a5 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/plan/artcraft/plan_generate_image_artcraft_nano_banana_pro.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_image/plan/artcraft/plan_generate_image_artcraft_nano_banana_pro.rs @@ -1,5 +1,5 @@ use crate::api::common_aspect_ratio::CommonAspectRatio; -use crate::api::common_resolution::CommonVideoResolution; +use crate::api::common_resolution::CommonResolution; use crate::api::image_list_ref::ImageListRef; use crate::client::request_mismatch_mitigation_strategy::RequestMismatchMitigationStrategy; use crate::errors::artcraft_router_error::ArtcraftRouterError; @@ -120,10 +120,10 @@ fn nearest_aspect_ratio(aspect_ratio: CommonAspectRatio) -> NanoBananaProMultiFu } fn plan_resolution( - resolution: Option, + resolution: Option, _strategy: RequestMismatchMitigationStrategy, ) -> Result, ArtcraftRouterError> { - use CommonVideoResolution as R; + use CommonResolution as R; use NanoBananaProMultiFunctionImageGenImageResolution as NbpRes; match resolution { None => Ok(None), @@ -168,7 +168,7 @@ fn plan_num_images( mod tests { use super::*; use crate::api::common_aspect_ratio::CommonAspectRatio; - use crate::api::common_resolution::CommonVideoResolution; + use crate::api::common_resolution::CommonResolution; use crate::api::image_list_ref::ImageListRef; use crate::errors::artcraft_router_error::ArtcraftRouterError; use crate::errors::client_error::ClientError; @@ -318,9 +318,9 @@ mod tests { #[test] fn resolution_direct_mappings() { let cases = [ - (CommonVideoResolution::OneK, NbpRes::OneK), - (CommonVideoResolution::TwoK, NbpRes::TwoK), - (CommonVideoResolution::FourK, NbpRes::FourK), + (CommonResolution::OneK, NbpRes::OneK), + (CommonResolution::TwoK, NbpRes::TwoK), + (CommonResolution::FourK, NbpRes::FourK), ]; for (common, expected) in cases { let request = GenerateImageRequest { resolution: Some(common), ..base_image_request() }; @@ -335,7 +335,7 @@ mod tests { #[test] fn resolution_three_k_falls_back_to_two_k() { let request = GenerateImageRequest { - resolution: Some(CommonVideoResolution::ThreeK), + resolution: Some(CommonResolution::ThreeK), ..base_image_request() }; let ImageGenerationPlan::ArtcraftNanaBananaPro(plan) = request.build().unwrap(); diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/generate_video_request.rs b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/generate_video_request.rs index 73233156c3..d4eb3f1a69 100644 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/generate_video_request.rs +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/generate_video_request.rs @@ -1,5 +1,5 @@ use crate::api::common_aspect_ratio::CommonAspectRatio; -use crate::api::common_resolution::CommonVideoResolution; +use crate::api::common_resolution::CommonResolution; use crate::api::common_video_model::CommonVideoModel; use crate::api::image_list_ref::ImageListRef; use crate::api::image_ref::ImageRef; @@ -32,7 +32,7 @@ pub struct GenerateVideoRequest<'a> { pub reference_images: Option>, /// The resolution to use - pub resolution: Option, + pub resolution: Option, /// The aspect ratio to use pub aspect_ratio: Option, diff --git a/crates/schema/public/enums/src/common/generation/common_video_resolution.rs b/crates/schema/public/enums/src/common/generation/common_video_resolution.rs index a41fa6b6b4..c2d71cc461 100644 --- a/crates/schema/public/enums/src/common/generation/common_video_resolution.rs +++ b/crates/schema/public/enums/src/common/generation/common_video_resolution.rs @@ -1,7 +1,7 @@ use utoipa::ToSchema; /// Common video resolutions. -/// Mirrors artcraft_router::api::common_resolution::CommonVideoResolution. +/// Mirrors artcraft_router::api::common_resolution::CommonResolution. #[derive(Copy, Clone, Debug, Serialize, Deserialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum CommonVideoResolution { diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/cost_estimate/video/estimate_video_cost_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/cost_estimate/video/estimate_video_cost_handler.rs index 0dd9d7c8a8..ae89f32918 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/cost_estimate/video/estimate_video_cost_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/cost_estimate/video/estimate_video_cost_handler.rs @@ -8,7 +8,7 @@ use artcraft_api_defs::generate::cost_estimate::estimate_video_cost::{ EstimateVideoCostResponse, }; use artcraft_router::api::common_aspect_ratio::CommonAspectRatio as RouterAspectRatio; -use artcraft_router::api::common_resolution::CommonVideoResolution as RouterResolution; +use artcraft_router::api::common_resolution::CommonResolution as RouterResolution; use artcraft_router::api::common_video_model::CommonVideoModel as RouterVideoModel; use artcraft_router::api::provider::Provider as RouterProvider; use artcraft_router::client::request_mismatch_mitigation_strategy::RequestMismatchMitigationStrategy;