mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 02:21:23 +00:00
model configs for image
This commit is contained in:
1 parent
1024e4029f
commit
e1ad7a3a9c
4 files changed
+183
-1
No files matched your search
+12
@@ -84,6 +84,9 @@ pub struct OmniGenImageModelDetails {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub aspect_ratio_default: Option<CommonAspectRatio>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub aspect_ratio_default_when_editing: Option<CommonAspectRatio>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub resolution_options: Option<Vec<CommonResolution>>,
|
||||
|
||||
@@ -107,3 +110,12 @@ pub struct OmniGenImageModelDetails {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub batch_size_default: Option<u16>,
|
||||
}
|
||||
|
||||
impl Default for OmniGenImageModelDetails {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
model: CommonImageModel::NanaBananaPro,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
pub mod artcraft_products;
|
||||
mod omni_gen;
|
||||
@@ -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<Vec<OmniGenImageProviderModels>> = 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
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
mod image_models;
|
||||
Reference in new issue
Block a user