mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
call cost estimate
This commit is contained in:
1 parent
181e5d66f6
commit
7fd7994e95
5 files changed
+9
-3
No files matched your search
+2
-2
@@ -10,7 +10,7 @@ use enums::common::generation_provider::GenerationProvider;
|
||||
pub const ESTIMATE_IMAGE_COST_PATH: &str = "/v1/generate/cost_estimate/image";
|
||||
|
||||
/// Request body for the image cost estimate endpoint.
|
||||
#[derive(Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Serialize, Deserialize, ToSchema, Debug)]
|
||||
pub struct EstimateImageCostRequest {
|
||||
/// The image model to estimate costs for.
|
||||
pub model: CommonImageModel,
|
||||
@@ -38,7 +38,7 @@ pub struct EstimateImageCostRequest {
|
||||
}
|
||||
|
||||
/// Describes the type of image generation being requested.
|
||||
#[derive(Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Serialize, Deserialize, ToSchema, Debug)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum GenerationMode {
|
||||
/// No input images — generate from prompt only.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pub async fn estimate_image_cost_command(
|
||||
request: EstimateImageCostRequest,
|
||||
app_env_configs: State<'_, AppEnvConfigs>,
|
||||
) -> ResponseOrError<EstimateImageCostResponse, EstimateImageCostError> {
|
||||
debug!("estimate_image_cost_command called");
|
||||
info!("estimate_image_cost_command called: {:?}", request);
|
||||
|
||||
let result = estimate_image_cost(
|
||||
&app_env_configs.storyteller_host,
|
||||
|
||||
@@ -9,6 +9,7 @@ export enum CommonImageModel {
|
||||
FluxPro11Ultra = "flux_pro_1p1_ultra",
|
||||
GptImage1 = "gpt_image_1",
|
||||
GptImage1p5 = "gpt_image_1p5",
|
||||
GptImage2 = "gpt_image_2",
|
||||
NanaBanana = "nano_banana",
|
||||
NanaBanana2 = "nano_banana_2",
|
||||
NanaBananaPro = "nano_banana_pro",
|
||||
|
||||
@@ -14,8 +14,12 @@ export function imageModelToCommonImageModel(
|
||||
return CommonImageModel.FluxPro11;
|
||||
case "flux_pro_11_ultra":
|
||||
return CommonImageModel.FluxPro11Ultra;
|
||||
case "gpt_image_1":
|
||||
return CommonImageModel.GptImage1;
|
||||
case "gpt_image_1p5":
|
||||
return CommonImageModel.GptImage1p5;
|
||||
case "gpt_image_2":
|
||||
return CommonImageModel.GptImage2;
|
||||
case "nano_banana":
|
||||
return CommonImageModel.NanaBanana;
|
||||
case "nano_banana_2":
|
||||
|
||||
@@ -277,6 +277,7 @@ export function CostBreakdownModal({ activeTabId }: CostBreakdownModalProps) {
|
||||
"flux_pro_11",
|
||||
"flux_pro_11_ultra",
|
||||
"gpt_image_1p5",
|
||||
"gpt_image_2",
|
||||
"nano_banana",
|
||||
"nano_banana_2",
|
||||
"nano_banana_pro",
|
||||
|
||||
Reference in new issue
Block a user