一件成片积分计算补上

This commit is contained in:
Azmat@qq.com
2026-09-04 18:30:43 +08:00
parent 0d042edc73
commit 75b1665f76
2 changed files with 8 additions and 4 deletions
@@ -113,14 +113,16 @@ def estimate_quick_create_points(
resolution: str,
total_duration: int,
):
"""与前端按钮预估同口径:脚本挂牌 + 默认出图×场次 + 视频挂牌秒价×时长(无引用视频)。"""
"""与前端按钮预估同口径:脚本挂牌 + 出图粗估(1商品+每场1角色+1场景) + 视频挂牌秒价×时长(无引用视频)。"""
from decimal import Decimal
from apps.billing.pricing import quote_flat, quote_video_estimate
scene_count = max(1, int(total_duration) // 15)
# 与 _ensure_fallback_entities / _specs_from_entities 下限对齐:商品1 + 角色1×场 + 场景1×场
image_count = 1 + scene_count * 2
script_points = quote_flat(text_model, units=1, team=team).points
image_points = quote_flat(image_model, units=scene_count, team=team).points
image_points = quote_flat(image_model, units=image_count, team=team).points
_tokens, video_quote = quote_video_estimate(
video_model,
aspect_ratio=aspect_ratio,
+4 -2
View File
@@ -597,7 +597,7 @@ export function QuickCreatePage({
{ ratio: aspectRatio, resolution, duration: totalDuration, refs: [] },
billingRates,
);
// 与实扣对齐:脚本(Seed 2.1 Pro 挂牌) + 默认出图挂牌×场次粗估 + 视频挂牌秒价×时长
// 与实扣对齐:脚本挂牌 + 出图粗估(1商品+每场1角色+1场景) + 视频挂牌秒价×时长
const applyTeam = (raw: number) => {
const multiplier = billingRates.multiplier || 1;
if (!(raw > 0)) return 0;
@@ -619,8 +619,10 @@ export function QuickCreatePage({
const listed = pointsPerImageFromCatalog(img);
return listed != null && listed > 0 ? listed : QUICK_IMAGE_POINTS_FALLBACK;
})();
// 脚本未出前粗估:1 张商品图 + 每场至少 1 角色图 + 1 场景图(与 _ensure_fallback_entities 兜底一致)
const estimatedAssetCount = 1 + sceneCount * 2;
const estimatedPoints = videoEstimate.listed
? videoEstimate.points + applyTeam(scriptUnit) + applyTeam(sceneCount * imageUnit)
? videoEstimate.points + applyTeam(scriptUnit) + applyTeam(estimatedAssetCount * imageUnit)
: 0;
const shellClass = [
"quick-create-shell",