feat(platform): 多模态创作 - 新增统一创作页、历史会话与视频参数控制

This commit is contained in:
ddCat
2026-08-02 14:52:49 +08:00
parent 0317ac5bc7
commit 64f32d3607
10 changed files with 3348 additions and 48 deletions

View File

@@ -78,13 +78,14 @@ export function isArkPlanBaseUrl(baseUrl: string) {
export function normalizeSeedanceResolution(value: string, model = "") {
const normalized = normalizeResolutionToken(value);
if (isSeedanceFastModel(model) && normalized === "1080p") return "720p";
return seedanceResolutionOptions.some((item) => item.value === normalized) ? normalized : "720p";
if (isSeedanceFastModel(model) && (normalized === "1080p" || normalized === "2160p")) return "720p";
return normalized === "2160p" || seedanceResolutionOptions.some((item) => item.value === normalized) ? normalized : "720p";
}
export function normalizeResolutionToken(value: string) {
if (value === "low") return "480p";
if (value === "auto" || value === "high" || value === "medium") return "720p";
if (value.toLowerCase() === "4k") return "2160p";
const resolution = String(value || "").replace(/p$/i, "") || "720";
return `${resolution}p`;
}

View File

@@ -1,5 +1,5 @@
export const VIDEO_DURATION_OPTIONS = [6, 9, 10, 15] as const;
export const VIDEO_RESOLUTION_OPTIONS = [480, 720, 1080] as const;
export const VIDEO_RESOLUTION_OPTIONS = [480, 720, 1080, 2160] as const;
export const VIDEO_DURATION_MIN = 1;
export function normalizeVideoDuration(value: string | number | undefined) {
@@ -11,6 +11,7 @@ export function normalizeVideoResolution(value: string | number | undefined) {
const token = String(value || "").trim().toLowerCase();
if (token === "low") return "480";
if (token === "auto" || token === "medium" || token === "high") return "720";
if (token === "4k") return "2160";
const resolution = Number(token.replace(/p$/i, "")) || 720;
return String(nearestOption(resolution, VIDEO_RESOLUTION_OPTIONS));
}