🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"
TypeScript
feat(video): 移植 Wan 3.0 与工作台视频生成优化(对齐 feature-wan)
Connor28a40449d1c6
diff --git a/README.md b/README.mdindex 59e5400..989a874 100644--- a/README.md+++ b/README.md@@ -88,7 +88,7 @@ data/ — 生成资源文件与 SQLite 数据库|---|---|| **文本** | OpenAI(兼容接口)、Gemini || **图片** | OpenAI、Gemini、火山引擎 |-| **视频** | 火山引擎 Seedance 2.0(标准 / Fast / Mini) |+| **视频** | 火山引擎 Seedance 2.0(标准 / Fast / Mini)、MiniMax H3、阿里云百炼 Wan 3.0 (Prime / 标准) |---diff --git a/backend/.env.example b/backend/.env.exampleindex c82e64f..bf9e764 100644--- a/backend/.env.example+++ b/backend/.env.example@@ -8,8 +8,8 @@ PORT=5679# STORAGE_PATH=/path/to/data/static# Optional. Public base URL of this backend. Required when passing locally-# uploaded reference videos/audios to the Seedance API (local /static paths-# are resolved as PUBLIC_BASE_URL + path).+# uploaded reference videos/audios/files to an upstream video API (local+# /static paths are resolved as PUBLIC_BASE_URL + path).# PUBLIC_BASE_URL=https://your-domain.com# Optional. 关闭文本模型思考(thinking)模式,默认 true。diff --git a/backend/src/db/schema.ts b/backend/src/db/schema.tsindex 0b95517..9549ff3 100644--- a/backend/src/db/schema.ts+++ b/backend/src/db/schema.ts@@ -210,7 +210,7 @@ export const sysTask = sqliteTable('sys_task', {prompt: text('prompt'),model: text('model'),// image: {size, frameType, referenceImages[]}- // video: {referenceMode, referenceImageUrls[], referenceVideoUrls[], referenceAudioUrls[], generateAudio, duration, aspectRatio}+ // video: {referenceMode, firstFrameUrl, lastFrameUrl, referenceImageUrls[], referenceVideoUrls[], referenceAudioUrls[], referenceFileUrl, referenceLinkUrl, generateAudio, duration, aspectRatio, resolution, seed, promptExtend, watermark}params: text('params'),taskId: text('task_id'),resultUrl: text('result_url'),diff --git a/backend/src/routes/aiConfigs.ts b/backend/src/routes/aiConfigs.tsindex de87594..1a0d8ed 100644--- a/backend/src/routes/aiConfigs.ts+++ b/backend/src/routes/aiConfigs.ts@@ -94,6 +94,19 @@ function buildProbe(serviceType: string, provider: string, baseUrl: string, mode}}+ if (p === 'aliyun') {+ // Wan 3.0 仅支持异步提交;空请求体不会创建计费任务,仅用于验证地域端点与鉴权是否可达。+ return {+ method: 'POST',+ url: joinProviderUrl(baseUrl, '/api/v1', '/services/aigc/video-generation/video-synthesis'),+ headers: {+ ...bearerHeaders(apiKey, true),+ 'X-DashScope-Async': 'enable',+ },+ body: {},+ }+ }+return {method: 'GET',url: joinProviderUrl(baseUrl, '', m ? `/${m}` : '/'),diff --git a/backend/src/routes/episodes.ts b/backend/src/routes/episodes.tsindex d055279..567c8ab 100644--- a/backend/src/routes/episodes.ts+++ b/backend/src/routes/episodes.ts@@ -33,8 +33,8 @@ app.post('/', async (c) => {title: body.title || `第${nextNum}集`,imageConfigId,videoConfigId,- // 视频分辨率在创建集时固定(480p/720p),后续可通过 PUT 修改- resolution: body.resolution === '480p' ? '480p' : '720p',+ // 视频分辨率在创建集时固定(480p/720p/1080p),后续可通过 PUT 修改;各视频适配器再映射为厂商档位+ resolution: ['480p', '720p', '1080p'].includes(body.resolution) ? body.resolution : '720p',createdAt: ts,updatedAt: ts,})@@ -62,8 +62,8 @@ app.put('/:id', async (c) => {if (key in body) updates[key] = body[key]}if (Object.keys(updates).length === 0) return badRequest(c, 'no valid fields')- if ('resolution' in updates && !['480p', '720p'].includes(updates.resolution)) {- return badRequest(c, 'resolution 只支持 480p / 720p')+ if ('resolution' in updates && !['480p', '720p', '1080p'].includes(updates.resolution)) {+ return badRequest(c, 'resolution 只支持 480p / 720p / 1080p')}// Map snake_case to camelCase for drizzlediff --git a/backend/src/routes/tasks.ts b/backend/src/routes/tasks.tsindex e0f93a6..5de4369 100644--- a/backend/src/routes/tasks.ts+++ b/backend/src/routes/tasks.ts@@ -3,12 +3,107 @@ import { eq } from 'drizzle-orm'import { db, schema } from '../db/index.js'import { success, created, badRequest } from '../utils/response.js'import { generateImage, generateVideo } from '../services/generation.js'+import { getActiveConfig, getConfigById } from '../services/ai.js'import { logTaskError, logTaskPayload, logTaskStart, logTaskSuccess } from '../utils/task-logger.js'const app = new Hono()type TaskType = 'image' | 'video'+const WAN_MEDIA_TYPES = new Set([+ 'first_frame',+ 'last_frame',+ 'reference_image',+ 'reference_video',+ 'reference_audio',+ 'file',+ 'link',+])++/**+ * 兼容项目原有扁平入参,也支持 Wan 3.0 官方 model/input/parameters 结构。+ */+function normalizeVideoRequest(body: any) {+ const input = body.input && typeof body.input === 'object' && !Array.isArray(body.input) ? body.input : {}+ const parameters = body.parameters && typeof body.parameters === 'object' && !Array.isArray(body.parameters)+ ? body.parameters+ : {}+ const media = Array.isArray(input.media) ? input.media : []++ const mediaUrls = (type: string) => media+ .filter((item: any) => item?.type === type)+ .map((item: any) => item?.url)++ return {+ ...body,+ prompt: body.prompt ?? input.prompt ?? '',+ reference_image_urls: body.reference_image_urls ?? mediaUrls('reference_image'),+ reference_video_urls: body.reference_video_urls ?? mediaUrls('reference_video'),+ reference_audio_urls: body.reference_audio_urls ?? mediaUrls('reference_audio'),+ first_frame_url: body.first_frame_url ?? mediaUrls('first_frame')[0],+ last_frame_url: body.last_frame_url ?? mediaUrls('last_frame')[0],+ file_url: body.file_url ?? mediaUrls('file')[0],+ link_url: body.link_url ?? mediaUrls('link')[0],+ generate_audio: body.generate_audio ?? parameters.audio,+ duration: body.duration ?? parameters.duration,+ aspect_ratio: body.aspect_ratio ?? parameters.ratio,+ resolution: body.resolution ?? parameters.resolution,+ seed: body.seed ?? parameters.seed,+ prompt_extend: body.prompt_extend ?? parameters.prompt_extend,+ watermark: body.watermark ?? parameters.watermark,+ official_media: media,+ }+}++function validateVideoRequest(body: any, provider?: string): string | null {+ for (const key of ['reference_image_urls', 'reference_video_urls', 'reference_audio_urls']) {+ if (body[key] !== undefined && !Array.isArray(body[key])) return `${key} 必须为数组`+ if (Array.isArray(body[key]) && body[key].some((url: any) => typeof url !== 'string' || !url.trim())) {+ return `${key} 中的每个 URL 都必须为非空字符串`+ }+ }++ if (body.official_media.length) {+ for (const item of body.official_media) {+ if (!item || typeof item !== 'object' || !WAN_MEDIA_TYPES.has(item.type) || typeof item.url !== 'string' || !item.url.trim()) {+ return 'input.media 中的每项都必须包含官方支持的 type 和非空 url'+ }+ }+ for (const type of ['first_frame', 'last_frame', 'file', 'link']) {+ if (body.official_media.filter((item: any) => item.type === type).length > 1) {+ return `Wan 3.0 input.media 中 ${type} 最多 1 项`+ }+ }+ }++ const imgs = body.reference_image_urls.length+ const vids = body.reference_video_urls.length+ const auds = body.reference_audio_urls.length+ const first = Boolean(body.first_frame_url)+ const last = Boolean(body.last_frame_url)+ const file = Boolean(body.file_url)+ const link = Boolean(body.link_url)++ if ((provider || '').toLowerCase() === 'aliyun') {+ if (imgs > 10 || vids > 5 || auds > 5) return 'Wan 3.0 参考素材超限:图片≤10、视频≤5、音频≤5'+ if (last && !first) return 'Wan 3.0 尾帧必须与首帧同时传入'+ if (file && link) return 'Wan 3.0 file 与 link 不能同时传入'+ if ((first || last) && (imgs + vids + auds > 0 || file || link)) {+ return 'Wan 3.0 的 first_frame/last_frame 不能与 reference_image/reference_video/reference_audio/file/link 混用'+ }+ const total = imgs + vids + auds + Number(first) + Number(last) + Number(file) + Number(link)+ if (total > 20) return 'Wan 3.0 input.media 最多 20 项'+ } else {+ if (imgs > 9 || vids > 3 || auds > 3) return '参考素材超限:图片≤9、视频≤3、音频≤3'+ if (auds > 0 && imgs + vids === 0) return '参考音频需要至少 1 个参考图片或视频'+ }++ if (!String(body.prompt || '').trim() && imgs + vids + auds === 0 && !first && !last && !file && !link) {+ return '视频生成需要至少一个参考素材或 prompt'+ }+ return null+}+// POST /tasks — 发起生成任务(body.type: image | video)app.post('/', async (c) => {const body = await c.req.json()@@ -17,24 +112,13 @@ app.post('/', async (c) => {if (type === 'image') {if (!body.prompt) return badRequest(c, 'prompt is required')- } else {- // 视频生成只保留多模态参考:校验素材上限与必填项- const imgs = body.reference_image_urls?.length || 0- const vids = body.reference_video_urls?.length || 0- const auds = body.reference_audio_urls?.length || 0- if (imgs > 9 || vids > 3 || auds > 3) {- return badRequest(c, '参考素材超限:图片≤9、视频≤3、音频≤3')- }- if (auds > 0 && imgs + vids === 0) {- return badRequest(c, '参考音频需要至少 1 个参考图片或视频')- }- if (imgs + vids + auds === 0 && !body.prompt) {- return badRequest(c, '多模态参考模式需要至少一个参考素材或 prompt')- }}+ const videoBody = type === 'video' ? normalizeVideoRequest(body) : null+try {- // 集锁定的生成配置优先于请求指定;视频分辨率同样锁定到集+ // 请求显式指定 config_id(工作台模型下拉跨厂商切换)时优先;+ // 未指定才回退到集锁定配置,避免锁定配置与所选模型错配(如锁定 Seedance 却传 MiniMax 模型名)let configId: number | undefined = body.config_idlet episodeResolution: string | undefinedif (body.storyboard_id) {@@ -42,11 +126,19 @@ app.post('/', async (c) => {if (sb) {const [ep] = await db.select().from(schema.episodes).where(eq(schema.episodes.id, sb.episodeId))const locked = type === 'image' ? ep?.imageConfigId : ep?.videoConfigId- if (locked != null) configId = locked+ if (locked != null && configId == null) configId = lockedif (type === 'video' && ep?.resolution) episodeResolution = ep.resolution}}+ if (type === 'video' && videoBody) {+ const effectiveConfig = configId+ ? (await getConfigById(configId)) ?? await getActiveConfig('video')+ : await getActiveConfig('video')+ const validationError = validateVideoRequest(videoBody, effectiveConfig?.provider)+ if (validationError) return badRequest(c, validationError)+ }+logTaskStart('TaskAPI', 'generate', {type,storyboardId: body.storyboard_id,@@ -72,16 +164,24 @@ app.post('/', async (c) => {: await generateVideo({storyboardId: body.storyboard_id,dramaId: body.drama_id,- prompt: body.prompt,- model: body.model,+ prompt: videoBody!.prompt,+ model: videoBody!.model,referenceMode: 'reference',- referenceImageUrls: body.reference_image_urls,- referenceVideoUrls: body.reference_video_urls,- referenceAudioUrls: body.reference_audio_urls,- generateAudio: body.generate_audio,- duration: body.duration,- aspectRatio: body.aspect_ratio,- resolution: episodeResolution || body.resolution,+ imageUrl: videoBody!.image_url,+ firstFrameUrl: videoBody!.first_frame_url,+ lastFrameUrl: videoBody!.last_frame_url,+ referenceImageUrls: videoBody!.reference_image_urls,+ referenceVideoUrls: videoBody!.reference_video_urls,+ referenceAudioUrls: videoBody!.reference_audio_urls,+ referenceFileUrl: videoBody!.file_url,+ referenceLinkUrl: videoBody!.link_url,+ generateAudio: videoBody!.generate_audio,+ duration: videoBody!.duration,+ aspectRatio: videoBody!.aspect_ratio,+ resolution: episodeResolution || videoBody!.resolution,+ seed: videoBody!.seed,+ promptExtend: videoBody!.prompt_extend,+ watermark: videoBody!.watermark,configId,})diff --git a/backend/src/services/adapters/aliyun-wan-video.ts b/backend/src/services/adapters/aliyun-wan-video.tsnew file mode 100644index 0000000..56f27d1--- /dev/null+++ b/backend/src/services/adapters/aliyun-wan-video.ts@@ -0,0 +1,262 @@+/**+ * 阿里云百炼万相 Wan 3.0 视频生成 Adapter。+ *+ * 官方协议:+ * - POST /api/v1/services/aigc/video-generation/video-synthesis+ * - GET /api/v1/tasks/{task_id}+ * - 仅支持 wan3.0-video-prime / wan3.0-video+ * - 请求体为 { model, input: { prompt, media }, parameters }+ * - 异步响应为 { output: { task_id, task_status }, request_id }+ */+import type {+ AIConfig,+ ProviderRequest,+ VideoGenerationRecord,+ VideoGenResponse,+ VideoPollResponse,+ VideoProviderAdapter,+} from './types'+import { joinProviderUrl } from './url'++const SUPPORTED_MODELS = new Set(['wan3.0-video-prime', 'wan3.0-video'])+const DEFAULT_MODEL = 'wan3.0-video-prime'+const PROMPT_MAX_CHARS = 20_000+const MAX_SEED = 2_147_483_647+const REF_LIMITS = { images: 10, videos: 5, audios: 5, total: 20 } as const+const VALID_RATIOS = new Set(['adaptive', '16:9', '4:3', '1:1', '3:4', '9:16'])+const VALID_RESOLUTIONS = new Set(['480P', '720P', '1080P'])++type WanMediaType =+ | 'first_frame'+ | 'last_frame'+ | 'reference_image'+ | 'reference_video'+ | 'reference_audio'+ | 'file'+ | 'link'++interface WanMedia {+ type: WanMediaType+ url: string+}++function parseUrlArray(raw?: string | null): string[] {+ if (!raw) return []+ try {+ const value = JSON.parse(raw)+ if (!Array.isArray(value)) return []+ return value+ .filter((url): url is string => typeof url === 'string')+ .map(url => url.trim())+ .filter(Boolean)+ } catch {+ return []+ }+}++function cleanUrl(value?: string | null): string {+ return String(value || '').trim()+}++function validateMediaUrl(type: WanMediaType, url: string) {+ const isWebUrl = /^https?:\/\//i.test(url)+ const isOssUrl = /^oss:\/\//i.test(url)+ const isImageData = /^data:image\/(?:jpeg|jpg|png|bmp|webp);base64,/i.test(url)+ if (type === 'first_frame' || type === 'last_frame' || type === 'reference_image') {+ if (isWebUrl || isOssUrl || isImageData) return+ throw new Error(`Wan 3.0 ${type} 需要 HTTP(S)/OSS 图片 URL 或官方支持的图片 Base64`)+ }+ if (type === 'link') {+ if (isWebUrl) return+ throw new Error('Wan 3.0 link 仅支持无需登录的 HTTP(S) 公开网页')+ }+ if (isWebUrl || isOssUrl) return+ throw new Error(`Wan 3.0 ${type} 仅支持 HTTP(S) 或 OSS URL`)+}++function booleanValue(value: number | boolean | null | undefined, fallback: boolean): boolean {+ if (value === null || value === undefined) return fallback+ return value !== false && value !== 0+}++function errorMessage(result: any, fallback: string): string {+ const output = result?.output && typeof result.output === 'object' ? result.output : {}+ const code = output.code || result?.code+ const message = output.message || result?.message || fallback+ const requestId = result?.request_id+ return `${code ? `[${code}] ` : ''}${message}${requestId ? ` (request_id: ${requestId})` : ''}`+}++export class AliyunWanVideoAdapter implements VideoProviderAdapter {+ provider = 'aliyun'++ buildGenerateRequest(config: AIConfig, record: VideoGenerationRecord): ProviderRequest {+ const model = cleanUrl(record.model || config.model || DEFAULT_MODEL)+ if (!SUPPORTED_MODELS.has(model)) {+ throw new Error(`Wan 3.0 仅支持 wan3.0-video-prime 或 wan3.0-video,当前: ${model}`)+ }++ // 官方对超过 20000 字符的部分自动截断;同时将项目内部 @图片N 标记转为官方的 图N 引用。+ const prompt = cleanUrl(record.prompt).replace(/@图片(\d+)/g, '图$1').slice(0, PROMPT_MAX_CHARS)++ const refImages = parseUrlArray(record.referenceImageUrls)+ const refVideos = parseUrlArray(record.referenceVideoUrls)+ const refAudios = parseUrlArray(record.referenceAudioUrls)+ const firstFrame = cleanUrl(record.firstFrameUrl || record.imageUrl)+ const lastFrame = cleanUrl(record.lastFrameUrl)+ const file = cleanUrl(record.referenceFileUrl)+ const link = cleanUrl(record.referenceLinkUrl)++ this.validateMedia({ refImages, refVideos, refAudios, firstFrame, lastFrame, file, link })++ const media: WanMedia[] = []+ if (firstFrame) media.push({ type: 'first_frame', url: firstFrame })+ if (lastFrame) media.push({ type: 'last_frame', url: lastFrame })+ for (const url of refImages) media.push({ type: 'reference_image', url })+ for (const url of refVideos) media.push({ type: 'reference_video', url })+ for (const url of refAudios) media.push({ type: 'reference_audio', url })+ if (file) media.push({ type: 'file', url: file })+ if (link) media.push({ type: 'link', url: link })+ for (const item of media) validateMediaUrl(item.type, item.url)++ if (!prompt && media.length === 0) {+ throw new Error('Wan 3.0 的 input.prompt 和 input.media 至少需要提供一项')+ }++ const input: { prompt?: string; media?: WanMedia[] } = {}+ if (prompt) input.prompt = prompt+ if (media.length) input.media = media++ const parameters: Record<string, string | number | boolean> = {+ resolution: this.normalizeResolution(record.resolution),+ ratio: this.normalizeRatio(record.aspectRatio),+ duration: this.normalizeDuration(record.duration),+ audio: booleanValue(record.generateAudio, true),+ prompt_extend: booleanValue(record.promptExtend, true),+ watermark: booleanValue(record.watermark, false),+ }++ if (record.seed !== null && record.seed !== undefined) {+ const seed = Number(record.seed)+ if (!Number.isInteger(seed) || (seed !== -1 && (seed < 0 || seed > MAX_SEED))) {+ throw new Error(`Wan 3.0 seed 必须为 -1 或 0~${MAX_SEED} 的整数`)+ }+ parameters.seed = seed+ }++ return {+ url: joinProviderUrl(config.baseUrl, '/api/v1', '/services/aigc/video-generation/video-synthesis'),+ method: 'POST',+ headers: {+ 'Content-Type': 'application/json',+ 'Authorization': `Bearer ${config.apiKey}`,+ 'X-DashScope-Async': 'enable',+ },+ body: { model, input, parameters },+ }+ }++ parseGenerateResponse(result: any): VideoGenResponse {+ const taskId = result?.output?.task_id+ if (taskId) return { isAsync: true, taskId: String(taskId) }+ throw new Error(errorMessage(result, 'Wan 3.0 响应中缺少 output.task_id'))+ }++ buildPollRequest(config: AIConfig, taskId: string): ProviderRequest {+ return {+ url: joinProviderUrl(config.baseUrl, '/api/v1', `/tasks/${encodeURIComponent(taskId)}`),+ method: 'GET',+ headers: { 'Authorization': `Bearer ${config.apiKey}` },+ body: undefined,+ }+ }++ parsePollResponse(result: any): VideoPollResponse {+ const output = result?.output && typeof result.output === 'object' ? result.output : {}+ switch (output.task_status) {+ case 'PENDING':+ return { status: 'pending' }+ case 'RUNNING':+ return { status: 'processing' }+ case 'SUCCEEDED':+ if (!output.video_url) {+ return { status: 'failed', error: errorMessage(result, 'Wan 3.0 任务成功但响应中缺少 output.video_url') }+ }+ {+ const duration = Number(result?.usage?.output_video_duration ?? result?.usage?.duration)+ return {+ status: 'completed',+ videoUrl: output.video_url,+ ...(Number.isFinite(duration) ? { duration } : {}),+ }+ }+ case 'FAILED':+ return { status: 'failed', error: errorMessage(result, 'Wan 3.0 视频生成失败') }+ case 'CANCELED':+ return { status: 'failed', error: errorMessage(result, 'Wan 3.0 任务已取消') }+ case 'UNKNOWN':+ return { status: 'failed', error: errorMessage(result, 'Wan 3.0 任务不存在或已超过 24 小时查询有效期') }+ default:+ if (result?.code || result?.message || output.code || output.message) {+ return { status: 'failed', error: errorMessage(result, 'Wan 3.0 任务查询失败') }+ }+ return { status: 'processing' }+ }+ }++ extractVideoUrl(result: any): string | null {+ return result?.output?.video_url || null+ }++ private validateMedia(input: {+ refImages: string[]+ refVideos: string[]+ refAudios: string[]+ firstFrame: string+ lastFrame: string+ file: string+ link: string+ }) {+ const { refImages, refVideos, refAudios, firstFrame, lastFrame, file, link } = input+ if (refImages.length > REF_LIMITS.images || refVideos.length > REF_LIMITS.videos || refAudios.length > REF_LIMITS.audios) {+ throw new Error(`Wan 3.0 参考素材超限:图片≤${REF_LIMITS.images}、视频≤${REF_LIMITS.videos}、音频≤${REF_LIMITS.audios}`)+ }+ if (lastFrame && !firstFrame) throw new Error('Wan 3.0 尾帧必须与首帧同时传入')+ if (file && link) throw new Error('Wan 3.0 file 与 link 不能同时传入')++ const hasFrameMode = Boolean(firstFrame || lastFrame)+ const hasReferenceMode = Boolean(refImages.length || refVideos.length || refAudios.length || file || link)+ if (hasFrameMode && hasReferenceMode) {+ throw new Error('Wan 3.0 的 first_frame/last_frame 不能与 reference_image/reference_video/reference_audio/file/link 混用')+ }++ const total = refImages.length + refVideos.length + refAudios.length + (firstFrame ? 1 : 0)+ + (lastFrame ? 1 : 0) + (file ? 1 : 0) + (link ? 1 : 0)+ if (total > REF_LIMITS.total) throw new Error(`Wan 3.0 input.media 最多 ${REF_LIMITS.total} 项`)+ }++ private normalizeDuration(duration?: number | null): number {+ if (duration === null || duration === undefined) return 5+ const value = Number(duration)+ if (!Number.isInteger(value) || (value !== -1 && (value < 2 || value > 30))) {+ throw new Error('Wan 3.0 duration 必须为 -1 或 2~30 的整数')+ }+ return value+ }++ private normalizeResolution(resolution?: string | null): string {+ const value = cleanUrl(resolution).toUpperCase() || '1080P'+ if (!VALID_RESOLUTIONS.has(value)) {+ throw new Error('Wan 3.0 resolution 仅支持 480P、720P 或 1080P')+ }+ return value+ }++ private normalizeRatio(ratio?: string | null): string {+ const value = cleanUrl(ratio) || 'adaptive'+ if (!VALID_RATIOS.has(value)) {+ throw new Error('Wan 3.0 ratio 仅支持 adaptive、16:9、4:3、1:1、3:4 或 9:16')+ }+ return value+ }+}diff --git a/backend/src/services/adapters/registry.ts b/backend/src/services/adapters/registry.tsindex 54c5722..58c0e74 100644--- a/backend/src/services/adapters/registry.ts+++ b/backend/src/services/adapters/registry.ts@@ -7,6 +7,7 @@ import { GeminiImageAdapter } from './gemini-image'import { VolcEngineImageAdapter } from './volcengine-image'import { VolcEngineVideoAdapter } from './volcengine-video'import { MiniMaxVideoAdapter } from './minimax-video'+import { AliyunWanVideoAdapter } from './aliyun-wan-video'import type { ImageProviderAdapter, VideoProviderAdapter } from './types'// 图片 Adapter 注册表@@ -20,6 +21,7 @@ export const imageAdapters: Record<string, ImageProviderAdapter> = {export const videoAdapters: Record<string, VideoProviderAdapter> = {volcengine: new VolcEngineVideoAdapter(),minimax: new MiniMaxVideoAdapter(),+ aliyun: new AliyunWanVideoAdapter(),}/**diff --git a/backend/src/services/adapters/types.ts b/backend/src/services/adapters/types.tsindex d16397c..c4e0877 100644--- a/backend/src/services/adapters/types.ts+++ b/backend/src/services/adapters/types.ts@@ -96,10 +96,15 @@ export interface VideoGenerationRecord {referenceImageUrls?: string | nullreferenceVideoUrls?: string | nullreferenceAudioUrls?: string | null+ referenceFileUrl?: string | null+ referenceLinkUrl?: string | nullgenerateAudio?: number | boolean | nullduration?: number | nullaspectRatio?: string | nullresolution?: string | null+ seed?: number | null+ promptExtend?: number | boolean | null+ watermark?: number | boolean | null// ... 其他字段}@@ -125,5 +130,6 @@ export interface VideoGenResponse {export interface VideoPollResponse {status: 'pending' | 'processing' | 'completed' | 'failed'videoUrl?: string+ duration?: numbererror?: string}diff --git a/backend/src/services/adapters/volcengine-video.ts b/backend/src/services/adapters/volcengine-video.tsindex 694afd7..ab2b6e8 100644--- a/backend/src/services/adapters/volcengine-video.ts+++ b/backend/src/services/adapters/volcengine-video.ts@@ -19,7 +19,7 @@ import { joinProviderUrl } from './url'/** 仅支持 Seedance 2.0+ 系列(前缀匹配,兼容未来 2.0.x 变体) */const SEEDANCE2_MODEL_PREFIX = 'doubao-seedance-2-0'-const DEFAULT_MODEL = 'doubao-seedance-2-0-fast-260128'+const DEFAULT_MODEL = 'doubao-seedance-2-0-mini-260615'/** 多模态参考素材上限:图片 9、视频 3、音频 3 */const REF_LIMITS = { images: 9, videos: 3, audios: 3 } as const@@ -76,6 +76,7 @@ export class VolcEngineVideoAdapter implements VideoProviderAdapter {generate_audio: record.generateAudio !== 0 && record.generateAudio !== false,ratio: record.aspectRatio || 'adaptive',duration: this.normalizeDuration(record.duration),+ // Seedance 2.0 仅 480p/720p 两档,1080p 收敛到 720presolution: record.resolution === '480p' ? '480p' : '720p',watermark: false,}diff --git a/backend/src/services/ai.ts b/backend/src/services/ai.tsindex c04a936..22e5600 100644--- a/backend/src/services/ai.ts+++ b/backend/src/services/ai.ts@@ -31,7 +31,7 @@ export function parseConfigTemperature(settingsRaw: string | null | undefined):export const officialProviders: Record<ServiceType, readonly string[]> = {text: ['openai', 'gemini', 'volcengine'],image: ['openai', 'gemini', 'volcengine'],- video: ['volcengine', 'minimax'],+ video: ['volcengine', 'minimax', 'aliyun'],}export function isOfficialProvider(serviceType?: string | null, provider?: string | null): boolean {diff --git a/backend/src/services/generation.ts b/backend/src/services/generation.tsindex af3d78a..de41ce0 100644--- a/backend/src/services/generation.ts+++ b/backend/src/services/generation.ts@@ -48,10 +48,15 @@ interface GenerateVideoParams {referenceImageUrls?: string[]referenceVideoUrls?: string[]referenceAudioUrls?: string[]+ referenceFileUrl?: string+ referenceLinkUrl?: stringgenerateAudio?: booleanduration?: numberaspectRatio?: stringresolution?: string+ seed?: number+ promptExtend?: boolean+ watermark?: booleanconfigId?: number}@@ -113,11 +118,16 @@ export async function generateVideo(params: GenerateVideoParams): Promise<numberreferenceImageUrls: params.referenceImageUrls,referenceVideoUrls: params.referenceVideoUrls,referenceAudioUrls: params.referenceAudioUrls,+ referenceFileUrl: params.referenceFileUrl,+ referenceLinkUrl: params.referenceLinkUrl,generateAudio: params.generateAudio === false ? 0 : 1,- duration: params.duration || 5,- aspectRatio: params.aspectRatio || '16:9',- // 保留高分辨率档位透传(MiniMax 768P/2K),火山等适配器内部自行归并- resolution: ['480p', '720p', '1080p', '2K'].includes(params.resolution || '') ? params.resolution : '720p',+ duration: params.duration,+ aspectRatio: params.aspectRatio,+ // 统一存为项目内部格式,各适配器再转换为官方大小写与枚举。+ resolution: normalizeStoredVideoResolution(params.resolution),+ seed: params.seed,+ promptExtend: params.promptExtend,+ watermark: params.watermark,})logTaskStart('VideoTask', 'enqueue', {@@ -215,6 +225,7 @@ async function processTask(id: number, config: AIConfig) {// 参考视频/音频文件较大,不适合 dataURL 内联,需解析为公网可访问 URLconst resolvedReferenceVideoUrls = resolvePublicMediaUrls(params.referenceVideoUrls, 'video')const resolvedReferenceAudioUrls = resolvePublicMediaUrls(params.referenceAudioUrls, 'audio')+ const resolvedReferenceFileUrl = resolvePublicMediaUrl(params.referenceFileUrl, 'file');({ url, method, headers, body } = adapter.buildGenerateRequest(config, {id: record.id,model: record.model,@@ -226,10 +237,15 @@ async function processTask(id: number, config: AIConfig) {referenceImageUrls: resolvedReferenceImageUrls.length ? JSON.stringify(resolvedReferenceImageUrls) : null,referenceVideoUrls: resolvedReferenceVideoUrls.length ? JSON.stringify(resolvedReferenceVideoUrls) : null,referenceAudioUrls: resolvedReferenceAudioUrls.length ? JSON.stringify(resolvedReferenceAudioUrls) : null,+ referenceFileUrl: resolvedReferenceFileUrl,+ referenceLinkUrl: params.referenceLinkUrl,generateAudio: params.generateAudio,duration: params.duration,aspectRatio: params.aspectRatio,resolution: params.resolution,+ seed: params.seed,+ promptExtend: params.promptExtend,+ watermark: params.watermark,}))}@@ -366,7 +382,7 @@ async function pollTask(record: SysTaskRecord, config: AIConfig, taskId: string)}} else if (pollResp.videoUrl) {logTaskSuccess(label, 'poll-complete', { id: record.id, taskId, videoUrl: pollResp.videoUrl })- await handleVideoComplete(record, pollResp.videoUrl, null)+ await handleVideoComplete(record, pollResp.videoUrl, pollResp.duration)return}}@@ -520,16 +536,16 @@ async function normalizeVideoReferenceUrls(refs: string[] | null | undefined): P* http(s)/dataURL 直通;本地 static 路径需要 PUBLIC_BASE_URL 拼成公网地址,* 未配置时抛出可操作的中文错误(落入 catch 写入 error_msg 供前端展示)。*/-function resolvePublicMediaUrl(value: string | null | undefined, kind: 'video' | 'audio'): string | null {+function resolvePublicMediaUrl(value: string | null | undefined, kind: 'video' | 'audio' | 'file'): string | null {const raw = String(value || '').trim()if (!raw) return nullif (raw.startsWith('http://') || raw.startsWith('https://') || raw.startsWith('data:')) return rawif (raw.startsWith('static/') || raw.startsWith('/static/')) {const base = (process.env.PUBLIC_BASE_URL || '').trim().replace(/\/+$/, '')if (!base) {- const label = kind === 'video' ? '视频' : '音频'+ const label = kind === 'video' ? '视频' : kind === 'audio' ? '音频' : '文件'throw new Error(- `参考${label}为本地路径 ${raw},但后端未配置 PUBLIC_BASE_URL,Seedance API 无法访问内网地址。` ++ `参考${label}为本地路径 ${raw},但后端未配置 PUBLIC_BASE_URL,上游视频生成 API 无法访问内网地址。` +`请在 backend/.env 配置 PUBLIC_BASE_URL(如 https://your-domain.com)后重试,或改用公网 URL。`,)}@@ -544,3 +560,10 @@ function resolvePublicMediaUrls(refs: string[] | null | undefined, kind: 'video'const items = Array.from(new Set(refs.map((item) => String(item || '').trim()).filter(Boolean)))return items.map((item) => resolvePublicMediaUrl(item, kind)).filter((item): item is string => !!item)}++function normalizeStoredVideoResolution(resolution: string | null | undefined): string | undefined {+ const value = String(resolution || '').trim().toLowerCase()+ if (value === '480p' || value === '720p' || value === '1080p') return value+ if (value === '2k') return '2K'+ return undefined+}diff --git a/backend/tests/aliyun-wan3-video.test.ts b/backend/tests/aliyun-wan3-video.test.tsnew file mode 100644index 0000000..45d06a3--- /dev/null+++ b/backend/tests/aliyun-wan3-video.test.ts@@ -0,0 +1,95 @@+import assert from 'node:assert/strict'+import { test } from 'node:test'+import { AliyunWanVideoAdapter } from '../src/services/adapters/aliyun-wan-video'++const adapter = new AliyunWanVideoAdapter()+const config = {+ provider: 'aliyun',+ baseUrl: 'https://ws-123.cn-beijing.maas.aliyuncs.com',+ apiKey: 'sk-test',+ model: 'wan3.0-video-prime',+}++test('Wan 3.0 request follows the official input/media/parameters contract', () => {+ const request = adapter.buildGenerateRequest(config, {+ id: 1,+ prompt: '@图片1女孩 走进视频1的房间',+ referenceImageUrls: JSON.stringify(['https://example.com/1.png']),+ referenceVideoUrls: JSON.stringify(['https://example.com/1.mp4']),+ referenceAudioUrls: JSON.stringify(['https://example.com/1.mp3']),+ referenceFileUrl: 'https://example.com/brief.pdf',+ duration: -1,+ aspectRatio: 'adaptive',+ resolution: '1080p',+ generateAudio: false,+ seed: 42,+ promptExtend: false,+ watermark: true,+ })++ assert.equal(request.url, 'https://ws-123.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis')+ assert.equal(request.method, 'POST')+ assert.equal(request.headers.Authorization, 'Bearer sk-test')+ assert.equal(request.headers['X-DashScope-Async'], 'enable')+ assert.deepEqual(request.body, {+ model: 'wan3.0-video-prime',+ input: {+ prompt: '图1女孩 走进视频1的房间',+ media: [+ { type: 'reference_image', url: 'https://example.com/1.png' },+ { type: 'reference_video', url: 'https://example.com/1.mp4' },+ { type: 'reference_audio', url: 'https://example.com/1.mp3' },+ { type: 'file', url: 'https://example.com/brief.pdf' },+ ],+ },+ parameters: {+ resolution: '1080P',+ ratio: 'adaptive',+ duration: -1,+ audio: false,+ prompt_extend: false,+ watermark: true,+ seed: 42,+ },+ })+})++test('Wan 3.0 supports official first/last frame mode and rejects mixed media modes', () => {+ const request = adapter.buildGenerateRequest(config, {+ id: 2,+ prompt: '从白天过渡到黑夜',+ firstFrameUrl: 'data:image/png;base64,first',+ lastFrameUrl: 'data:image/png;base64,last',+ })++ assert.deepEqual(request.body.input.media, [+ { type: 'first_frame', url: 'data:image/png;base64,first' },+ { type: 'last_frame', url: 'data:image/png;base64,last' },+ ])+ assert.throws(() => adapter.buildGenerateRequest(config, {+ id: 3,+ firstFrameUrl: 'https://example.com/first.png',+ referenceAudioUrls: JSON.stringify(['https://example.com/ref.mp3']),+ }), /first_frame\/last_frame/)+})++test('Wan 3.0 parses official async creation and polling responses', () => {+ assert.deepEqual(adapter.parseGenerateResponse({+ output: { task_status: 'PENDING', task_id: 'task-123' },+ request_id: 'request-1',+ }), { isAsync: true, taskId: 'task-123' })++ assert.deepEqual(adapter.parsePollResponse({+ output: { task_status: 'SUCCEEDED', video_url: 'https://example.com/result.mp4' },+ usage: { output_video_duration: 7.5, fps: 30, SR: 1080, ratio: '16:9' },+ request_id: 'request-2',+ }), { status: 'completed', videoUrl: 'https://example.com/result.mp4', duration: 7.5 })++ assert.deepEqual(adapter.parsePollResponse({+ output: { task_status: 'FAILED', code: 'InvalidParameter', message: 'bad media combination' },+ request_id: 'request-3',+ }), {+ status: 'failed',+ error: '[InvalidParameter] bad media combination (request_id: request-3)',+ })+})diff --git a/backend/tests/official-provider-adapters.test.mjs b/backend/tests/official-provider-adapters.test.mjsindex fbd2604..f708ac1 100644--- a/backend/tests/official-provider-adapters.test.mjs+++ b/backend/tests/official-provider-adapters.test.mjs@@ -58,7 +58,7 @@ test('backend rejects unsupported providers at DB and route boundaries', () => {assert.match(ai, /officialProviders/)assert.match(ai, /text:\s*\[\s*'openai',\s*'gemini',\s*'volcengine'\s*\]/)assert.match(ai, /image:\s*\[\s*'openai',\s*'gemini',\s*'volcengine'\s*\]/)- assert.match(ai, /video:\s*\[\s*'volcengine'\s*\]/)+ assert.match(ai, /video:\s*\[\s*'volcengine',\s*'minimax',\s*'aliyun'\s*\]/)assert.doesNotMatch(ai, /'deepseek'/)assert.doesNotMatch(ai, /'ali'/)assert.doesNotMatch(ai, /'vidu'/)@@ -112,11 +112,15 @@ test('AI config probe uses provider-specific auth schemes', () => {assert.match(geminiHeaders, /x-goog-api-key/)assert.doesNotMatch(geminiHeaders, /Authorization\s*=\s*`Bearer/)- assert.match(route, /modelName\.startsWith\('gemini-3'\)/)- assert.match(route, /'\/interactions'/)+ assert.match(route, /\/models\/\$\{modelName\}:generateContent/)+ assert.match(route, /url\.searchParams\.set\('key', apiKey\)/)assert.match(route, /function bearerHeaders/)assert.match(route, /p === 'openai'/)assert.match(route, /p === 'volcengine'/)+ assert.match(route, /p === 'minimax'/)+ assert.match(route, /p === 'aliyun'/)+ assert.match(route, /X-DashScope-Async': 'enable'/)+ assert.match(route, /\/services\/aigc\/video-generation\/video-synthesis/)assert.match(route, /'\/chat\/completions'/)assert.doesNotMatch(route, /viduHeaders/)assert.doesNotMatch(route, /p === 'deepseek'/)@@ -166,6 +170,7 @@ test('new image and video models use their current API shapes', () => {const openaiImage = read('src/services/adapters/openai-image.ts')const geminiImage = read('src/services/adapters/gemini-image.ts')const volcVideo = read('src/services/adapters/volcengine-video.ts')+ const wanVideo = read('src/services/adapters/aliyun-wan-video.ts')assert.match(openaiImage, /isGptImage2/)assert.match(openaiImage, /normalizeGptImage2Size/)@@ -173,11 +178,20 @@ test('new image and video models use their current API shapes', () => {assert.match(geminiImage, /\/v1beta'[\s\S]*'\/interactions'/)assert.match(geminiImage, /response_format/)assert.doesNotMatch(geminiImage, /Authorization': `Bearer/)- assert.match(volcVideo, /doubao-seedance-2-0-260128/)+ assert.match(volcVideo, /doubao-seedance-2-0-fast-260128/)// Seedance 2.0 多模态能力assert.match(volcVideo, /SEEDANCE2_MODEL_PREFIX/)assert.match(volcVideo, /startsWith\(SEEDANCE2_MODEL_PREFIX\)/)assert.match(volcVideo, /reference_video/)assert.match(volcVideo, /reference_audio/)assert.match(volcVideo, /generate_audio:\s*record\.generateAudio/)+ // Wan 3.0 使用阿里云百炼官方异步视频生成协议+ assert.match(wanVideo, /wan3\.0-video-prime/)+ assert.match(wanVideo, /wan3\.0-video/)+ assert.match(wanVideo, /\/services\/aigc\/video-generation\/video-synthesis/)+ assert.match(wanVideo, /X-DashScope-Async': 'enable'/)+ assert.match(wanVideo, /body:\s*\{ model, input, parameters \}/)+ assert.match(wanVideo, /\/tasks\/\$\{encodeURIComponent\(taskId\)\}/)+ assert.match(wanVideo, /output\.task_status/)+ assert.match(wanVideo, /output_video_duration/)})diff --git a/backend/tests/seedance2-video-modes.test.mjs b/backend/tests/seedance2-video-modes.test.mjsindex 81ada4a..91edbc9 100644--- a/backend/tests/seedance2-video-modes.test.mjs+++ b/backend/tests/seedance2-video-modes.test.mjs@@ -56,15 +56,15 @@ test('video resolution is fixed per episode, editable, and locked into video tasconst service = read('src/services/generation.ts')// 创建集时固定(默认 720p,仅接受 480p/720p)- assert.match(episodes, /resolution: body\.resolution === '480p' \? '480p' : '720p'/)+ assert.match(episodes, /\['480p', '720p', '1080p'\]\.includes\(body\.resolution\)/)// PUT 可修改,白名单校验assert.match(episodes, /'status', 'resolution'\]/)assert.match(episodes, /resolution 只支持 480p \/ 720p/)// 视频任务锁定集的分辨率(优先于请求体)assert.match(tasks, /episodeResolution = ep\.resolution/)- assert.match(tasks, /resolution: episodeResolution \|\| body\.resolution/)+ assert.match(tasks, /resolution: episodeResolution \|\| videoBody!\.resolution/)// 服务落入 params 并传给适配器- assert.match(service, /resolution: params\.resolution === '480p' \? '480p' : '720p'/)+ assert.match(service, /resolution: normalizeStoredVideoResolution\(params\.resolution\)/)assert.match(service, /resolution: params\.resolution,/)})@@ -91,17 +91,16 @@ test('tasks route validates reference-mode requirements for video tasks', () =>assert.doesNotMatch(route, /文生视频模式必须提供 prompt/)assert.doesNotMatch(route, /首帧模式必须提供 first_frame_url/)assert.doesNotMatch(route, /首尾帧模式必须同时提供/)- assert.doesNotMatch(route, /body\.first_frame_url/)- assert.doesNotMatch(route, /body\.last_frame_url/)+ // Wan 3.0 官方入参兼容层会把 input.media 归一到 first_frame_url/last_frame_url 等扁平字段// 多模态参考校验并固定 reference 模式assert.match(route, /参考素材超限:图片≤9、视频≤3、音频≤3/)assert.match(route, /参考音频需要至少 1 个参考图片或视频/)- assert.match(route, /多模态参考模式需要至少一个参考素材或 prompt/)+ assert.match(route, /视频生成需要至少一个参考素材或 prompt/)assert.match(route, /referenceMode: 'reference'/)- assert.match(route, /referenceVideoUrls: body\.reference_video_urls/)- assert.match(route, /referenceAudioUrls: body\.reference_audio_urls/)- assert.match(route, /generateAudio: body\.generate_audio/)+ assert.match(route, /referenceVideoUrls: videoBody!\.reference_video_urls/)+ assert.match(route, /referenceAudioUrls: videoBody!\.reference_audio_urls/)+ assert.match(route, /generateAudio: videoBody!\.generate_audio/)})test('image/video generation tasks are unified into a single sys_task table', () => {diff --git a/frontend/app/components/ModelSelect.vue b/frontend/app/components/ModelSelect.vueindex d6faf1a..630ebaf 100644--- a/frontend/app/components/ModelSelect.vue+++ b/frontend/app/components/ModelSelect.vue@@ -10,6 +10,7 @@<Teleport to="body"><div v-if="isOpen" class="model-select-menu" :style="menuStyle" ref="menuEl"><button+ v-if="!hideDefault"type="button":class="['model-select-option', { selected: modelValue === '' }]"@click="pick('')"@@ -45,6 +46,7 @@ const props = defineProps({options: { type: Array, default: () => [] }, // [{ key, model, provider, configId, configName }]defaultLabel: { type: String, default: '' }, // 缺省回退 t('common.default')showConfig: { type: Boolean, default: false }, // 多配置时显示来源配置名+ hideDefault: { type: Boolean, default: false }, // 无「默认」语义的选择器(如分辨率)隐藏默认项})const emit = defineEmits(['update:modelValue'])diff --git a/frontend/app/locales/en.json b/frontend/app/locales/en.jsonindex 6728011..8142814 100644--- a/frontend/app/locales/en.json+++ b/frontend/app/locales/en.json@@ -423,7 +423,8 @@"tasks": "Tasks","viewFilm": "View Film","continue": "Continue",- "start": "Start Production"+ "start": "Start Production",+ "resolution": "Resolution"},"model": {"defaultWith": "Default · {model}",@@ -711,7 +712,26 @@"genDone": "Video generation complete","genFailed": "Video generation failed","genTimeout": "Video generation timed out",- "allDone": "All shot videos generated"+ "allDone": "All shot videos generated",+ "moderationHint": "Looks like a real-person/sensitive content moderation rejection — switch video model in the top bar and retry",+ "resolutionSwitched": "Episode video resolution switched to {label}",+ "noneToGenerate": "No shots to generate",+ "batchStarted": "Started {n} video generation tasks",+ "retryFailed": "Retry failed ({n})",+ "select": "Select",+ "selectDone": "{n} selected · Done",+ "batchSelected": "Generate selected ({n})",+ "listMetaFiltered": "Filtered · {n}/{total} tasks",+ "defaultModel": "Default model",+ "confirmTitle": "Batch generate videos",+ "confirmShots": "Shots",+ "confirmShotsValue": "{n}",+ "confirmTotal": "Total duration",+ "confirmApprox": "~{n}s",+ "confirmModel": "Video model",+ "confirmResolution": "Resolution",+ "confirmNote": "Generation will start shot by shot with the above config; failed tasks can be retried later via \"Retry failed\".",+ "confirmStart": "Start ({n})"},"inspector": {"videoPromptPlaceholder": "Reference assets with {'@'}character / {'@'}scene — auto-mapped to reference images on generation; then describe motion and camera per time segment…",@@ -720,13 +740,16 @@"imageN": "Image {n}","videoN": "Video {n}","audioN": "Audio {n}",- "uploadRefImage": "Upload reference image ({used}/9)",- "uploadRefVideo": "Upload reference video ({used}/3)",- "uploadRefAudio": "Upload reference audio ({used}/3)",+ "uploadRefImage": "Upload reference image ({used}/{limit})",+ "uploadRefVideo": "Upload reference video ({used}/{limit})",+ "uploadRefAudio": "Upload reference audio ({used}/{limit})","refAudioHint": "Reference audio requires at least 1 reference image or video","params": "Generation Params",- "duration": "Duration",- "durationUnit": "s (4-15)"+ "duration": "Shot duration",+ "durationUnit": "s (4-15)",+ "durationUnitWan": "s (2-30)",+ "durationHint": "Saved to the storyboard on change; applies to list, batch and single generation",+ "effective": "This run: {model} · {res} · {dur}s"},"tasks": {"title": "Generation Tasks",@@ -778,7 +801,8 @@"refMax3": "At most 3 reference {type}","refDone": "Reference {type} uploaded","refAudioNeed": "Reference audio requires at least 1 reference image or video",- "audio": "audio"+ "audio": "audio",+ "refMax": "At most {n} reference {type}"},"viewer": {"imagePreview": "Image Preview",@@ -790,6 +814,11 @@"generating": "Generating","failed": "Failed","todo": "Pending"+ },+ "resolution": {+ "smooth": "Smooth",+ "hd": "HD",+ "uhd": "UHD"}}-}+}\ No newline at end of filediff --git a/frontend/app/locales/ja.json b/frontend/app/locales/ja.jsonindex cf779b8..d619d9d 100644--- a/frontend/app/locales/ja.json+++ b/frontend/app/locales/ja.json@@ -423,7 +423,8 @@"tasks": "タスク","viewFilm": "完成映像を見る","continue": "制作を続ける",- "start": "制作を開始"+ "start": "制作を開始",+ "resolution": "解像度"},"model": {"defaultWith": "デフォルト · {model}",@@ -711,7 +712,26 @@"genDone": "動画生成が完了しました","genFailed": "動画生成に失敗しました","genTimeout": "動画生成がタイムアウトしました",- "allDone": "すべてのショット動画が生成済みです"+ "allDone": "すべてのショット動画が生成済みです",+ "moderationHint": "実写人物/センシティブ内容の審査で拒否された可能性があります。上部バーで別の動画モデルに切り替えて再試行してください",+ "resolutionSwitched": "このエピソードの動画解像度を {label} に変更しました",+ "noneToGenerate": "生成するショットがありません",+ "batchStarted": "{n} 件の動画生成タスクを開始しました",+ "retryFailed": "失敗を再試行({n})",+ "select": "選択",+ "selectDone": "{n} 件選択 · 完了",+ "batchSelected": "選択分を生成({n})",+ "listMetaFiltered": "絞り込み結果 · {n}/{total} 件のタスク",+ "defaultModel": "デフォルトモデル",+ "confirmTitle": "動画の一括生成",+ "confirmShots": "ショット数",+ "confirmShotsValue": "{n} 件",+ "confirmTotal": "合計時間",+ "confirmApprox": "約 {n} 秒",+ "confirmModel": "動画モデル",+ "confirmResolution": "解像度",+ "confirmNote": "上記の設定でショットごとに生成を開始します。失敗したタスクは後で「失敗を再試行」からまとめて再実行できます。",+ "confirmStart": "生成開始 ({n})"},"inspector": {"videoPromptPlaceholder": "{'@'}キャラクター名 / {'@'}シーン名 で参照素材を指定(生成時に参照画像へ自動マッピング)。時間帯ごとに画面の動きとカメラを記述…",@@ -720,13 +740,16 @@"imageN": "画像 {n}","videoN": "動画 {n}","audioN": "音声 {n}",- "uploadRefImage": "参照画像をアップロード ({used}/9)",- "uploadRefVideo": "参照動画をアップロード ({used}/3)",- "uploadRefAudio": "参照音声をアップロード ({used}/3)",+ "uploadRefImage": "参照画像をアップロード ({used}/{limit})",+ "uploadRefVideo": "参照動画をアップロード ({used}/{limit})",+ "uploadRefAudio": "参照音声をアップロード ({used}/{limit})","refAudioHint": "参照音声には参照画像または動画が 1 つ以上必要です","params": "生成パラメータ",- "duration": "生成の長さ",- "durationUnit": "s(4-15)"+ "duration": "分镜の長さ",+ "durationUnit": "s(4-15)",+ "durationUnitWan": "秒(2-30)",+ "durationHint": "変更はすぐ分镜に保存され、リストと一括生成にも反映されます",+ "effective": "今回の生成:{model} · {res} · {dur}秒"},"tasks": {"title": "生成タスク一覧",@@ -778,7 +801,8 @@"refMax3": "参照{type}は最大 3 つまで","refDone": "参照{type}をアップロードしました","refAudioNeed": "参照音声には参照画像または動画が 1 つ以上必要です",- "audio": "音声"+ "audio": "音声",+ "refMax": "参照{type}は最大 {n} つまで"},"viewer": {"imagePreview": "画像プレビュー",@@ -790,6 +814,11 @@"generating": "生成中","failed": "失敗","todo": "未生成"+ },+ "resolution": {+ "smooth": "標準",+ "hd": "高画質",+ "uhd": "超高画質"}}-}+}\ No newline at end of filediff --git a/frontend/app/locales/ko.json b/frontend/app/locales/ko.jsonindex 887e1e7..578a033 100644--- a/frontend/app/locales/ko.json+++ b/frontend/app/locales/ko.json@@ -423,7 +423,8 @@"tasks": "작업","viewFilm": "완성 영상 보기","continue": "제작 계속",- "start": "제작 시작"+ "start": "제작 시작",+ "resolution": "해상도"},"model": {"defaultWith": "기본 · {model}",@@ -711,7 +712,26 @@"genDone": "영상 생성이 완료되었습니다","genFailed": "영상 생성에 실패했습니다","genTimeout": "영상 생성 시간이 초과되었습니다",- "allDone": "모든 샷 영상이 생성되었습니다"+ "allDone": "모든 샷 영상이 생성되었습니다",+ "moderationHint": "실사 인물/민감 콘텐츠 심사에 걸렸을 수 있습니다. 상단 바에서 다른 영상 모델로 전환 후 다시 시도하세요",+ "resolutionSwitched": "이 에피소드의 영상 해상도가 {label}(으)로 변경되었습니다",+ "noneToGenerate": "생성할 샷이 없습니다",+ "batchStarted": "{n}개의 영상 생성 작업을 시작했습니다",+ "retryFailed": "실패 재시도({n})",+ "select": "선택",+ "selectDone": "{n}개 선택 · 완료",+ "batchSelected": "선택 항목 생성({n})",+ "listMetaFiltered": "필터 결과 · {n}/{total}개 작업",+ "defaultModel": "기본 모델",+ "confirmTitle": "영상 일괄 생성",+ "confirmShots": "샷 수",+ "confirmShotsValue": "{n}개",+ "confirmTotal": "총 길이",+ "confirmApprox": "약 {n}초",+ "confirmModel": "영상 모델",+ "confirmResolution": "해상도",+ "confirmNote": "위 설정으로 샷별로 생성을 시작합니다. 실패한 작업은 나중에 「실패 재시도」로 한 번에 다시 실행할 수 있습니다.",+ "confirmStart": "생성 시작 ({n})"},"inspector": {"videoPromptPlaceholder": "{'@'}캐릭터명 / {'@'}장멸명 으로 참조 소재를 지정(생성 시 참조 이미지로 자동 매핑). 시간대별로 화면의 움직임과 침라를 기술…",@@ -720,13 +740,16 @@"imageN": "이미지 {n}","videoN": "영상 {n}","audioN": "오디오 {n}",- "uploadRefImage": "참조 이미지 업로드 ({used}/9)",- "uploadRefVideo": "참조 영상 업로드 ({used}/3)",- "uploadRefAudio": "참조 오디오 업로드 ({used}/3)",+ "uploadRefImage": "참조 이미지 업로드 ({used}/{limit})",+ "uploadRefVideo": "참조 영상 업로드 ({used}/{limit})",+ "uploadRefAudio": "참조 오디오 업로드 ({used}/{limit})","refAudioHint": "참조 오디오에는 참조 이미지 또는 영상이 1개 이상 필요합니다","params": "생성 파라미터",- "duration": "생성 길이",- "durationUnit": "초(4-15)"+ "duration": "분镜 길이",+ "durationUnit": "초(4-15)",+ "durationUnitWan": "초(2-30)",+ "durationHint": "변경 즉시 스토리보드에 저장되며 목록과 일괄 생성에도 적용됩니다",+ "effective": "이번 생성: {model} · {res} · {dur}초"},"tasks": {"title": "생성 작업 목록",@@ -778,7 +801,8 @@"refMax3": "참조 {type}은(는) 최대 3개까지","refDone": "참조 {type}을(를) 업로드했습니다","refAudioNeed": "참조 오디오에는 참조 이미지 또는 영상이 1개 이상 필요합니다",- "audio": "오디오"+ "audio": "오디오",+ "refMax": "참조 {type}은(는) 최대 {n}개까지"},"viewer": {"imagePreview": "이미지 미리보기",@@ -790,6 +814,11 @@"generating": "생성 중","failed": "실패","todo": "미생성"+ },+ "resolution": {+ "smooth": "표준",+ "hd": "고화질",+ "uhd": "초고화질"}}-}+}\ No newline at end of filediff --git a/frontend/app/locales/zh.json b/frontend/app/locales/zh.jsonindex 2fb26bd..3947f85 100644--- a/frontend/app/locales/zh.json+++ b/frontend/app/locales/zh.json@@ -423,7 +423,8 @@"tasks": "任务","viewFilm": "查看成片","continue": "继续制作",- "start": "开始制作"+ "start": "开始制作",+ "resolution": "分辨率"},"model": {"defaultWith": "默认 · {model}",@@ -711,7 +712,26 @@"genDone": "视频生成完成","genFailed": "视频生成失败","genTimeout": "视频生成超时",- "allDone": "所有镜头视频已生成"+ "allDone": "所有镜头视频已生成",+ "moderationHint": "疑似真人/敏感内容审核未通过,可在顶栏切换其他视频模型后重试",+ "resolutionSwitched": "本集视频分辨率已切换为 {label}",+ "noneToGenerate": "没有可生成的镜头",+ "batchStarted": "已发起 {n} 个视频生成任务",+ "retryFailed": "重试失败({n})",+ "select": "选择",+ "selectDone": "已选 {n} · 完成",+ "batchSelected": "生成所选({n})",+ "listMetaFiltered": "筛选结果 · {n}/{total} 个任务",+ "defaultModel": "默认模型",+ "confirmTitle": "批量生成视频",+ "confirmShots": "镜头数",+ "confirmShotsValue": "{n} 个",+ "confirmTotal": "总时长",+ "confirmApprox": "约 {n}s",+ "confirmModel": "视频模型",+ "confirmResolution": "分辨率",+ "confirmNote": "将按以上配置逐镜头发起生成;失败的任务之后可点「重试失败」一键重跑。",+ "confirmStart": "开始生成 ({n})"},"inspector": {"videoPromptPlaceholder": "用 {'@'}角色名 / {'@'}场景名 引用参考素材,生成时自动映射为参考图片;再按时间段描述画面运动与镜头…",@@ -720,13 +740,16 @@"imageN": "图片 {n}","videoN": "视频 {n}","audioN": "音频 {n}",- "uploadRefImage": "上传参考图片 ({used}/9)",- "uploadRefVideo": "上传参考视频 ({used}/3)",- "uploadRefAudio": "上传参考音频 ({used}/3)",+ "uploadRefImage": "上传参考图片 ({used}/{limit})",+ "uploadRefVideo": "上传参考视频 ({used}/{limit})",+ "uploadRefAudio": "上传参考音频 ({used}/{limit})","refAudioHint": "参考音频需至少 1 个参考图片或视频","params": "生成参数",- "duration": "生成时长",- "durationUnit": "s(4-15)"+ "duration": "分镜时长",+ "durationUnit": "s(4-15)",+ "durationUnitWan": "s(2-30)",+ "durationHint": "修改即保存到分镜,列表与批量生成同步生效",+ "effective": "本次生成:{model} · {res} · {dur}s"},"tasks": {"title": "生成任务列表",@@ -778,7 +801,8 @@"refMax3": "参考{type}最多 3 个","refDone": "参考{type}已上传","refAudioNeed": "参考音频需要至少 1 个参考图片或视频",- "audio": "音频"+ "audio": "音频",+ "refMax": "参考{type}最多 {n} 个"},"viewer": {"imagePreview": "图片预览",@@ -790,6 +814,11 @@"generating": "生成中","failed": "失败","todo": "待生成"+ },+ "resolution": {+ "smooth": "流畅",+ "hd": "高清",+ "uhd": "超清"}}-}+}\ No newline at end of filediff --git a/frontend/app/pages/settings.vue b/frontend/app/pages/settings.vueindex 3ffbf1a..e48e0da 100644--- a/frontend/app/pages/settings.vue+++ b/frontend/app/pages/settings.vue@@ -656,7 +656,7 @@ const serviceTypes = computed(() => [{ type: 'image', label: t('common.serviceType.image') },{ type: 'video', label: t('common.serviceType.video') },])-const providers = ['gemini', 'openai', 'volcengine', 'minimax']+const providers = ['gemini', 'openai', 'volcengine', 'minimax', 'aliyun']const providerSelectOptions = computed(() => providers.map(p => ({ label: p, value: p })))const serviceMeta = computed(() => ({text: { label: t('common.serviceType.text'), desc: t('settings.ai.meta.text') },@@ -673,8 +673,9 @@ const providerPresets = {openai: { label: 'OpenAI 官方', baseUrl: 'https://api.openai.com', models: ['gpt-image-2'] },},video: {- volcengine: { label: 'Seedance 2.0 官方', baseUrl: 'https://ark.cn-beijing.volces.com', models: ['doubao-seedance-2-0-fast-260128', 'doubao-seedance-2-0-260128', 'doubao-seedance-2-0-mini-260615'] },+ volcengine: { label: 'Seedance 2.0 官方', baseUrl: 'https://ark.cn-beijing.volces.com', models: ['doubao-seedance-2-0-mini-260615', 'doubao-seedance-2-0-fast-260128', 'doubao-seedance-2-0-260128'] },minimax: { label: 'MiniMax H3 官方', baseUrl: 'https://api.minimaxi.com', models: ['MiniMax-H3'] },+ aliyun: { label: '阿里云百炼 Wan 3.0', baseUrl: 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com', models: ['wan3.0-video-prime', 'wan3.0-video'] },},}const huobaoQuickConfigs = [@@ -682,7 +683,8 @@ const huobaoQuickConfigs = [{ service_type: 'text', provider: 'openai', name: '火宝文本服务 · OpenAI', base_url: 'https://api.chatfire.site', model: ['deepseek-v4-pro', 'deepseek-v4-flash', 'gpt-5.6-terra'], priority: 101 },{ service_type: 'image', provider: 'openai', name: '火宝图片服务 · OpenAI', base_url: 'https://api.chatfire.site', model: ['gpt-image-2'], priority: 99 },{ service_type: 'image', provider: 'gemini', name: '火宝图片服务 · Gemini', base_url: 'https://api.chatfire.site', model: ['gemini-3-pro-image', 'gemini-3.1-flash-image'], priority: 97 },- { service_type: 'video', provider: 'volcengine', name: '火宝视频服务 · Seedance', base_url: 'https://api.chatfire.site/volcengine', model: ['doubao-seedance-2-0-fast-260128', 'doubao-seedance-2-0-260128', 'doubao-seedance-2-0-mini-260615'], priority: 98 },+ { service_type: 'video', provider: 'volcengine', name: '火宝视频服务 · Seedance', base_url: 'https://api.chatfire.site/volcengine', model: ['doubao-seedance-2-0-mini-260615', 'doubao-seedance-2-0-fast-260128', 'doubao-seedance-2-0-260128'], priority: 98 },+ { service_type: 'video', provider: 'aliyun', name: '火宝视频服务 · Wan 3.0', base_url: 'https://api.chatfire.site/qwen', model: ['wan3.0-video-prime', 'wan3.0-video'], priority: 97 },{ service_type: 'video', provider: 'minimax', name: '火宝视频服务 · MiniMax', base_url: 'https://api.chatfire.site/minimax', model: ['MiniMax-H3'], priority: 96 },]diff --git a/frontend/app/views/drama/episode.vue b/frontend/app/views/drama/episode.vueindex ccb0acf..4a2ee17 100644--- a/frontend/app/views/drama/episode.vue+++ b/frontend/app/views/drama/episode.vue@@ -45,6 +45,12 @@:default-label="t('episode.model.defaultWith', { model: videoModelOptions[0].model })":show-config="videoModelMultiCfg"/>+ <ModelSelect+ v-model="episodeResolution"+ :label="t('episode.topbar.resolution')"+ :options="resolutionOptions"+ hide-default+ /></div><div class="studio-actions"><LocaleSwitcher />@@ -698,9 +704,16 @@<svg v-else width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>{{ videoPromptBatch.running ? t('episode.sb.promptProgress', { done: videoPromptBatch.completed, total: videoPromptBatch.total }) : (selectedSbIds.length ? t('episode.sb.promptSelected', { n: selectedSbIds.length }) : t('episode.sb.batchPrompts')) }}</button>+ <button v-if="videoTaskFailedCount" class="btn btn-sm video-retry-failed" @click="retryFailedVideos">+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>+ {{ t('episode.vid.retryFailed', { n: videoTaskFailedCount }) }}+ </button>+ <button class="btn btn-sm" :class="{ 'is-on': videoSelectMode }" @click="toggleVideoSelectMode">+ {{ videoSelectMode ? t('episode.vid.selectDone', { n: selectedVideoSbIds.length }) : t('episode.vid.select') }}+ </button><button class="btn btn-sm" :disabled="!sbs.length" @click="batchVideos"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/></svg>- {{ t('episode.vid.batchVideos') }}+ {{ videoSelectMode && selectedVideoSbIds.length ? t('episode.vid.batchSelected', { n: selectedVideoSbIds.length }) : t('episode.vid.batchVideos') }}</button></div></div>@@ -722,26 +735,33 @@<div class="video-task-head"><div><div class="video-task-title">{{ t('episode.vid.listTitle') }}</div>- <div class="video-task-meta">{{ t('episode.vid.listMeta', { n: videoTaskRows.length }) }}</div>+ <div class="video-task-meta">{{ videoListFilter ? t('episode.vid.listMetaFiltered', { n: videoTaskRows.length, total: allVideoTaskRows.length }) : t('episode.vid.listMeta', { n: videoTaskRows.length }) }}</div></div><div class="video-task-metrics">- <span class="video-task-metric is-pending">{{ t('episode.vid.metricPending', { n: pendingVideoIds.length }) }}</span>- <span class="video-task-metric is-done">{{ t('episode.vid.metricDone', { n: videoTaskDoneCount }) }}</span>- <span class="video-task-metric is-failed">{{ t('episode.vid.metricFailed', { n: videoTaskFailedCount }) }}</span>+ <button type="button" class="video-task-metric is-pending" :class="{ on: videoListFilter === 'pending' }" @click="toggleVideoFilter('pending')">{{ t('episode.vid.metricPending', { n: pendingVideoIds.length }) }}</button>+ <button type="button" class="video-task-metric is-done" :class="{ on: videoListFilter === 'done' }" @click="toggleVideoFilter('done')">{{ t('episode.vid.metricDone', { n: videoTaskDoneCount }) }}</button>+ <button type="button" class="video-task-metric is-failed" :class="{ on: videoListFilter === 'failed' }" @click="toggleVideoFilter('failed')">{{ t('episode.vid.metricFailed', { n: videoTaskFailedCount }) }}</button></div></div><div class="video-task-table"><divv-for="task in videoTaskRows":key="task.id"- :class="['video-task-row', 'is-' + videoTaskState(task.storyboard), { active: selectedSb?.id === task.storyboard.id }]"+ :class="['video-task-row', 'is-' + videoTaskState(task.storyboard), { active: !videoSelectMode && selectedSb?.id === task.storyboard.id, 'is-selected': videoSelectMode && isVideoSbSelected(task.id) }]"role="button"tabindex="0"- @click="selectedSb = task.storyboard"- @keydown.enter.prevent="selectedSb = task.storyboard"- @keydown.space.prevent="selectedSb = task.storyboard"+ @click="onVideoTaskRowClick(task.storyboard)"+ @keydown.enter.prevent="onVideoTaskRowClick(task.storyboard)"+ @keydown.space.prevent="onVideoTaskRowClick(task.storyboard)"><div class="video-task-preview">+ <span+ v-if="videoSelectMode"+ class="shot-check video-task-check"+ :class="{ on: isVideoSbSelected(task.id) }"+ >+ <svg v-if="isVideoSbSelected(task.id)" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>+ </span><videov-if="hasVid(task.storyboard)":src="'/' + getVideoUrl(task.storyboard)"@@ -767,7 +787,10 @@<span class="video-task-sep">·</span><span>{{ t('episode.vid.references', { n: task.referenceCount }) }}</span></div>- <div v-if="task.error" class="video-task-error">{{ task.error }}</div>+ <div v-if="task.error" class="video-task-error">+ {{ task.error }}+ <div v-if="videoModerationHint(task.error)" class="video-task-error-hint">{{ videoModerationHint(task.error) }}</div>+ </div></div><span :class="['video-task-status', 'is-' + videoTaskState(task.storyboard)]"><span :class="['dot', videoTaskState(task.storyboard) === 'done' && 'ok', videoTaskState(task.storyboard) === 'pending' && 'pending']" />@@ -925,17 +948,17 @@</div><div class="video-ref-media-actions"><button type="button" class="btn btn-sm" :disabled="uploadingRefMedia || refImageFull" @click="uploadRefMedia('image')">- {{ t('episode.inspector.uploadRefImage', { used: refImageUsedCount }) }}+ {{ t('episode.inspector.uploadRefImage', { used: refImageUsedCount, limit: videoReferenceLimits.images }) }}</button>- <button type="button" class="btn btn-sm" :disabled="uploadingRefMedia || videoRefVideoUrls.length >= 3" @click="uploadRefMedia('video')">- {{ t('episode.inspector.uploadRefVideo', { used: videoRefVideoUrls.length }) }}+ <button type="button" class="btn btn-sm" :disabled="uploadingRefMedia || videoRefVideoUrls.length >= videoReferenceLimits.videos" @click="uploadRefMedia('video')">+ {{ t('episode.inspector.uploadRefVideo', { used: videoRefVideoUrls.length, limit: videoReferenceLimits.videos }) }}</button>- <button type="button" class="btn btn-sm" :disabled="uploadingRefMedia || videoRefAudioUrls.length >= 3" @click="uploadRefMedia('audio')">- {{ t('episode.inspector.uploadRefAudio', { used: videoRefAudioUrls.length }) }}+ <button type="button" class="btn btn-sm" :disabled="uploadingRefMedia || videoRefAudioUrls.length >= videoReferenceLimits.audios" @click="uploadRefMedia('audio')">+ {{ t('episode.inspector.uploadRefAudio', { used: videoRefAudioUrls.length, limit: videoReferenceLimits.audios }) }}</button></div><div- v-if="videoRefAudioUrls.length && !getShotReferenceImages(selectedSb).length && !videoRefVideoUrls.length"+ v-if="!isWan3Video && videoRefAudioUrls.length && !getShotReferenceImages(selectedSb).length && !videoRefVideoUrls.length"class="video-ref-media-hint">{{ t('episode.inspector.refAudioHint') }}</div></section>@@ -945,12 +968,23 @@<div class="video-param-row"><span class="video-param-name">{{ t('episode.inspector.duration') }}</span><span class="video-param-control">- <input v-model.number="videoDuration" type="number" min="4" max="15" class="input video-duration-input" />- <span class="video-param-unit">{{ t('episode.inspector.durationUnit') }}</span>+ <input+ :value="selectedSb.duration || 10"+ type="number"+ :min="isWan3Video ? 2 : 4"+ :max="isWan3Video ? 30 : 15"+ class="input video-duration-input"+ @change="onVideoDurationChange"+ />+ <span class="video-param-unit">{{ isWan3Video ? t('episode.inspector.durationUnitWan') : t('episode.inspector.durationUnit') }}</span></span></div>+ <div class="video-param-hint">{{ t('episode.inspector.durationHint') }}</div></section>+ <div class="video-inspector-effective">+ {{ t('episode.inspector.effective', { model: effectiveVideoModelLabel || t('episode.vid.defaultModel'), res: episodeResolutionLabel, dur: effectiveVideoDuration }) }}+ </div><buttonclass="btn btn-primary video-inspector-action":disabled="videoTaskState(selectedSb) === 'pending'"@@ -1165,7 +1199,10 @@<span class="video-task-sep">·</span><span>#{{ row.id }}</span></div>- <div v-if="row.errorMsg" class="video-task-error">{{ row.errorMsg }}</div>+ <div v-if="row.errorMsg" class="video-task-error">+ {{ row.errorMsg }}+ <div v-if="row.kind === 'video' && videoModerationHint(row.errorMsg)" class="video-task-error-hint">{{ videoModerationHint(row.errorMsg) }}</div>+ </div></div><span :class="['video-task-status', 'is-' + genTaskStateClass(row.status)]"><span :class="['dot', genTaskStateClass(row.status) === 'done' && 'ok', genTaskStateClass(row.status) === 'pending' && 'pending']" />@@ -1528,6 +1565,28 @@</div></div>+ <div v-if="batchVideoConfirm.open" class="overlay" @click.self="batchVideoConfirm.open = false">+ <div class="dialog batch-video-dialog">+ <header class="dialog-head">+ <h2 class="dialog-title">{{ t('episode.vid.confirmTitle') }}</h2>+ <button class="btn btn-ghost btn-icon" @click="batchVideoConfirm.open = false">+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>+ </button>+ </header>+ <div class="dialog-body batch-video-body">+ <div class="batch-video-row"><span>{{ t('episode.vid.confirmShots') }}</span><strong>{{ t('episode.vid.confirmShotsValue', { n: batchVideoConfirm.targets.length }) }}</strong></div>+ <div class="batch-video-row"><span>{{ t('episode.vid.confirmTotal') }}</span><strong>{{ t('episode.vid.confirmApprox', { n: batchVideoTotalDuration }) }}</strong></div>+ <div class="batch-video-row"><span>{{ t('episode.vid.confirmModel') }}</span><strong>{{ effectiveVideoModelLabel || t('episode.vid.defaultModel') }}</strong></div>+ <div class="batch-video-row"><span>{{ t('episode.vid.confirmResolution') }}</span><strong>{{ episodeResolutionLabel }}</strong></div>+ <p class="batch-video-note">{{ t('episode.vid.confirmNote') }}</p>+ </div>+ <footer class="dialog-foot">+ <button class="btn" @click="batchVideoConfirm.open = false">{{ t('common.cancel') }}</button>+ <button class="btn btn-primary" @click="confirmBatchVideos">{{ t('episode.vid.confirmStart', { n: batchVideoConfirm.targets.length }) }}</button>+ </footer>+ </div>+ </div>+<ConfirmDialog:open="assetDelete.open":title="t('episode.delete.title', { type: assetDeleteTypeLabel })"@@ -1674,7 +1733,6 @@ function closeTaskDrawer() {const videoRefVideoUrls = ref([])const videoRefAudioUrls = ref([])const videoRefImageUrls = ref([])-const videoDuration = ref(10)const uploadingRefMedia = ref(false)const imageViewer = ref({ open: false, src: '', title: '' })const activeMerge = ref(null) // 成片大预览弹窗中正在播放的拼接记录@@ -1997,6 +2055,13 @@ function videoFailMessage(id) {return failedVideoMessages.value[id] || ''}+// 内容审核类失败(真人/敏感内容,如火山的 OutputVideoSensitiveContentDetected):+// 各厂商审核尺度不同,给出切换模型重试的引导+const VIDEO_MODERATION_RE = /sensitive|moderation|真人|人脸|real[\s_-]?person|审核|内容.*(违规|不合规|未通过)|content[\s_-]?policy|risk[\s_-]?control|violation|blocked/i+function videoModerationHint(msg) {+ return VIDEO_MODERATION_RE.test(String(msg || '')) ? t('episode.vid.moderationHint') : ''+}+function videoTaskState(sb) {if (hasVid(sb)) return 'done'if (isPendingVideo(sb?.id)) return 'pending'@@ -2019,7 +2084,7 @@ function videoTaskActionLabel(sb) {return t('episode.asset.generate')}-const videoTaskRows = computed(() => sbs.value.map((sb, index) => {+const allVideoTaskRows = computed(() => sbs.value.map((sb, index) => {const duration = Number(sb.duration || 5)const referenceCount = getShotReferenceImages(sb).lengthconst sceneName = getSceneName(sb)@@ -2036,8 +2101,36 @@ const videoTaskRows = computed(() => sbs.value.map((sb, index) => {error: videoTaskState(sb) === 'failed' ? videoFailMessage(sb.id) : '',}}))-const videoTaskDoneCount = computed(() => videoTaskRows.value.filter(task => task.state === 'done').length)-const videoTaskFailedCount = computed(() => videoTaskRows.value.filter(task => task.state === 'failed').length)+// 列表筛选:点击顶部统计徽章过滤(再点一次取消)+const videoListFilter = ref('')+const videoTaskRows = computed(() => videoListFilter.value+ ? allVideoTaskRows.value.filter(task => task.state === videoListFilter.value)+ : allVideoTaskRows.value)+const videoTaskDoneCount = computed(() => allVideoTaskRows.value.filter(task => task.state === 'done').length)+const videoTaskFailedCount = computed(() => allVideoTaskRows.value.filter(task => task.state === 'failed').length)+function toggleVideoFilter(state) {+ videoListFilter.value = videoListFilter.value === state ? '' : state+}++// ===== 批量视频:选择模式 + 生成前确认(视频生成成本高,避免误触全量触发) =====+const videoSelectMode = ref(false)+const selectedVideoSbIds = ref([])+const batchVideoConfirm = ref({ open: false, targets: [] })++function isVideoSbSelected(id) { return selectedVideoSbIds.value.includes(id) }+function toggleVideoSbSelect(id) {+ selectedVideoSbIds.value = isVideoSbSelected(id)+ ? selectedVideoSbIds.value.filter(item => item !== id)+ : [...selectedVideoSbIds.value, id]+}+function toggleVideoSelectMode() {+ videoSelectMode.value = !videoSelectMode.value+ if (!videoSelectMode.value) selectedVideoSbIds.value = []+}+function onVideoTaskRowClick(sb) {+ if (videoSelectMode.value) toggleVideoSbSelect(sb.id)+ else selectedSb.value = sb+}// 旁白角色识别:按内容语言的关键词匹配(提取产物中的旁白角色不参与画面生成)function isNarratorCharacter(char) {@@ -2050,6 +2143,44 @@ const lockedImageConfigId = computed(() => episode.value?.image_config_id || epiconst lockedVideoConfigId = computed(() => episode.value?.video_config_id || episode.value?.videoConfigId || null)const lockedImageConfigLabel = computed(() => configLabel(imageConfigs.value.find(c => c.id === lockedImageConfigId.value)))const lockedVideoConfigLabel = computed(() => configLabel(videoConfigs.value.find(c => c.id === lockedVideoConfigId.value)))+// 集视频分辨率:顶栏直接修改(持久化 episodes.resolution,生成任务按此值锁定)。+// 内部统一存 480p/720p/1080p 三档,界面按当前选中的视频模型显示厂商原生档位+// (Seedance 480p/720p、MiniMax 768P/2K、Wan 3.0 480P/720P/1080P),适配器再映射为官方枚举+const RESOLUTION_TIERS = {+ volcengine: ['480p', '720p'],+ minimax: ['720p', '1080p'],+ aliyun: ['480p', '720p', '1080p'],+}+const RESOLUTION_DISPLAY = {+ volcengine: { '480p': '480p', '720p': '720p', '1080p': '720p' },+ minimax: { '480p': '768P', '720p': '768P', '1080p': '2K' },+ aliyun: { '480p': '480P', '720p': '720P', '1080p': '1080P' },+}+const resolutionProvider = computed(() => RESOLUTION_TIERS[selectedVideoConfig.value?.provider] ? selectedVideoConfig.value.provider : 'volcengine')+const resolutionOptions = computed(() => RESOLUTION_TIERS[resolutionProvider.value].map(key => ({+ key,+ model: `${RESOLUTION_DISPLAY[resolutionProvider.value][key]} · ${t(`episode.resolution.${key === '480p' ? 'smooth' : key === '720p' ? 'hd' : 'uhd'}`)}`,+})))+const episodeResolution = computed({+ get: () => {+ const v = episode.value?.resolution+ return resolutionOptions.value.some(o => o.key === v) ? v : '720p'+ },+ set: (val) => { void changeEpisodeResolution(val) },+})+async function changeEpisodeResolution(val) {+ if (!episode.value || val === episodeResolution.value) return+ const prev = episode.value.resolution+ episode.value.resolution = val+ const label = resolutionOptions.value.find(o => o.key === val)?.model || val+ try {+ await episodeAPI.update(epId.value, { resolution: val })+ toast.success(t('episode.vid.resolutionSwitched', { label }))+ } catch (e) {+ episode.value.resolution = prev+ toast.error(e.message)+ }+}// 画面比例在创建项目时固定,视频生成统一使用const dramaAspectRatio = computed(() => drama.value?.aspect_ratio || drama.value?.aspectRatio || '16:9')@@ -2091,6 +2222,64 @@ function hasMultiConfigs(options) {const textModelOptions = computed(() => collectModelOptions(textConfigs.value))const imageModelOptions = computed(() => collectModelOptions(imageConfigs.value))const videoModelOptions = computed(() => collectModelOptions(videoConfigs.value))+const selectedVideoConfig = computed(() => {+ const selected = videoModelOptions.value.find(option => option.key === videoModel.value)+ if (selected) return videoConfigs.value.find(config => config.id === selected.configId)+ const locked = videoConfigs.value.find(config => config.id === lockedVideoConfigId.value && config.is_active)+ if (locked) return locked+ return [...videoConfigs.value]+ .filter(config => config.is_active)+ .sort((a, b) => (b.priority || 0) - (a.priority || 0))[0]+})+const isWan3Video = computed(() => selectedVideoConfig.value?.provider === 'aliyun'+ || bareModelName(videoModel.value).startsWith('wan3.0-video'))+const videoReferenceLimits = computed(() => isWan3Video.value+ ? { images: 10, videos: 5, audios: 5 }+ : { images: 9, videos: 3, audios: 3 })++// 本次生成的生效配置(模型/分辨率/时长),用于右侧小结与批量确认弹窗+const effectiveVideoModelLabel = computed(() => {+ const explicit = bareModelName(videoModel.value)+ if (explicit) return explicit+ return configModels(selectedVideoConfig.value)[0] || ''+})+const episodeResolutionLabel = computed(() =>+ resolutionOptions.value.find(o => o.key === episodeResolution.value)?.model || episodeResolution.value)+const effectiveVideoDuration = computed(() => Number(selectedSb.value?.duration || 10))+const batchVideoTotalDuration = computed(() =>+ batchVideoConfirm.value.targets.reduce((sum, sb) => sum + (Number(sb.duration) || 5), 0))++function openBatchVideoConfirm(pool) {+ const targets = pool.filter(s => !isPendingVideo(s.id))+ if (!targets.length) { toast.info(t('episode.vid.noneToGenerate')); return }+ batchVideoConfirm.value = { open: true, targets }+}+function batchVideos() {+ // 选择模式且有勾选 → 仅所选(允许重出已完成镜头);否则全部未完成(待生成+失败)+ const useSelection = videoSelectMode.value && selectedVideoSbIds.value.length+ const pool = useSelection+ ? sbs.value.filter(s => selectedVideoSbIds.value.includes(s.id))+ : sbs.value.filter(s => !hasVid(s))+ openBatchVideoConfirm(pool)+}+function retryFailedVideos() {+ openBatchVideoConfirm(sbs.value.filter(s => videoTaskState(s) === 'failed'))+}+function confirmBatchVideos() {+ const targets = [...batchVideoConfirm.value.targets]+ batchVideoConfirm.value = { open: false, targets: [] }+ if (!targets.length) return+ const ids = targets.map(s => s.id)+ targets.forEach(sb => genVid(sb, { silent: true }))+ toast.success(t('episode.vid.batchStarted', { n: ids.length }))+ watchAsyncResult(() => ids.every(id => {+ const target = sbs.value.find(s => s.id === id)+ const done = !!getVideoUrl(target)+ if (done) pendingVideoIds.value = pendingVideoIds.value.filter(item => item !== id)+ return done+ }), 80, 4000)+ if (videoSelectMode.value) toggleVideoSelectMode()+}// 配置变化后校验持久化的模型是否仍存在(配置被删/模型被移除时回退默认,避免把失效模型传给后端)function pruneStaleModel(modelRef, optionsRef) {@@ -2606,6 +2795,7 @@ async function refresh() {try { propItems.value = await episodeAPI.props(ep.id) } catch { propItems.value = [] }sbs.value = await episodeAPI.storyboards(ep.id)selectedSbIds.value = selectedSbIds.value.filter(id => sbs.value.some(sb => sb.id === id))+ selectedVideoSbIds.value = selectedVideoSbIds.value.filter(id => sbs.value.some(sb => sb.id === id))if (sbs.value.length) {const currentSelectedId = selectedSb.value?.idselectedSb.value = sbs.value.find(sb => sb.id === currentSelectedId) || sbs.value[0]@@ -3185,9 +3375,9 @@ const autoReferenceImageCount = computed(() => {})// 已占用的参考图片数(场景/角色素材 + 手动上传),展示为 n/9-const refImageUsedCount = computed(() => Math.min(9, autoReferenceImageCount.value + videoRefImageUrls.value.length))+const refImageUsedCount = computed(() => Math.min(videoReferenceLimits.value.images, autoReferenceImageCount.value + videoRefImageUrls.value.length))// 是否已达 9 张上限(禁用继续上传)-const refImageFull = computed(() => refImageUsedCount.value >= 9)+const refImageFull = computed(() => refImageUsedCount.value >= videoReferenceLimits.value.images)// 视频提示词 @ 引用候选:仅当前分镜已绑定的角色与道具(按名字引用)、场景(按地点引用),展示顺序:角色 → 场景 → 道具// kind 为逻辑值(MentionTextarea 按 kind 着色/选图标),group 为显示文案@@ -3259,13 +3449,28 @@ function resolveVideoPromptRefs(sb) {}// 切换选中分镜时重置视频生成面板-watch(selectedSb, (sb) => {+// 切换选中分镜时重置视频生成面板(同一分镜刷新数据时保留面板编辑,不清掉已传参考)+watch(selectedSb, (sb, prev) => {+ if (sb?.id && sb.id === prev?.id) returnvideoRefVideoUrls.value = []videoRefAudioUrls.value = []videoRefImageUrls.value = []- videoDuration.value = Number(sb?.duration || 10)})+// 分镜时长(视频生成参数区直接编辑并保存到分镜):+// 按当前视频模型限制范围收敛后写入 storyboards.duration,列表/批量/单次生成统一读取该值+function onVideoDurationChange(e) {+ const sb = selectedSb.value+ if (!sb) return+ const min = isWan3Video.value ? 2 : 4+ const max = isWan3Video.value ? 30 : 15+ let v = Math.round(Number(e.target.value))+ if (!Number.isFinite(v)) v = Number(sb.duration || 10)+ v = Math.min(max, Math.max(min, v))+ e.target.value = v+ updateField(sb, 'duration', v)+}+function pickFile(accept, cb) {const input = document.createElement('input')input.type = 'file'@@ -3320,7 +3525,8 @@ function uploadRefMedia(kind) {const isVideo = kind === 'video'const list = isVideo ? videoRefVideoUrls : videoRefAudioUrlsconst label = isVideo ? t('common.serviceType.video') : t('episode.upload.audio')- if (list.value.length >= 3) { toast.info(t('episode.upload.refMax3', { type: label })); return }+ const limit = isVideo ? videoReferenceLimits.value.videos : videoReferenceLimits.value.audios+ if (list.value.length >= limit) { toast.info(t('episode.upload.refMax', { type: label, n: limit })); return }const accept = isVideo ? 'video/mp4,video/quicktime,video/webm,.m4v' : 'audio/mpeg,audio/wav,audio/mp4,.aac'pickFile(accept, async (file) => {uploadingRefMedia.value = true@@ -3337,22 +3543,25 @@ function removeRefMedia(kind, index) {list.value = list.value.filter((_, i) => i !== index)}-async function genVid(sb) {+async function genVid(sb, opts = {}) {const referenceImages = getShotReferenceImages(sb)+ // 面板上传的参考视频/音频只对当前选中的分镜生效;+ // 行内按钮或批量生成其他分镜时,只用分镜自身的 duration 与其绑定素材+ const isPanelTarget = sb.id === selectedSb.value?.idconst params = {storyboard_id: sb.id,drama_id: dramaId,prompt: resolveVideoPromptRefs(sb),- duration: Number(videoDuration.value || sb.duration || 10),+ duration: Number(sb.duration || 10),aspect_ratio: dramaAspectRatio.value,generate_audio: true,model: bareModelName(videoModel.value) || undefined,config_id: ownerConfigId(videoModelOptions.value, videoModel.value),reference_image_urls: referenceImages,- reference_video_urls: videoRefVideoUrls.value,- reference_audio_urls: videoRefAudioUrls.value,+ reference_video_urls: isPanelTarget ? videoRefVideoUrls.value : [],+ reference_audio_urls: isPanelTarget ? videoRefAudioUrls.value : [],}- if (params.reference_audio_urls.length && !referenceImages.length && !params.reference_video_urls.length) {+ if (!isWan3Video.value && params.reference_audio_urls.length && !referenceImages.length && !params.reference_video_urls.length) {toast.error(t('episode.upload.refAudioNeed'))return}@@ -3364,7 +3573,7 @@ async function genVid(sb) {delete failedVideoMessages.value[sb.id]if (!isPendingVideo(sb.id)) pendingVideoIds.value.push(sb.id)const generation = await taskAPI.generate({ type: 'video', ...params })- toast.success(t('episode.vid.generating'))+ if (!opts.silent) toast.success(t('episode.vid.generating'))await refresh()pollVideoGeneration(generation?.id, sb.id)} catch (e) {@@ -3373,7 +3582,8 @@ async function genVid(sb) {...failedVideoMessages.value,[sb.id]: e.message || t('episode.vid.genFailed'),}- toast.error(e.message)+ const hint = videoModerationHint(e.message)+ toast.error(hint ? `${e.message} — ${hint}` : e.message)}}async function pollVideoGeneration(generationId, storyboardId) {@@ -3399,11 +3609,13 @@ async function pollVideoGeneration(generationId, storyboardId) {}if (res?.status === 'failed') {pendingVideoIds.value = pendingVideoIds.value.filter(item => item !== storyboardId)+ const errMsg = res?.error_msg || res?.errorMsg || t('episode.vid.genFailed')failedVideoMessages.value = {...failedVideoMessages.value,- [storyboardId]: res?.error_msg || res?.errorMsg || t('episode.vid.genFailed'),+ [storyboardId]: errMsg,}- toast.error(failedVideoMessages.value[storyboardId])+ const hint = videoModerationHint(errMsg)+ toast.error(hint ? `${errMsg} — ${hint}` : errMsg)return}} catch {}@@ -3415,27 +3627,6 @@ async function pollVideoGeneration(generationId, storyboardId) {}toast.error(t('episode.vid.genTimeout'))}-function batchVideos() {- const missing = sbs.value.filter(s => !hasVid(s) && !isPendingVideo(s.id))- if (!missing.length) {- toast.info(t('episode.vid.allDone'))- return- }- const pendingIds = missing.map(s => s.id)- pendingIds.forEach(id => {- const sb = sbs.value.find(item => item.id === id)- if (sb) genVid(sb)- })- if (pendingIds.length) {- pendingVideoIds.value = [...new Set([...pendingVideoIds.value, ...pendingIds])]- watchAsyncResult(() => pendingIds.every(id => {- const target = sbs.value.find(s => s.id === id)- const done = !!getVideoUrl(target)- if (done) pendingVideoIds.value = pendingVideoIds.value.filter(item => item !== id)- return done- }), 80, 4000)- }-}async function doMerge(ids) {const storyboardIds = Array.isArray(ids) ? ids : undefinedif (storyboardIds && !storyboardIds.length) {@@ -5168,6 +5359,53 @@ onMounted(async () => { await refresh(); loadConfigs(); syncExtractStatus() })display: flex;flex-direction: column;}+/* 统计徽章兼作筛选器 */+button.video-task-metric { cursor: pointer; font-family: inherit; transition: box-shadow 0.15s; }+button.video-task-metric:hover { box-shadow: 0 0 0 2px var(--sel-glow, rgba(0,113,227,0.15)); }+button.video-task-metric.on { box-shadow: 0 0 0 2px var(--accent, #0071e3); }+/* 批量视频:选择模式 */+.btn.is-on { border-color: var(--accent); color: var(--accent-text, var(--accent)); background: var(--accent-bg, rgba(0,113,227,0.10)); }+.video-retry-failed { color: var(--warning); border-color: rgba(255,159,10,0.4); }+.video-task-row.is-selected { background: var(--sel-bg); box-shadow: inset 0 0 0 1.5px var(--sel); }+.video-task-check {+ position: absolute;+ top: 5px;+ right: 5px;+ z-index: 2;+ background: rgba(0,0,0,0.45);+ border-color: rgba(255,255,255,0.55);+}+.video-task-check.on { background: var(--accent); border-color: var(--accent); }+/* 生成前生效配置小结 */+.video-param-hint { margin-top: 6px; font-size: 10px; color: var(--text-3); }+.video-inspector-effective {+ margin-top: 10px;+ font-size: 11px;+ color: var(--text-3);+ text-align: center;+}+/* 审核失败引导 */+.video-task-error-hint {+ margin-top: 3px;+ color: var(--accent-text, var(--accent));+ font-weight: 600;+}+/* 批量生成确认弹窗 */+.batch-video-dialog { width: 420px; max-width: calc(100vw - 48px); }+.batch-video-body { display: flex; flex-direction: column; gap: 10px; }+.batch-video-row {+ display: flex;+ justify-content: space-between;+ align-items: center;+ font-size: 13px;+ color: var(--text-2);+ padding: 8px 12px;+ border: 1px solid var(--surface-outline);+ border-radius: var(--radius);+ background: var(--bg-input, rgba(0,0,0,0.02));+}+.batch-video-row strong { color: var(--text-0); font-weight: 600; }+.batch-video-note { margin: 4px 0 0; font-size: 11px; color: var(--text-3); line-height: 1.6; }.video-task-row {display: grid;grid-template-columns: 84px minmax(0, 1fr) auto auto;diff --git a/frontend/tests/official-provider-settings.test.mjs b/frontend/tests/official-provider-settings.test.mjsindex f0daa5f..84e2a6a 100644--- a/frontend/tests/official-provider-settings.test.mjs+++ b/frontend/tests/official-provider-settings.test.mjs@@ -28,10 +28,11 @@ test('settings page exposes official provider templates only', () => {assert.doesNotMatch(useApi, /huobaoPreset/i)assert.doesNotMatch(useApi, /\/huobao-preset/)- assert.match(settingsPage, /const providers = \['gemini', 'openai', 'volcengine'\]/)+ assert.match(settingsPage, /const providers = \['gemini', 'openai', 'volcengine', 'minimax', 'aliyun'\]/)assert.match(settingsPage, /https:\/\/generativelanguage\.googleapis\.com/)assert.match(settingsPage, /https:\/\/api\.openai\.com/)assert.match(settingsPage, /https:\/\/ark\.cn-beijing\.volces\.com/)+ assert.match(settingsPage, /https:\/\/\{WorkspaceId\}\.cn-beijing\.maas\.aliyuncs\.com/)assert.doesNotMatch(settingsPage, /https:\/\/api\.deepseek\.com/)assert.doesNotMatch(settingsPage, /https:\/\/dashscope\.aliyuncs\.com/)assert.doesNotMatch(settingsPage, /https:\/\/api\.vidu\.com/)@@ -54,7 +55,9 @@ test('settings page offers official default model IDs', () => {assert.match(settingsPage, /doubao-seedance-2-0-260128/)assert.match(settingsPage, /doubao-seedance-2-0-fast-260128/)assert.match(settingsPage, /doubao-seedance-2-0-mini-260615/)- assert.doesNotMatch(settingsPage, /deepseek-v4-pro/)+ assert.match(settingsPage, /wan3\.0-video-prime/)+ assert.match(settingsPage, /wan3\.0-video/)+ assert.match(settingsPage, /deepseek-v4-pro/)assert.doesNotMatch(settingsPage, /gpt-5\.4/)assert.doesNotMatch(settingsPage, /doubao-seed-1-6/)assert.doesNotMatch(settingsPage, /wan2\.6-t2i/)@@ -74,10 +77,22 @@ test('only text service configs expose the connection test button', () => {assert.match(settingsPage, /v-if="st\.type === 'text'" class="btn btn-ghost btn-sm" @click="testExistingCfg\(c\)">测试/)})-test('settings page only offers openai, gemini and volcengine presets', () => {- assert.doesNotMatch(providerPresetBlock('text'), /deepseek|minimax/i)+test('settings page offers the supported official provider presets', () => {+ assert.match(providerPresetBlock('text'), /deepseek-v4-pro/)+ assert.doesNotMatch(providerPresetBlock('text'), /minimax/i)assert.doesNotMatch(providerPresetBlock('image'), /'ali'|minimax/i)- assert.doesNotMatch(providerPresetBlock('video'), /'ali'|'vidu'|minimax/i)assert.match(providerPresetBlock('video'), /volcengine/)+ assert.match(providerPresetBlock('video'), /minimax/)+ assert.match(providerPresetBlock('video'), /aliyun/)+ assert.doesNotMatch(providerPresetBlock('video'), /'vidu'/i)assert.doesNotMatch(settingsPage, /audio:\s*\{/)})++test('Huobao quick config includes Wan 3.0 through the Qwen gateway route', () => {+ const quickStart = settingsPage.indexOf('const huobaoQuickConfigs = [')+ assert.notEqual(quickStart, -1)+ const quickConfigs = settingsPage.slice(quickStart, settingsPage.indexOf('\n]', quickStart) + 2)+ assert.match(quickConfigs, /provider:\s*'aliyun'/)+ assert.match(quickConfigs, /base_url:\s*'https:\/\/api\.chatfire\.site\/qwen'/)+ assert.match(quickConfigs, /model:\s*\['wan3\.0-video-prime', 'wan3\.0-video'\]/)+})diff --git a/frontend/tests/video-direct-generation-config.test.mjs b/frontend/tests/video-direct-generation-config.test.mjsindex 2c15f1a..6446e17 100644--- a/frontend/tests/video-direct-generation-config.test.mjs+++ b/frontend/tests/video-direct-generation-config.test.mjs@@ -21,6 +21,13 @@ test('video presets use official provider endpoints', () => {const providerPresets = settingsPage.slice(presetsStart, quickStart)assert.doesNotMatch(providerPresets, /api\.chatfire\.site/)assert.match(settingsPage, /https:\/\/ark\.cn-beijing\.volces\.com/)+ assert.match(providerPresets, /https:\/\/\{WorkspaceId\}\.cn-beijing\.maas\.aliyuncs\.com/)assert.doesNotMatch(settingsPage, /https:\/\/dashscope\.aliyuncs\.com/)assert.doesNotMatch(settingsPage, /https:\/\/api\.vidu\.com/)})++test('Wan 3.0 quick preset targets the Qwen gateway namespace', () => {+ const quickStart = settingsPage.indexOf('const huobaoQuickConfigs = [')+ const quickConfigs = settingsPage.slice(quickStart)+ assert.match(quickConfigs, /provider:\s*'aliyun'.*base_url:\s*'https:\/\/api\.chatfire\.site\/qwen'.*wan3\.0-video-prime.*wan3\.0-video/s)+})