diff --git a/crates/api_clients/artcraft/artcraft_api_defs/src/omni_gen/models/omni_gen_image_models.rs b/crates/api_clients/artcraft/artcraft_api_defs/src/omni_gen/models/omni_gen_image_models.rs index bf1494575a..82905193db 100644 --- a/crates/api_clients/artcraft/artcraft_api_defs/src/omni_gen/models/omni_gen_image_models.rs +++ b/crates/api_clients/artcraft/artcraft_api_defs/src/omni_gen/models/omni_gen_image_models.rs @@ -84,6 +84,9 @@ pub struct OmniGenImageModelDetails { #[serde(skip_serializing_if = "Option::is_none")] pub aspect_ratio_default: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio_default_when_editing: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub resolution_options: Option>, @@ -107,3 +110,12 @@ pub struct OmniGenImageModelDetails { #[serde(skip_serializing_if = "Option::is_none")] pub batch_size_default: Option, } + +impl Default for OmniGenImageModelDetails { + fn default() -> Self { + Self { + model: CommonImageModel::NanaBananaPro, + ..Default::default() + } + } +} diff --git a/crates/service/web/storyteller_web/src/configs/mod.rs b/crates/service/web/storyteller_web/src/configs/mod.rs index fe47f3fc29..3a45a30336 100644 --- a/crates/service/web/storyteller_web/src/configs/mod.rs +++ b/crates/service/web/storyteller_web/src/configs/mod.rs @@ -6,4 +6,5 @@ pub mod static_api_tokens; pub mod static_model; pub mod stripe_artcraft_metadata_keys; pub mod supported_languages_for_models; -pub mod artcraft_products; \ No newline at end of file +pub mod artcraft_products; +mod omni_gen; \ No newline at end of file diff --git a/crates/service/web/storyteller_web/src/configs/omni_gen/image_models.rs b/crates/service/web/storyteller_web/src/configs/omni_gen/image_models.rs new file mode 100644 index 0000000000..78b3913489 --- /dev/null +++ b/crates/service/web/storyteller_web/src/configs/omni_gen/image_models.rs @@ -0,0 +1,168 @@ +use artcraft_api_defs::omni_gen::models::omni_gen_image_models::{OmniGenImageModelDetails, OmniGenImageProviderModels}; +use enums::common::generation::common_aspect_ratio::CommonAspectRatio; +use enums::common::generation::common_image_model::CommonImageModel; +use enums::common::generation_provider::GenerationProvider; +use once_cell::sync::Lazy; +use enums::common::generation::common_resolution::CommonResolution; + +pub const IMAGE_MODELS: Lazy> = Lazy::new(|| { + let mut models = Vec::new(); + + models.push(OmniGenImageProviderModels { + provider: GenerationProvider::Artcraft, + models: vec![ + OmniGenImageModelDetails { + model: CommonImageModel::Flux1Dev, + full_name: None, + text_prompt_supported: Some(true), + aspect_ratio_options: Some(vec![ + CommonAspectRatio::SquareHd, + CommonAspectRatio::Square, + CommonAspectRatio::TallThreeByFour, + CommonAspectRatio::TallNineBySixteen, + CommonAspectRatio::WideFourByThree, + CommonAspectRatio::WideSixteenByNine, + ]), + aspect_ratio_default: Some(CommonAspectRatio::Square), + batch_size_min: Some(1), + batch_size_max: Some(4), + batch_size_default: Some(4), + ..Default::default() + }, + ], + }); + + models.push(OmniGenImageProviderModels { + provider: GenerationProvider::Artcraft, + models: vec![ + OmniGenImageModelDetails { + model: CommonImageModel::Flux1Schnell, + full_name: None, + text_prompt_supported: Some(true), + aspect_ratio_options: Some(vec![ + CommonAspectRatio::SquareHd, + CommonAspectRatio::Square, + CommonAspectRatio::TallThreeByFour, + CommonAspectRatio::TallNineBySixteen, + CommonAspectRatio::WideFourByThree, + CommonAspectRatio::WideSixteenByNine, + ]), + aspect_ratio_default: Some(CommonAspectRatio::Square), + batch_size_min: Some(1), + batch_size_max: Some(4), + batch_size_default: Some(4), + ..Default::default() + }, + ], + }); + + // ... + + models.push(OmniGenImageProviderModels { + provider: GenerationProvider::Artcraft, + models: vec![ + OmniGenImageModelDetails { + model: CommonImageModel::NanaBanana, // NB: currently Gemini25Flash in our system + full_name: None, + text_prompt_supported: Some(true), + image_refs_supported: Some(true), + aspect_ratio_options: Some(vec![ + CommonAspectRatio::Auto, + CommonAspectRatio::WideTwentyOneByNine, + CommonAspectRatio::WideSixteenByNine, + CommonAspectRatio::WideThreeByTwo, + CommonAspectRatio::WideFourByThree, + CommonAspectRatio::WideFiveByFour, + CommonAspectRatio::Square, + CommonAspectRatio::TallFourByFive, + CommonAspectRatio::TallThreeByFour, + CommonAspectRatio::TallTwoByThree, + CommonAspectRatio::TallNineBySixteen, + ]), + aspect_ratio_default: Some(CommonAspectRatio::Square), + aspect_ratio_default_when_editing: Some(CommonAspectRatio::Auto), + batch_size_min: Some(1), + batch_size_max: Some(4), + batch_size_default: Some(4), + ..Default::default() + }, + ], + }); + + models.push(OmniGenImageProviderModels { + provider: GenerationProvider::Artcraft, + models: vec![ + OmniGenImageModelDetails { + model: CommonImageModel::NanaBanana2, + full_name: None, + text_prompt_supported: Some(true), + image_refs_supported: Some(true), + aspect_ratio_options: Some(vec![ + CommonAspectRatio::Auto, + CommonAspectRatio::WideTwentyOneByNine, + CommonAspectRatio::WideSixteenByNine, + CommonAspectRatio::WideThreeByTwo, + CommonAspectRatio::WideFourByThree, + CommonAspectRatio::WideFiveByFour, + CommonAspectRatio::Square, + CommonAspectRatio::TallFourByFive, + CommonAspectRatio::TallThreeByFour, + CommonAspectRatio::TallTwoByThree, + CommonAspectRatio::TallNineBySixteen, + ]), + aspect_ratio_default: Some(CommonAspectRatio::Square), + aspect_ratio_default_when_editing: Some(CommonAspectRatio::Auto), + resolution_options: Some(vec![ + CommonResolution::HalfK, + CommonResolution::OneK, + CommonResolution::TwoK, + CommonResolution::FourK, + ]), + resolution_default: Some(CommonResolution::OneK), + batch_size_min: Some(1), + batch_size_max: Some(4), + batch_size_default: Some(4), + ..Default::default() + }, + ], + }); + + models.push(OmniGenImageProviderModels { + provider: GenerationProvider::Artcraft, + models: vec![ + OmniGenImageModelDetails { + model: CommonImageModel::NanaBananaPro, + full_name: None, + text_prompt_supported: Some(true), + image_refs_supported: Some(true), + aspect_ratio_options: Some(vec![ + CommonAspectRatio::Auto, + CommonAspectRatio::WideTwentyOneByNine, + CommonAspectRatio::WideSixteenByNine, + CommonAspectRatio::WideThreeByTwo, + CommonAspectRatio::WideFourByThree, + CommonAspectRatio::WideFiveByFour, + CommonAspectRatio::Square, + CommonAspectRatio::TallFourByFive, + CommonAspectRatio::TallThreeByFour, + CommonAspectRatio::TallTwoByThree, + CommonAspectRatio::TallNineBySixteen, + ]), + aspect_ratio_default: Some(CommonAspectRatio::Square), + aspect_ratio_default_when_editing: Some(CommonAspectRatio::Auto), + resolution_options: Some(vec![ + CommonResolution::OneK, + CommonResolution::TwoK, + CommonResolution::FourK, + ]), + resolution_default: Some(CommonResolution::OneK), + batch_size_min: Some(1), + batch_size_max: Some(4), + batch_size_default: Some(4), + ..Default::default() + }, + ], + }); + + models +}); diff --git a/crates/service/web/storyteller_web/src/configs/omni_gen/mod.rs b/crates/service/web/storyteller_web/src/configs/omni_gen/mod.rs new file mode 100644 index 0000000000..989ea32910 --- /dev/null +++ b/crates/service/web/storyteller_web/src/configs/omni_gen/mod.rs @@ -0,0 +1 @@ +mod image_models; \ No newline at end of file