mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 08:28:18 +00:00
rename/cleanup
This commit is contained in:
1 parent
4f43b198ad
commit
cf97e4cb32
8 files changed
+36
-36
No files matched your search
+5
-5
@@ -2,7 +2,7 @@ use crate::requests::core_api::fal_request::FalRequest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
pub struct GptImage1EditImageInput {
|
||||
pub struct GptImage1ByokEditImageInput {
|
||||
pub prompt: String,
|
||||
|
||||
pub image_urls: Vec<String>,
|
||||
@@ -21,12 +21,12 @@ pub struct GptImage1EditImageInput {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1EditImageOutput {
|
||||
pub struct GptImage1ByokEditImageOutput {
|
||||
// Response fields parsed elsewhere
|
||||
}
|
||||
|
||||
pub fn gpt_image_1_edit_image(
|
||||
params: GptImage1EditImageInput,
|
||||
) -> FalRequest<GptImage1EditImageInput, GptImage1EditImageOutput> {
|
||||
pub fn gpt_image_1_byok_edit_image(
|
||||
params: GptImage1ByokEditImageInput,
|
||||
) -> FalRequest<GptImage1ByokEditImageInput, GptImage1ByokEditImageOutput> {
|
||||
FalRequest::new("fal-ai/gpt-image-1/edit-image/byok", params)
|
||||
}
|
||||
+7
-7
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||
/// `fal-ai/gpt-image-1/edit-image`. Fal hosts this model directly; pricing is
|
||||
/// billed by Fal at their published rates.
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
pub struct GptImage1NonByokEditImageInput {
|
||||
pub struct GptImage1EditImageInput {
|
||||
pub prompt: String,
|
||||
|
||||
pub image_urls: Vec<String>,
|
||||
@@ -41,17 +41,17 @@ pub struct GptImage1NonByokEditImageInput {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1NonByokEditImageFile {
|
||||
pub struct GptImage1EditImageFile {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1NonByokEditImageOutput {
|
||||
pub images: Vec<GptImage1NonByokEditImageFile>,
|
||||
pub struct GptImage1EditImageOutput {
|
||||
pub images: Vec<GptImage1EditImageFile>,
|
||||
}
|
||||
|
||||
pub fn gpt_image_1_non_byok_edit_image(
|
||||
params: GptImage1NonByokEditImageInput,
|
||||
) -> FalRequest<GptImage1NonByokEditImageInput, GptImage1NonByokEditImageOutput> {
|
||||
pub fn gpt_image_1_edit_image(
|
||||
params: GptImage1EditImageInput,
|
||||
) -> FalRequest<GptImage1EditImageInput, GptImage1EditImageOutput> {
|
||||
FalRequest::new("fal-ai/gpt-image-1/edit-image", params)
|
||||
}
|
||||
+5
-5
@@ -2,7 +2,7 @@ use crate::requests::core_api::fal_request::FalRequest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
pub struct GptImage1TextToImageInput {
|
||||
pub struct GptImage1ByokTextToImageInput {
|
||||
pub prompt: String,
|
||||
|
||||
/// "auto", "1024x1024", "1536x1024", "1024x1536"
|
||||
@@ -19,12 +19,12 @@ pub struct GptImage1TextToImageInput {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1TextToImageOutput {
|
||||
pub struct GptImage1ByokTextToImageOutput {
|
||||
// Response fields parsed elsewhere
|
||||
}
|
||||
|
||||
pub fn gpt_image_1_text_to_image(
|
||||
params: GptImage1TextToImageInput,
|
||||
) -> FalRequest<GptImage1TextToImageInput, GptImage1TextToImageOutput> {
|
||||
pub fn gpt_image_1_byok_text_to_image(
|
||||
params: GptImage1ByokTextToImageInput,
|
||||
) -> FalRequest<GptImage1ByokTextToImageInput, GptImage1ByokTextToImageOutput> {
|
||||
FalRequest::new("fal-ai/gpt-image-1/text-to-image/byok", params)
|
||||
}
|
||||
+7
-7
@@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
|
||||
/// Fal hosts this model directly (no caller-supplied OpenAI API key); pricing
|
||||
/// is billed by Fal at their published rates.
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
pub struct GptImage1NonByokTextToImageInput {
|
||||
pub struct GptImage1TextToImageInput {
|
||||
pub prompt: String,
|
||||
|
||||
/// "auto", "1024x1024", "1536x1024", "1024x1536"
|
||||
@@ -33,17 +33,17 @@ pub struct GptImage1NonByokTextToImageInput {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1NonByokTextToImageFile {
|
||||
pub struct GptImage1TextToImageFile {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GptImage1NonByokTextToImageOutput {
|
||||
pub images: Vec<GptImage1NonByokTextToImageFile>,
|
||||
pub struct GptImage1TextToImageOutput {
|
||||
pub images: Vec<GptImage1TextToImageFile>,
|
||||
}
|
||||
|
||||
pub fn gpt_image_1_non_byok_text_to_image(
|
||||
params: GptImage1NonByokTextToImageInput,
|
||||
) -> FalRequest<GptImage1NonByokTextToImageInput, GptImage1NonByokTextToImageOutput> {
|
||||
pub fn gpt_image_1_text_to_image(
|
||||
params: GptImage1TextToImageInput,
|
||||
) -> FalRequest<GptImage1TextToImageInput, GptImage1TextToImageOutput> {
|
||||
FalRequest::new("fal-ai/gpt-image-1/text-to-image", params)
|
||||
}
|
||||
+3
-3
@@ -8,7 +8,7 @@ use crate::creds::open_ai_api_key::OpenAiApiKey;
|
||||
use crate::error::classify_fal_error::classify_fal_error;
|
||||
use crate::error::fal_error_plus::FalErrorPlus;
|
||||
use crate::requests::traits::fal_request_cost_calculator_trait::{FalRequestCostCalculator, UsdCents};
|
||||
use crate::requests::http::image::edit::http_gpt_image_1_byok_edit_image::{gpt_image_1_edit_image, GptImage1EditImageInput};
|
||||
use crate::requests::http::image::edit::http_gpt_image_1_byok_edit_image::{gpt_image_1_byok_edit_image, GptImage1ByokEditImageInput};
|
||||
use crate::requests::core_api::webhook_response::WebhookResponse;
|
||||
use reqwest::IntoUrl;
|
||||
|
||||
@@ -101,7 +101,7 @@ pub async fn enqueue_gpt_image_1_byok_edit_image_webhook<V: IntoUrl>(
|
||||
GptEditImageNumImages::Four => 4,
|
||||
};
|
||||
|
||||
let request = GptImage1EditImageInput {
|
||||
let request = GptImage1ByokEditImageInput {
|
||||
image_urls: req.image_urls,
|
||||
prompt: req.prompt,
|
||||
image_size: image_size.to_string(),
|
||||
@@ -110,7 +110,7 @@ pub async fn enqueue_gpt_image_1_byok_edit_image_webhook<V: IntoUrl>(
|
||||
openai_api_key: args.openai_api_key.0.to_string(),
|
||||
};
|
||||
|
||||
let result = gpt_image_1_edit_image(request)
|
||||
let result = gpt_image_1_byok_edit_image(request)
|
||||
.with_api_key(&args.api_key.0)
|
||||
.queue_webhook(args.webhook_url)
|
||||
.await;
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ use crate::error::classify_fal_error::classify_fal_error;
|
||||
use crate::error::fal_error_plus::FalErrorPlus;
|
||||
use crate::requests::core_api::webhook_response::WebhookResponse;
|
||||
use crate::requests::http::image::edit::http_gpt_image_1_edit_image::{
|
||||
gpt_image_1_non_byok_edit_image, GptImage1NonByokEditImageInput,
|
||||
gpt_image_1_edit_image, GptImage1EditImageInput,
|
||||
};
|
||||
use crate::requests::traits::fal_request_cost_calculator_trait::{
|
||||
FalRequestCostCalculator, UsdCents,
|
||||
@@ -172,7 +172,7 @@ pub async fn enqueue_gpt_image_1_edit_image_webhook<R: IntoUrl>(
|
||||
.to_string()
|
||||
});
|
||||
|
||||
let request = GptImage1NonByokEditImageInput {
|
||||
let request = GptImage1EditImageInput {
|
||||
prompt: req.prompt,
|
||||
image_urls: req.image_urls,
|
||||
mask_image_url: req.mask_image_url,
|
||||
@@ -184,7 +184,7 @@ pub async fn enqueue_gpt_image_1_edit_image_webhook<R: IntoUrl>(
|
||||
output_format,
|
||||
};
|
||||
|
||||
let result = gpt_image_1_non_byok_edit_image(request)
|
||||
let result = gpt_image_1_edit_image(request)
|
||||
.with_api_key(&args.api_key.0)
|
||||
.queue_webhook(args.webhook_url)
|
||||
.await;
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ use crate::creds::open_ai_api_key::OpenAiApiKey;
|
||||
use crate::error::classify_fal_error::classify_fal_error;
|
||||
use crate::error::fal_error_plus::FalErrorPlus;
|
||||
use crate::requests::traits::fal_request_cost_calculator_trait::{FalRequestCostCalculator, UsdCents};
|
||||
use crate::requests::http::image::text::http_gpt_image_1_byok_text_to_image::{gpt_image_1_text_to_image, GptImage1TextToImageInput};
|
||||
use crate::requests::http::image::text::http_gpt_image_1_byok_text_to_image::{gpt_image_1_byok_text_to_image, GptImage1ByokTextToImageInput};
|
||||
use crate::requests::core_api::webhook_response::WebhookResponse;
|
||||
use reqwest::IntoUrl;
|
||||
|
||||
@@ -106,7 +106,7 @@ pub async fn enqueue_gpt_image_1_byok_text_to_image_webhook<V: IntoUrl>(
|
||||
GptTextToImageNumImages::Four => 4,
|
||||
};
|
||||
|
||||
let request = GptImage1TextToImageInput {
|
||||
let request = GptImage1ByokTextToImageInput {
|
||||
prompt: req.prompt,
|
||||
image_size: image_size.to_string(),
|
||||
num_images,
|
||||
@@ -114,7 +114,7 @@ pub async fn enqueue_gpt_image_1_byok_text_to_image_webhook<V: IntoUrl>(
|
||||
openai_api_key: args.openai_api_key.0.to_string(),
|
||||
};
|
||||
|
||||
let result = gpt_image_1_text_to_image(request)
|
||||
let result = gpt_image_1_byok_text_to_image(request)
|
||||
.with_api_key(&args.api_key.0)
|
||||
.queue_webhook(args.webhook_url)
|
||||
.await;
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ use crate::error::classify_fal_error::classify_fal_error;
|
||||
use crate::error::fal_error_plus::FalErrorPlus;
|
||||
use crate::requests::core_api::webhook_response::WebhookResponse;
|
||||
use crate::requests::http::image::text::http_gpt_image_1_text_to_image::{
|
||||
gpt_image_1_non_byok_text_to_image, GptImage1NonByokTextToImageInput,
|
||||
gpt_image_1_text_to_image, GptImage1TextToImageInput,
|
||||
};
|
||||
use crate::requests::traits::fal_request_cost_calculator_trait::{
|
||||
FalRequestCostCalculator, UsdCents,
|
||||
@@ -154,7 +154,7 @@ pub async fn enqueue_gpt_image_1_text_to_image_webhook<R: IntoUrl>(
|
||||
.to_string()
|
||||
});
|
||||
|
||||
let request = GptImage1NonByokTextToImageInput {
|
||||
let request = GptImage1TextToImageInput {
|
||||
prompt: req.prompt,
|
||||
num_images: Some(num_images),
|
||||
image_size,
|
||||
@@ -163,7 +163,7 @@ pub async fn enqueue_gpt_image_1_text_to_image_webhook<R: IntoUrl>(
|
||||
output_format,
|
||||
};
|
||||
|
||||
let result = gpt_image_1_non_byok_text_to_image(request)
|
||||
let result = gpt_image_1_text_to_image(request)
|
||||
.with_api_key(&args.api_key.0)
|
||||
.queue_webhook(args.webhook_url)
|
||||
.await;
|
||||
|
||||
Reference in new issue
Block a user