feat(ai): 升级AI生图模型及多视角一致性支持
- 将默认AI生图模型升级为flux-dev及seedream-5.0版本 - SiliconFlow模型由FLUX.1-dev切换为Kolors,优化调用参数和返回值 - 火山引擎Seedream升级至5.0 lite版本,支持多视角参考图传入 - 设计图片字段由字符串改为Text扩展URL长度限制 - 设计图下载支持远程URL重定向和本地文件兼容 - 生成AI图片时多视角保持风格一致,SiliconFlow复用seed,Seedream传参考图 - 后台配置界面更改模型名称及价格显示,新增API Key状态检测 - 前端照片下载从链接改为按钮,远程文件新窗口打开 - 设计相关接口支持较长请求超时,下载走API路径无/api前缀 - 前端页面兼容驼峰与下划线格式URL参数识别 - 用户中心设计图下载支持本地文件Token授权下载 - 初始化数据库新增完整表结构与约束,适配新版设计业务逻辑
This commit is contained in:
@@ -10,18 +10,18 @@
|
||||
@click="setDefaultModel('flux-dev')"
|
||||
>
|
||||
<div class="model-badge">默认</div>
|
||||
<div class="model-name">SiliconFlow FLUX.1 [dev]</div>
|
||||
<div class="model-price">~0.13 元/张</div>
|
||||
<div class="model-name">SiliconFlow Kolors</div>
|
||||
<div class="model-price">~0.04 元/张</div>
|
||||
<div class="model-tag">性价比高</div>
|
||||
</div>
|
||||
<div
|
||||
class="model-option"
|
||||
:class="{ active: defaultModel === 'seedream-4.5' }"
|
||||
@click="setDefaultModel('seedream-4.5')"
|
||||
:class="{ active: defaultModel === 'seedream-5.0' }"
|
||||
@click="setDefaultModel('seedream-5.0')"
|
||||
>
|
||||
<div class="model-badge">备选</div>
|
||||
<div class="model-name">火山引擎 Seedream 4.5</div>
|
||||
<div class="model-price">~0.30 元/张</div>
|
||||
<div class="model-name">火山引擎 Seedream 5.0 lite</div>
|
||||
<div class="model-price">~0.04 元/张</div>
|
||||
<div class="model-tag">高质量</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,12 +31,12 @@
|
||||
<div class="section-card">
|
||||
<div class="card-header">
|
||||
<div class="card-title-row">
|
||||
<h3 class="section-title">SiliconFlow FLUX.1 [dev]</h3>
|
||||
<h3 class="section-title">SiliconFlow Kolors</h3>
|
||||
<el-tag :type="siliconflowStatus" size="small">
|
||||
{{ siliconflowStatusText }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<p class="card-desc">硅基流动文生图 API,基于 FLUX.1 开源模型,性价比高</p>
|
||||
<p class="card-desc">硅基流动文生图 API,基于 Kolors 开源模型,性价比高</p>
|
||||
</div>
|
||||
<el-form label-width="120px" class="config-form">
|
||||
<el-form-item label="API Key">
|
||||
@@ -66,12 +66,12 @@
|
||||
<div class="section-card">
|
||||
<div class="card-header">
|
||||
<div class="card-title-row">
|
||||
<h3 class="section-title">火山引擎 Seedream 4.5</h3>
|
||||
<h3 class="section-title">火山引擎 Seedream 5.0 lite</h3>
|
||||
<el-tag :type="volcengineStatus" size="small">
|
||||
{{ volcengineStatusText }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<p class="card-desc">字节跳动火山引擎文生图 API,Seedream 4.5 模型,高质量输出</p>
|
||||
<p class="card-desc">字节跳动火山引擎文生图 API,Seedream 5.0 lite 模型,支持中英文提示词,高质量输出</p>
|
||||
</div>
|
||||
<el-form label-width="120px" class="config-form">
|
||||
<el-form-item label="API Key">
|
||||
@@ -136,17 +136,21 @@ const volcengineUrl = ref('https://ark.cn-beijing.volces.com/api/v3')
|
||||
const imageSize = ref('1024')
|
||||
const saving = ref(false)
|
||||
|
||||
// 后端是否已配置 API Key(脱敏值也算已配置)
|
||||
const siliconflowConfigured = ref(false)
|
||||
const volcengineConfigured = ref(false)
|
||||
|
||||
// 测试状态
|
||||
const testingSiliconflow = ref(false)
|
||||
const testingVolcengine = ref(false)
|
||||
const siliconflowTestResult = ref<{ ok: boolean; msg: string } | null>(null)
|
||||
const volcengineTestResult = ref<{ ok: boolean; msg: string } | null>(null)
|
||||
|
||||
// 状态计算
|
||||
const siliconflowStatus = computed(() => siliconflowKey.value ? 'success' : 'info')
|
||||
const siliconflowStatusText = computed(() => siliconflowKey.value ? '已配置' : '未配置')
|
||||
const volcengineStatus = computed(() => volcengineKey.value ? 'success' : 'info')
|
||||
const volcengineStatusText = computed(() => volcengineKey.value ? '已配置' : '未配置')
|
||||
// 状态计算:输入框有值 或 后端已配置 都算"已配置"
|
||||
const siliconflowStatus = computed(() => (siliconflowKey.value || siliconflowConfigured.value) ? 'success' : 'info')
|
||||
const siliconflowStatusText = computed(() => (siliconflowKey.value || siliconflowConfigured.value) ? '已配置' : '未配置')
|
||||
const volcengineStatus = computed(() => (volcengineKey.value || volcengineConfigured.value) ? 'success' : 'info')
|
||||
const volcengineStatusText = computed(() => (volcengineKey.value || volcengineConfigured.value) ? '已配置' : '未配置')
|
||||
|
||||
// 加载配置
|
||||
const loadConfigs = async () => {
|
||||
@@ -160,6 +164,10 @@ const loadConfigs = async () => {
|
||||
defaultModel.value = map['AI_IMAGE_MODEL'] || 'flux-dev'
|
||||
// 注意:API Key 是脱敏的(****),不回填到输入框
|
||||
// 只有完整值才回填
|
||||
// 记录后端是否已有 API Key(脱敏值也算已配置)
|
||||
siliconflowConfigured.value = !!map['SILICONFLOW_API_KEY']
|
||||
volcengineConfigured.value = !!map['VOLCENGINE_API_KEY']
|
||||
// 脱敏值不回填输入框,只有完整值才回填
|
||||
if (map['SILICONFLOW_API_KEY'] && !map['SILICONFLOW_API_KEY'].includes('****')) {
|
||||
siliconflowKey.value = map['SILICONFLOW_API_KEY']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user