diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 47af9a1e9..7bf0b0d5c 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -3171,6 +3171,7 @@ export function CanvasChatPanel({ supportsWatermark?: boolean; supportsSeed?: boolean; creditCostPerImage?: number; + creditCostMultiplierBySize?: Record; creditDiscountRate?: number; creditCostPerVideo?: number; videoDurationOptions?: number[]; @@ -3198,6 +3199,7 @@ export function CanvasChatPanel({ supportsWatermark?: boolean; supportsSeed?: boolean; creditCostPerImage?: number; + creditCostMultiplierBySize?: Record; creditDiscountRate?: number; creditCostPerVideo?: number; videoDurationOptions?: number[]; @@ -8332,7 +8334,10 @@ export function CanvasChatPanel({ const pointsEnabled = membershipSummary?.pointsSystemConfig?.enabled === true; const blockOnInsufficient = membershipSummary?.pointsSystemConfig?.blockOnInsufficient !== false; - const unitCost = getImageCreditCostFromConfig(currentModel?.imageGenConfig); + const unitCost = getImageCreditCostFromConfig( + currentModel?.imageGenConfig, + imageParams?.imageSize + ); if (!pointsEnabled || !blockOnInsufficient || unitCost <= 0) { return true; @@ -8364,6 +8369,7 @@ export function CanvasChatPanel({ activeComposerMode, currentModel?.imageGenConfig, imageParams?.imageCount, + imageParams?.imageSize, isVideoModel, membershipSummary?.isHighVip, membershipSummary?.pointsSystemConfig?.blockOnInsufficient, @@ -8393,7 +8399,10 @@ export function CanvasChatPanel({ : null; } - const unitCost = getImageCreditCostFromConfig(currentModel?.imageGenConfig); + const unitCost = getImageCreditCostFromConfig( + currentModel?.imageGenConfig, + imageParams?.imageSize + ); const imageCount = Math.max( 1, Math.round(Number(imageParams?.imageCount || 1)) @@ -8409,6 +8418,7 @@ export function CanvasChatPanel({ activeComposerMode, currentModel?.imageGenConfig, imageParams?.imageCount, + imageParams?.imageSize, isVideoModel, membershipSummary?.isHighVip, membershipSummary?.pointsSystemConfig?.enabled, diff --git a/components/chat.tsx b/components/chat.tsx index ca4fb9d61..97daf3a5a 100644 --- a/components/chat.tsx +++ b/components/chat.tsx @@ -552,6 +552,8 @@ export function Chat({ supportsWatermark?: boolean; supportsSeed?: boolean; creditCostPerImage?: number; + creditCostMultiplierBySize?: Record; + creditDiscountRate?: number; creditCostPerVideo?: number; videoDurationOptions?: number[]; creditCostPerVideoByDuration?: Record; diff --git a/components/multimodal-input.tsx b/components/multimodal-input.tsx index 96da03d3f..23b629218 100644 --- a/components/multimodal-input.tsx +++ b/components/multimodal-input.tsx @@ -41,6 +41,7 @@ type DynamicModel = { supportsWatermark?: boolean; supportsSeed?: boolean; creditCostPerImage?: number; + creditCostMultiplierBySize?: Record; creditDiscountRate?: number; creditCostPerVideo?: number; videoDurationOptions?: number[]; @@ -220,6 +221,7 @@ function PureMultimodalInput({ supportsWatermark?: boolean; supportsSeed?: boolean; creditCostPerImage?: number; + creditCostMultiplierBySize?: Record; creditDiscountRate?: number; creditCostPerVideo?: number; videoDurationOptions?: number[]; @@ -356,7 +358,10 @@ function PureMultimodalInput({ } if (!isImageModel) return null; - const unitCost = getImageCreditCostFromConfig(imageGenConfig); + const unitCost = getImageCreditCostFromConfig( + imageGenConfig, + imageParams?.imageSize + ); const imageCount = Math.max( 1, Math.round(Number(imageParams?.imageCount || 1)) @@ -371,6 +376,7 @@ function PureMultimodalInput({ }, [ imageGenConfig, imageParams?.imageCount, + imageParams?.imageSize, isImageModel, isVideoModel, membershipSummary?.isHighVip, @@ -450,7 +456,10 @@ function PureMultimodalInput({ const pointsEnabled = membershipSummary?.pointsSystemConfig?.enabled === true; const blockOnInsufficient = membershipSummary?.pointsSystemConfig?.blockOnInsufficient !== false; - const unitCost = getImageCreditCostFromConfig(imageGenConfig); + const unitCost = getImageCreditCostFromConfig( + imageGenConfig, + imageParams?.imageSize + ); if (!pointsEnabled || !blockOnInsufficient || unitCost <= 0) { return true; @@ -481,6 +490,7 @@ function PureMultimodalInput({ }, [ imageGenConfig, imageParams?.imageCount, + imageParams?.imageSize, isImageModel, isVideoModel, membershipSummary?.isHighVip,