2025-08-19 14:33:59 +08:00
|
|
|
|
import { ImageGenerateMode, MJRobotType, MJSpeed } from '../data/mjData'
|
|
|
|
|
|
import { JianyingKeyFrameEnum } from '../enum/jianyingEnum'
|
|
|
|
|
|
|
|
|
|
|
|
declare namespace SettingModal {
|
|
|
|
|
|
//#region 基础设置
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 通用设置接口
|
|
|
|
|
|
* 定义应用程序的常规设置项
|
|
|
|
|
|
*/
|
|
|
|
|
|
export interface GeneralSettings {
|
|
|
|
|
|
/** 剪映草稿箱路径 */
|
|
|
|
|
|
draftPath: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 项目保存路径 */
|
|
|
|
|
|
projectPath: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 系统并发数 (1-16) */
|
|
|
|
|
|
concurrency: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 默认生图方式 */
|
|
|
|
|
|
defaultImgGenMethod: ImageCategory
|
|
|
|
|
|
|
|
|
|
|
|
/** 高清倍数 (1-4) */
|
|
|
|
|
|
hdScale: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 默认图转视频方式 */
|
|
|
|
|
|
defaultImg2Video: ImageToVideoCategory
|
|
|
|
|
|
|
|
|
|
|
|
/** 系统语言 */
|
|
|
|
|
|
language: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//#region MJ设置
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Midjourney 通用设置接口
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface MJGeneralSettings {
|
|
|
|
|
|
/** 出图模式 */
|
|
|
|
|
|
outputMode: ImageGenerateMode
|
|
|
|
|
|
|
|
|
|
|
|
/** 生图机器人类型 */
|
|
|
|
|
|
robot: MJRobotType
|
|
|
|
|
|
|
|
|
|
|
|
/** 机器人模型ID */
|
|
|
|
|
|
model: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 生图尺寸ID */
|
|
|
|
|
|
size: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 命令后缀 */
|
|
|
|
|
|
commandSuffix: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 生图任务量 (1-10) */
|
|
|
|
|
|
taskCount: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 间隔时间(秒) */
|
|
|
|
|
|
interval: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Midjourney API 设置接口
|
|
|
|
|
|
* 定义了与 MJ API 相关的配置参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface MJApiSettings {
|
|
|
|
|
|
/** API 服务地址 */
|
|
|
|
|
|
apiUrl: string
|
|
|
|
|
|
|
|
|
|
|
|
/** API 密钥/授权令牌 */
|
|
|
|
|
|
apiKey: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 出图速度设置
|
|
|
|
|
|
* 可选值通常为"fast"(快速)或"relaxed"(慢速)
|
|
|
|
|
|
*/
|
|
|
|
|
|
apiSpeed: MJSpeed
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-04 16:58:42 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Midjourney 生图包设置接口
|
|
|
|
|
|
* 定义了与 MJ 生图包相关的配置参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface MJPackageSetting {
|
|
|
|
|
|
/** 选择的生图包类型 */
|
|
|
|
|
|
selectPackage: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 生图包访问令牌 */
|
|
|
|
|
|
packageToken: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 代理模式配置数据模型
|
|
|
|
|
|
* 定义了远程 MJ 账号的详细配置信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface RemoteMJAccountModel {
|
|
|
|
|
|
/** 账号唯一标识符 */
|
|
|
|
|
|
id?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 账号ID */
|
|
|
|
|
|
accountId?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 频道ID */
|
|
|
|
|
|
channelId?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 核心线程数 */
|
|
|
|
|
|
coreSize: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 服务器ID */
|
|
|
|
|
|
guildId?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否启用该账号 */
|
|
|
|
|
|
enable: boolean
|
|
|
|
|
|
|
|
|
|
|
|
/** MJ机器人频道ID */
|
|
|
|
|
|
mjBotChannelId?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** Niji机器人频道ID */
|
|
|
|
|
|
nijiBotChannelId?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 队列大小 */
|
|
|
|
|
|
queueSize: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 超时时间(分钟) */
|
|
|
|
|
|
timeoutMinutes: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 用户代理字符串 */
|
|
|
|
|
|
userAgent: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 用户令牌 */
|
|
|
|
|
|
userToken?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 创建时间 */
|
|
|
|
|
|
createTime?: Date
|
|
|
|
|
|
|
|
|
|
|
|
/** 更新时间 */
|
|
|
|
|
|
updateTime?: Date
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Midjourney 代理模式设置接口
|
|
|
|
|
|
* 定义了与 MJ 代理模式相关的配置参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface MJRemoteSetting {
|
|
|
|
|
|
/** 是否国内转发 */
|
|
|
|
|
|
isForward: boolean
|
|
|
|
|
|
|
|
|
|
|
|
/** 账号列表 */
|
|
|
|
|
|
accountList: Array<RemoteMJAccountModel>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Midjourney 本地代理模式设置接口
|
|
|
|
|
|
* 定义了与 MJ 本地代理模式相关的配置参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface MJLocalSetting {
|
|
|
|
|
|
/** 服务地址 */
|
|
|
|
|
|
requestUrl: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 访问令牌 */
|
|
|
|
|
|
token: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 账号列表 */
|
|
|
|
|
|
accountList: Array<RemoteMJAccountModel>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-19 14:33:59 +08:00
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//#region AI推理设置
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* AI 推理设置接口
|
|
|
|
|
|
* 定义了用于 AI 推理和翻译的配置参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface InferenceAISettings {
|
|
|
|
|
|
/** API 服务提供商标识 */
|
|
|
|
|
|
apiProvider: string
|
|
|
|
|
|
|
|
|
|
|
|
/** API 访问令牌/密钥 */
|
|
|
|
|
|
apiToken: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 推理模型名称
|
|
|
|
|
|
* 例如: 'deepseek-chat', 'gpt-4', 'claude-3-opus' 等
|
|
|
|
|
|
*/
|
|
|
|
|
|
inferenceModel: string
|
|
|
|
|
|
|
|
|
|
|
|
/** AI 提示词值 - 用于生成图像的提示内容 */
|
|
|
|
|
|
aiPromptValue: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 翻译模型名称
|
|
|
|
|
|
* 例如: 'Doubao-lite-32k', 'gpt-3.5-turbo' 等
|
|
|
|
|
|
*/
|
|
|
|
|
|
translationModel: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//#region SD设置
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Stable Diffusion 设置接口
|
|
|
|
|
|
* 定义了 SD 生成图像所需的所有参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface SDSettings {
|
|
|
|
|
|
/** SD API服务器请求地址 */
|
|
|
|
|
|
requestUrl: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 出图方式: 'txt2img' (文生图) 或 'img2img' (图生图) */
|
|
|
|
|
|
generationMethod: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 正向提示词 - 描述你希望生成的图像内容 */
|
|
|
|
|
|
positivePrompt: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 反向提示词 - 描述你希望避免的图像内容 */
|
|
|
|
|
|
negativePrompt: string
|
|
|
|
|
|
|
|
|
|
|
|
/** CFG Scale - 提示词相关性权重 (1-20) */
|
|
|
|
|
|
cfgScale: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 单次出图张数 (1-6) */
|
|
|
|
|
|
batchCount: number
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 种子值
|
|
|
|
|
|
* -1表示随机种子,指定具体数值可复现相同结果
|
|
|
|
|
|
*/
|
|
|
|
|
|
seed: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 重绘幅度 (0-1) - 在图生图模式下影响保留原图程度 */
|
|
|
|
|
|
denoisingStrength: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 采样方式 - 如 'DPM++ SDE Karras', 'Euler a' 等 */
|
|
|
|
|
|
sampler: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 迭代步数 (1-150) - 影响生成质量和时间 */
|
|
|
|
|
|
steps: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 生成图片宽度 (像素) */
|
|
|
|
|
|
width: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 生成图片高度 (像素) */
|
|
|
|
|
|
height: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否启用修脸/修手功能 */
|
|
|
|
|
|
faceHandFix: boolean
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ADetailer 模型接口
|
|
|
|
|
|
* 定义了 ADetailer 插件使用的模型及其设置
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface SDADetailerModel {
|
|
|
|
|
|
/** 模型唯一标识符 */
|
|
|
|
|
|
id: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 模型文件名称
|
|
|
|
|
|
* 例如: 'face_yolov8n.pt', 'hand_yolov8n.pt' 等
|
|
|
|
|
|
*/
|
|
|
|
|
|
model: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 识别信任度
|
|
|
|
|
|
* 范围通常为 10-100 的整数值,表示百分比
|
|
|
|
|
|
* 数值越高,模型识别越严格
|
|
|
|
|
|
*/
|
|
|
|
|
|
threshold: number
|
|
|
|
|
|
}
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//#region 剪映关键帧设置
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 剪映关键帧设置接口
|
|
|
|
|
|
* 定义了剪映视频编辑中关键帧的设置项
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface JianyingKeyFrameSettings {
|
|
|
|
|
|
keyFrame: JianyingKeyFrameEnum
|
|
|
|
|
|
isFixedSpeed: boolean
|
|
|
|
|
|
keyFrameTime: number
|
|
|
|
|
|
upDownKeyFrame: {
|
|
|
|
|
|
defaultScale: number
|
|
|
|
|
|
startPosition: number
|
|
|
|
|
|
endPosition: number
|
|
|
|
|
|
}
|
|
|
|
|
|
leftRightKeyFrame: {
|
|
|
|
|
|
defaultScale: number
|
|
|
|
|
|
startPosition: number
|
|
|
|
|
|
endPosition: number
|
|
|
|
|
|
}
|
|
|
|
|
|
scaleKeyFrame: {
|
|
|
|
|
|
defaultScale: number
|
|
|
|
|
|
startPosition: number
|
|
|
|
|
|
endPosition: number
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
2025-09-04 16:58:42 +08:00
|
|
|
|
|
|
|
|
|
|
//#region Comfy UI 设置
|
|
|
|
|
|
|
|
|
|
|
|
/** ComfyUI的基础设置的模型 */
|
|
|
|
|
|
interface ComfyUISimpleSettingModel {
|
|
|
|
|
|
/** 请求地址 */
|
|
|
|
|
|
requestUrl: string
|
|
|
|
|
|
/** 选择的工作流 */
|
|
|
|
|
|
selectedWorkflow?: string
|
|
|
|
|
|
/** 反向提示词 */
|
|
|
|
|
|
negativePrompt?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** ComfyUI 工作流设置的模型 */
|
|
|
|
|
|
interface ComfyUIWorkFlowSettingModel {
|
|
|
|
|
|
/** 设置的ID */
|
|
|
|
|
|
id: string
|
|
|
|
|
|
/** 自定义的名字 */
|
|
|
|
|
|
name: string
|
|
|
|
|
|
/** 工作流的地址 */
|
|
|
|
|
|
workflowPath: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ComfyUI的设置集合
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface ComfyUISettingCollection {
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ComfyUI的基础设置
|
|
|
|
|
|
*/
|
|
|
|
|
|
comfyuiSimpleSetting: ComfyUISimpleSettingModel
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ComfyUI的工作流集合
|
|
|
|
|
|
*/
|
|
|
|
|
|
comfyuiWorkFlowSetting: Array<ComfyUIWorkFlowSettingModel>
|
|
|
|
|
|
|
|
|
|
|
|
/*** 当前选中的工作流 */
|
|
|
|
|
|
comfyuiSelectedWorkflow: ComfyUIWorkFlowSettingModel
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//#region 文案处理设置
|
|
|
|
|
|
|
|
|
|
|
|
/** 文案处理API设置 */
|
|
|
|
|
|
interface CopyWritingAPISettings {
|
|
|
|
|
|
/** 文案处理模型 */
|
|
|
|
|
|
model: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 文案处理API地址 */
|
|
|
|
|
|
gptUrl: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 文案处理API密钥 */
|
|
|
|
|
|
apiKey: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface CopyWritingSimpleSettings {
|
|
|
|
|
|
/** GPT 类型 */
|
|
|
|
|
|
gptType: string | undefined
|
|
|
|
|
|
|
|
|
|
|
|
/** GPT 数据 */
|
|
|
|
|
|
gptData: string | undefined
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否启用流式输出 */
|
|
|
|
|
|
isStream: boolean
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否启用分割 */
|
|
|
|
|
|
isSplit: boolean
|
|
|
|
|
|
|
|
|
|
|
|
/** 分割数量 */
|
|
|
|
|
|
splitNumber?: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 原始文本 */
|
|
|
|
|
|
oldWord?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 新文本 */
|
|
|
|
|
|
newWord?: string
|
|
|
|
|
|
|
|
|
|
|
|
/** 原始文本字数 */
|
|
|
|
|
|
oldWordCount?: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 新文本字数 */
|
|
|
|
|
|
newWordCount?: number
|
|
|
|
|
|
|
|
|
|
|
|
/** 文本结构数组 */
|
|
|
|
|
|
wordStruct: CopyWritingSimpleSettingsWordStruct[]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 文案处理数据的数据格式数据类型
|
|
|
|
|
|
*/
|
|
|
|
|
|
interface CopyWritingSimpleSettingsWordStruct {
|
|
|
|
|
|
/** ID */
|
|
|
|
|
|
id: string
|
|
|
|
|
|
/** AI改写前的文案 */
|
|
|
|
|
|
oldWord: string | undefined
|
|
|
|
|
|
/** AI输出的文案 */
|
|
|
|
|
|
newWord: string | undefined
|
|
|
|
|
|
/** AI改写前的文案的字数 */
|
|
|
|
|
|
oldWordCount: number
|
|
|
|
|
|
/** AI输出的文案的字数 */
|
|
|
|
|
|
newWordCount: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
2025-08-19 14:33:59 +08:00
|
|
|
|
}
|