功能增加
This commit is contained in:
1 parent
b340fc7ad7
commit
f1993eb388
69 files changed
+2243
-162
No files matched your search
@@ -9,6 +9,7 @@ import { rootDir } from "@/lib/server/runtime";
|
||||
import { getVisualClientConfig } from "@/lib/volcengine/visual-client";
|
||||
import type { EnabledImageCapability } from "@/lib/types";
|
||||
import { getBailianConfig } from "@/lib/bailian/client";
|
||||
import { getMinimaxConfig, MINIMAX_H3_MODEL } from "@/lib/minimax/client";
|
||||
|
||||
type SettingsImageCreationEngine = ImageCreationEngine | "seedream";
|
||||
const SEEDREAM_50_PRO_MODEL = "doubao-seedream-5-0-pro-260628";
|
||||
@@ -132,6 +133,15 @@ const settingDefinitions: Array<{
|
||||
{ key: "BAILIAN_VIDEO_MODEL", label: "视频模型", defaultValue: "wan2.7-i2v-2026-04-25" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "minimax",
|
||||
title: "MiniMax API",
|
||||
description: "用于 MiniMax H3 文生视频与单首帧图生视频。",
|
||||
fields: [
|
||||
{ key: "MINIMAX_API_KEY", label: "MiniMax API Key", secret: true, type: "password" },
|
||||
{ key: "MINIMAX_BASE_URL", label: "Base URL", defaultValue: "https://api.minimax.cn" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "oss",
|
||||
title: "OSS 资产存储",
|
||||
@@ -166,6 +176,7 @@ const engineFieldDefinitions: FieldDefinition[] = [
|
||||
defaultValue: "bailian",
|
||||
options: [
|
||||
{ label: "Seedance", value: "seedance" },
|
||||
{ label: "MiniMax H3", value: "minimax" },
|
||||
{ label: "阿里云百炼 Wan 2.7", value: "bailian" }
|
||||
]
|
||||
},
|
||||
@@ -199,6 +210,7 @@ export async function getApiSettings() {
|
||||
seedance: Boolean(seedance.apiKey),
|
||||
seedream: Boolean(seedance.apiKey),
|
||||
bailian: Boolean(getBailianConfig().apiKey),
|
||||
minimax: Boolean(getMinimaxConfig().apiKey),
|
||||
auth: authConfigSummary(auth) === "configured",
|
||||
organization: platformAccountStoreConfigured()
|
||||
},
|
||||
@@ -254,9 +266,12 @@ function buildEngineAssignments(fileEnv: Map<string, string>): EngineAssignment[
|
||||
const evolink = getEvolinkImageSettings();
|
||||
const seedance = getSeedanceConfig();
|
||||
const bailian = getBailianConfig();
|
||||
const minimax = getMinimaxConfig();
|
||||
const generateEngine = currentEngineValue(engineFieldDefinitions[0], fileEnv);
|
||||
const videoEngine = currentVideoEngineValue(engineFieldDefinitions[1], fileEnv);
|
||||
const videoConnected = videoEngine === "bailian" ? Boolean(bailian.apiKey) : Boolean(seedance.apiKey);
|
||||
const videoConnected = videoEngine === "bailian"
|
||||
? Boolean(bailian.apiKey)
|
||||
: videoEngine === "minimax" ? Boolean(minimax.apiKey) : Boolean(seedance.apiKey);
|
||||
|
||||
return [
|
||||
imageEngineAssignment({
|
||||
@@ -271,10 +286,10 @@ function buildEngineAssignments(fileEnv: Map<string, string>): EngineAssignment[
|
||||
id: "video.generate",
|
||||
label: "视频生成",
|
||||
engine: videoEngine,
|
||||
engineLabel: videoEngine === "bailian" ? "阿里云百炼" : "Seedance",
|
||||
engineLabel: videoEngine === "bailian" ? "阿里云百炼" : videoEngine === "minimax" ? "MiniMax H3" : "Seedance",
|
||||
connected: videoConnected,
|
||||
connectionLabel: videoConnected ? "已连接" : "待配置",
|
||||
reqKey: videoEngine === "bailian" ? bailian.videoModel : seedance.model,
|
||||
reqKey: videoEngine === "bailian" ? bailian.videoModel : videoEngine === "minimax" ? MINIMAX_H3_MODEL : seedance.model,
|
||||
configurable: true,
|
||||
field: fieldWithValue(engineFieldDefinitions[1], videoEngine, isConfigured(engineFieldDefinitions[1].key, fileEnv))
|
||||
}
|
||||
@@ -339,7 +354,9 @@ function imageEngineConnected(engine: SettingsImageCreationEngine) {
|
||||
}
|
||||
|
||||
function currentVideoEngineValue(field: FieldDefinition, fileEnv: Map<string, string>) {
|
||||
return (process.env[field.key] ?? fileEnv.get(field.key) ?? field.defaultValue) === "bailian" ? "bailian" : "seedance";
|
||||
const value = (process.env[field.key] ?? fileEnv.get(field.key) ?? field.defaultValue)?.trim().toLowerCase();
|
||||
if (value === "bailian" || value === "minimax") return value;
|
||||
return "seedance";
|
||||
}
|
||||
|
||||
function envFilePath() {
|
||||
|
||||
Reference in new issue
Block a user