fix: show image size adjusted credit cost
This commit is contained in:
parent
b58e0f945e
commit
cad16e70ba
@ -3171,6 +3171,7 @@ export function CanvasChatPanel({
|
||||
supportsWatermark?: boolean;
|
||||
supportsSeed?: boolean;
|
||||
creditCostPerImage?: number;
|
||||
creditCostMultiplierBySize?: Record<string, number>;
|
||||
creditDiscountRate?: number;
|
||||
creditCostPerVideo?: number;
|
||||
videoDurationOptions?: number[];
|
||||
@ -3198,6 +3199,7 @@ export function CanvasChatPanel({
|
||||
supportsWatermark?: boolean;
|
||||
supportsSeed?: boolean;
|
||||
creditCostPerImage?: number;
|
||||
creditCostMultiplierBySize?: Record<string, number>;
|
||||
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,
|
||||
|
||||
@ -552,6 +552,8 @@ export function Chat({
|
||||
supportsWatermark?: boolean;
|
||||
supportsSeed?: boolean;
|
||||
creditCostPerImage?: number;
|
||||
creditCostMultiplierBySize?: Record<string, number>;
|
||||
creditDiscountRate?: number;
|
||||
creditCostPerVideo?: number;
|
||||
videoDurationOptions?: number[];
|
||||
creditCostPerVideoByDuration?: Record<string, number>;
|
||||
|
||||
@ -41,6 +41,7 @@ type DynamicModel = {
|
||||
supportsWatermark?: boolean;
|
||||
supportsSeed?: boolean;
|
||||
creditCostPerImage?: number;
|
||||
creditCostMultiplierBySize?: Record<string, number>;
|
||||
creditDiscountRate?: number;
|
||||
creditCostPerVideo?: number;
|
||||
videoDurationOptions?: number[];
|
||||
@ -220,6 +221,7 @@ function PureMultimodalInput({
|
||||
supportsWatermark?: boolean;
|
||||
supportsSeed?: boolean;
|
||||
creditCostPerImage?: number;
|
||||
creditCostMultiplierBySize?: Record<string, number>;
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user