From 3bb0e7d2ebd59d3f9e5d47acb6d95c7aabdaa88c Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 2 Dec 2025 17:56:03 -0500 Subject: [PATCH] bytedance seedream v4 fal.rs --- .../src/endpoints/fal_ai/bytedance/mod.rs | 16 +++++- .../bytedance_seedream_v4_edit_image.rs | 52 +++++++++++++++++++ .../bytedance_seedream_v4_text_to_image.rs | 50 ++++++++++++++++++ .../fal_ai/bytedance/seedream/mod.rs | 2 + 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_edit_image.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_text_to_image.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/mod.rs diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/mod.rs index 48e1746b4e..074e0f5e54 100644 --- a/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/mod.rs +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/mod.rs @@ -25,4 +25,18 @@ pub mod seedance; feature = "endpoints_fal-ai_bytedance" ))) )] -pub mod seededit; \ No newline at end of file +pub mod seededit; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bytedance" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bytedance" + ))) +)] +pub mod seedream; \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_edit_image.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_edit_image.rs new file mode 100644 index 0000000000..b4ec161493 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_edit_image.rs @@ -0,0 +1,52 @@ +use crate::prelude::{Deserialize, FalRequest, Serialize}; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BytedanceSeedreamV4EditImageInput { + pub prompt: String, + + pub image_urls: Vec, + + /// Supports a custom height/width (which we didn't implement) OR an enum value - + /// square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto, auto_2K, auto_4K + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + + /// Number of generations + /// 1 - 4 + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + + /// 1 - 4 + /// If set to a number greater than one, enables multi-image generation. + /// The model will potentially return up to max_images images every generation, + /// and in total, num_images generations will be carried out. In total, the number + /// of images generated will be between num_images and max_images*num_images. + /// Default value: 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_images: Option, + + /// Possible enum values: standard, fast (default "standard") + #[serde(skip_serializing_if = "Option::is_none")] + pub enhance_prompt_mode: Option, + + /// Defaults to true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BytedanceSeedreamV4EditImageOutput { + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageFile { + /// The URL where the file can be downloaded from. + pub url: String, +} + +pub fn bytedance_seedream_v4_edit_image( + params: BytedanceSeedreamV4EditImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/bytedance/seedream/v4/edit", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_text_to_image.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_text_to_image.rs new file mode 100644 index 0000000000..2287e7d947 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/bytedance_seedream_v4_text_to_image.rs @@ -0,0 +1,50 @@ +use crate::prelude::{Deserialize, FalRequest, Serialize}; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BytedanceSeedreamV4TextToImageInput { + pub prompt: String, + + /// Supports a custom height/width (which we didn't implement) OR an enum value - + /// square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto, auto_2K, auto_4K + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + + /// Number of generations + /// 1 - 4 + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + + /// 1 - 4 + /// If set to a number greater than one, enables multi-image generation. + /// The model will potentially return up to max_images images every generation, + /// and in total, num_images generations will be carried out. In total, the number + /// of images generated will be between num_images and max_images*num_images. + /// Default value: 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_images: Option, + + /// Possible enum values: standard, fast (default "standard") + #[serde(skip_serializing_if = "Option::is_none")] + pub enhance_prompt_mode: Option, + + /// Defaults to true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BytedanceSeedreamV4TextToImageOutput { + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageFile { + /// The URL where the file can be downloaded from. + pub url: String, +} + +pub fn bytedance_seedream_v4_text_to_image( + params: BytedanceSeedreamV4TextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/bytedance/seedream/v4/text-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/mod.rs new file mode 100644 index 0000000000..ebe408522d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bytedance/seedream/mod.rs @@ -0,0 +1,2 @@ +pub mod bytedance_seedream_v4_edit_image; +pub mod bytedance_seedream_v4_text_to_image; \ No newline at end of file