feat(model): enhance model configuration and script handling for audio and video capabilities

This commit is contained in:
HouYunFei
2026-07-15 10:13:32 +08:00
parent a4dcc679c9
commit c57f7d61a7
13 changed files with 690 additions and 266 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import { imageAspectOptions, imageQualityOptions } from "@/components/image-sett
import { videoResolutionOptions, videoSecondOptions, videoSizeOptions } from "@/components/video-settings-panel";
import { useCanvasStore } from "@/stores/canvas/use-canvas-store";
import { useAssetStore } from "@/stores/use-asset-store";
import { modelOptionLabel, modelOptionName, normalizeModelOptionValue, useConfigStore } from "@/stores/use-config-store";
import { modelOptionLabel, modelOptionName, normalizeModelOptionValue, selectableModelsByCapability, useConfigStore } from "@/stores/use-config-store";
import { useWorkbenchAgentStore } from "@/stores/use-workbench-agent-store";
// 在网页端执行 Agent 的「站点级」工具(画布列表、工作台生成、提示词搜索、素材增删查等)。
@@ -87,7 +87,7 @@ function getImageConfig() {
const model = config.imageModel || config.model;
return {
current: { model, modelName: modelOptionName(model), quality: config.quality || "auto", size: config.size || "1:1", count: config.count || "1" },
models: config.imageModels.map((value) => ({ value, label: modelOptionLabel(config, value) })),
models: selectableModelsByCapability(config, "image").map((value) => ({ value, label: modelOptionLabel(config, value) })),
qualityOptions: imageQualityOptions,
sizeOptions: imageAspectOptions,
countRange: { min: 1, max: 15 },
@@ -135,7 +135,7 @@ function getVideoConfig() {
generateAudio: config.videoGenerateAudio !== "false",
watermark: config.videoWatermark === "true",
},
models: config.videoModels.map((value) => ({ value, label: modelOptionLabel(config, value) })),
models: selectableModelsByCapability(config, "video").map((value) => ({ value, label: modelOptionLabel(config, value) })),
sizeOptions: videoSizeOptions,
secondsOptions: videoSecondOptions,
resolutionOptions: videoResolutionOptions,