移除左侧AI创作面板「AI视频生成/AI图片生成」两个页签
- 删除 AiMain 中对应 TabPane 及 AiVideo/AiImage 组件,保留一键出片与生成结果 - 生图/生视频仍走 AI 助手对话的图片/视频生成模式,引导文案不变 - 修复 AiMain 被误删的 Button/QuickVideo/useState 引用(面板渲染即崩) - 修复 build.sh/docs 硬编码旧源码路径 /vol1 → /vol3(仓库迁移残留) - build.sh 构建改走 DOCKER_BUILDKIT=0 legacy 构建器,规避 docker.io DNS 污染 - 验证:线上页签仅剩一键出片/生成结果,页面断言4/4,bundle 残留0;README/CHANGELOG 已更新
This commit is contained in:
1 parent
75309de217
commit
0d3a714438
7 files changed
+19
-354
No files matched your search
@@ -4,6 +4,18 @@
|
||||
|
||||
---
|
||||
|
||||
## 2026-11-11
|
||||
|
||||
### 🧹 功能调整
|
||||
|
||||
**移除「AI 视频生成 / AI 图片生成」两个页签**
|
||||
- 编辑器左侧「AI创作」面板删除 Ai视频生成、Ai图片生成 页签及其组件(AiVideo / AiImage),保留「一键出片」与「生成结果」
|
||||
- AI 生图 / 生视频能力不受影响:仍可走右侧「AI 助手」对话的图片生成 / 视频生成模式,未配置引导与「配置模型」入口文案不变
|
||||
- 验证:线上面板页签仅剩「一键出片 / 生成结果」;页面文本断言 4/4 通过;构建产物 `main-0605b5a4.js` 中两页签名残留 0 处
|
||||
- 附带修复 ①:AiMain 补回被误删的 `Button` / `QuickVideo` / `useState` 引用,否则面板一渲染就报错
|
||||
- 附带修复 ②:`scripts/build.sh` 与 `docs/免登录改造.md` 硬编码的旧源码路径 `/vol1/1000/HD1/docker/unicut-src` 改为现行 `/vol3/1000/HD3/docker/unicut-src`(仓库迁移残留,此前构建必失败)
|
||||
- 附带修复 ③:构建改走 `DOCKER_BUILDKIT=0` legacy 构建器——本机 docker.io DNS 被污染,buildkit 查基础镜像元数据必然超时;本地已有 `node:20-alpine` / `nginx:1.27-alpine`,legacy 直接用本地镜像
|
||||
|
||||
## 2026-10-28
|
||||
|
||||
### ✨ 新功能
|
||||
|
||||
@@ -47,13 +47,15 @@
|
||||
| 官方 AI 网关默认 | AI 默认接入官方网关 `https://ai.88531.cn/v1`,对话 / 视觉 / 生图 / 生视频模型全部预填,用户只需粘贴自己的 API Key |
|
||||
| 「配置模型」统一入口 | 编辑器右上角一个按钮,统一管理接口地址、API Key 与四个模型 |
|
||||
| 开源入口 | 编辑器右上角新增「开源地址」按钮,一键直达源码仓库 gitee.com/jinghui111/unicut |
|
||||
| AI 面板瘦身 | 左侧「AI创作」移除「AI 视频生成 / AI 图片生成」页签,保留一键出片与生成结果;生图 / 生视频走 AI 助手对话 |
|
||||
| AI 一键出片 | 添加图片 → AI 生成口播文案 → 13 种人声配音试听 → 一键排入时间轴,转场 / 动效 / 字幕样式可调 |
|
||||
| 模板导入修复 | 修复"导入第一个模板后,再导入会把浏览器拖崩"的问题,支持连续换模板 |
|
||||
| 品牌与首页 | 产品名改为米剪,首页新增导航站 / 开源地址入口,移除收费栏目与账号类外链 |
|
||||
| 接入授权中心 | 版本号、公告、检查更新(授权中心不可达时静默降级,绝不拦功能) |
|
||||
|
||||
### 最近更新(2026-10-28)
|
||||
### 最近更新(2026-11-11)
|
||||
|
||||
- **移除 AI 视频生成 / AI 图片生成页签**:左侧「AI创作」面板只保留「一键出片」与「生成结果」,生图 / 生视频走 AI 助手对话;
|
||||
- **AI 默认接入官方网关**:接口地址与模型全部预填,用户只需粘贴 API Key;
|
||||
- **「配置模型」统一入口**:AI 面板里分散的设置按钮下线,全部收进编辑器右上角;
|
||||
- **模板导入连环崩溃修复**:连续导入多个模板不再拖崩浏览器;
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ POST /localtts/tts {text, voice} → {"url":"/localtts/audio/<hash>.mp3", "voi
|
||||
## 构建与发布
|
||||
|
||||
```bash
|
||||
cd /vol1/1000/HD1/docker/unicut-src
|
||||
cd /vol3/1000/HD3/docker/unicut-src
|
||||
docker compose build unicut
|
||||
docker compose up -d --no-build
|
||||
```
|
||||
|
||||
+3
-2
@@ -14,7 +14,7 @@
|
||||
# 构建日志统一写 /tmp/unicut_build_site.log。
|
||||
set -euo pipefail
|
||||
|
||||
SRC=/vol1/1000/HD1/docker/unicut-src
|
||||
SRC=/vol3/1000/HD3/docker/unicut-src
|
||||
LOCK=/tmp/unicut_build.lock
|
||||
LOG=/tmp/unicut_build_site.log
|
||||
SITE=https://127.0.0.1:3005
|
||||
@@ -45,7 +45,8 @@ fi
|
||||
# ---------- 3. 构建 + 发布 ----------
|
||||
echo "[build] docker compose build unicut(日志:$LOG)"
|
||||
{
|
||||
docker compose build unicut
|
||||
# docker.io DNS 污染环境:legacy 构建器直接用本地基础镜像,不向 docker.io 查元数据
|
||||
DOCKER_BUILDKIT=0 docker compose build unicut
|
||||
docker compose up -d --no-build unicut
|
||||
} 2>&1 | tee "$LOG"
|
||||
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import styles from './styles.module.less';
|
||||
import { Tag, TextArea, RadioGroup, Radio, Select, Image, Button, Slider, Toast } from '@douyinfe/semi-ui';
|
||||
import { observer } from 'mobx-react';
|
||||
import SourceList from './SourceList';
|
||||
import { getClosestVideoRatioEnhanced } from '@pages/editor/tools/tools';
|
||||
import { getImageToVideoParams } from './aiConfig';
|
||||
import { stores } from '@stores/index';
|
||||
// import { StarOne } from '@icon-park/react';
|
||||
|
||||
export interface IProps {}
|
||||
|
||||
function AiImage(props: IProps) {
|
||||
const { editor } = stores;
|
||||
const [aiAction, setAiAction] = useState('image-to-image');
|
||||
const [count, setCount] = useState(1);
|
||||
const [description, setDescription] = useState('');
|
||||
|
||||
// 获取视频比例
|
||||
// const { ratio } = getClosestVideoRatioEnhanced(editor.data.width, editor.data.height);
|
||||
const [size, setSize] = useState('1K');
|
||||
const sourceListRef = useRef<any>(null);
|
||||
|
||||
const Icon = (props: { size?: number }) => {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={props.size || 16}
|
||||
height={props.size || 16}
|
||||
focusable="false"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
d="M9.68 5.45c.22-1.1 1.8-1.1 2.02 0a8.79 8.79 0 0 0 6.85 6.85c1.1.22 1.1 1.8 0 2.02a8.79 8.79 0 0 0-6.85 6.85c-.22 1.1-1.8 1.1-2.02 0a8.79 8.79 0 0 0-6.85-6.85c-1.1-.22-1.1-1.8 0-2.02a8.79 8.79 0 0 0 6.85-6.85Zm8.48-3.85c.16-.8 1.31-.8 1.48 0a3.54 3.54 0 0 0 2.76 2.76c.8.17.8 1.32 0 1.48a3.54 3.54 0 0 0-2.76 2.76c-.17.8-1.32.8-1.48 0a3.54 3.54 0 0 0-2.76-2.76c-.8-.16-.8-1.31 0-1.48a3.54 3.54 0 0 0 2.76-2.76Z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
|
||||
// 处理表单提交
|
||||
const handleGenerate = async () => {
|
||||
// 获取参考元素数据
|
||||
const urls = sourceListRef.current?.getURLs() || [];
|
||||
|
||||
// 整合所有表单数据
|
||||
const formData = {
|
||||
aiAction,
|
||||
description,
|
||||
size,
|
||||
count,
|
||||
urls: urls.map(d => d.url),
|
||||
};
|
||||
|
||||
if (formData.urls.length === 0 && aiAction !== 'text-to-image') {
|
||||
Toast.error('图生图必须选择一个参考图');
|
||||
return;
|
||||
}
|
||||
|
||||
// 图生视频
|
||||
const params = await getImageToVideoParams(formData);
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
const [res, err] = await editor.apiServer.createAiTask(params);
|
||||
if (!err) {
|
||||
Toast.success('任务创建成功');
|
||||
} else {
|
||||
Toast.error(err);
|
||||
}
|
||||
console.log('表单数据:', formData);
|
||||
|
||||
// 这里可以添加后续的生成逻辑,比如调用API等
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.ai + ' scroll'}>
|
||||
<h1>参数设置</h1>
|
||||
<div className={styles.model}>
|
||||
<Select value={aiAction} style={{ width: '100%' }} onChange={setAiAction} placeholder="选择AI类型">
|
||||
<Select.Option value="text-to-image">文生图</Select.Option>
|
||||
<Select.Option value="image-to-image">图生图</Select.Option>
|
||||
<Select.Option value="images-to-image">多图融合</Select.Option>
|
||||
</Select>
|
||||
{/* <div className={styles.desc}>根据输入的文本内容进行</div> */}
|
||||
{aiAction !== 'text-to-image' && (
|
||||
<div className={styles.inner}>
|
||||
<h2>参考元素</h2>
|
||||
<SourceList action={aiAction} limitType="image" ref={sourceListRef} />
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.inner}>
|
||||
<h2>描述信息</h2>
|
||||
<div className={styles.inner}>
|
||||
<TextArea
|
||||
style={{ width: '100%' }}
|
||||
rows={4}
|
||||
placeholder="请输入描述信息"
|
||||
value={description}
|
||||
onChange={setDescription}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>尺寸设置</h2>
|
||||
<Select value={size} style={{ width: '100%' }} onChange={setSize} placeholder="选择尺寸">
|
||||
<Select.Option value="1K">1K</Select.Option>
|
||||
<Select.Option value="2K">2K</Select.Option>
|
||||
<Select.Option value="3K">3K</Select.Option>
|
||||
<Select.Option value="4K">4K</Select.Option>
|
||||
{/* <Select.Option value="4:3">4:3</Select.Option> */}
|
||||
{/* <Select.Option value="3:4">3:4</Select.Option> */}
|
||||
{/* <Select.Option value="1:1">1:1</Select.Option> */}
|
||||
{/* <Select.Option value="21:9">21:9</Select.Option> */}
|
||||
{/* <Select.Option value="custom">自定义</Select.Option> */}
|
||||
</Select>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>生成数量: {count}</h2>
|
||||
{/*@ts-ignore*/}
|
||||
<Slider value={count} min={1} max={10} onChange={setCount}></Slider>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.model}>
|
||||
{/* <div className={styles.credit}>
|
||||
<span>
|
||||
预计消耗积分:<em>881</em>
|
||||
</span>
|
||||
<span>
|
||||
剩余:
|
||||
<i>
|
||||
<Icon size={12} />
|
||||
9881
|
||||
</i>
|
||||
</span>
|
||||
</div> */}
|
||||
<Button icon={<Icon />} block className={styles.btn} theme="solid" type="primary" onClick={handleGenerate}>
|
||||
开始生成
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default observer(AiImage);
|
||||
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
|
||||
import styles from './styles.module.less';
|
||||
import { Tabs, TabPane, Empty, Button } from '@douyinfe/semi-ui';
|
||||
import QuickVideo from './QuickVideo';
|
||||
import AiVideo from './AiVideo';
|
||||
import AiImage from './AiImage';
|
||||
import Tasks from './Tasks';
|
||||
import { IllustrationNoAccess, IllustrationNoAccessDark } from '@douyinfe/semi-illustrations';
|
||||
import Login from '@components/login';
|
||||
@@ -73,12 +71,6 @@ export default function AiMain() {
|
||||
<div className={styles.qvHint}>生成前可先调好转场、图片动效和字幕样式,不满意随时回来重做。</div>
|
||||
</div>
|
||||
</TabPane>
|
||||
<TabPane tab={'Ai视频生成'} itemKey="1">
|
||||
<AiVideo />
|
||||
</TabPane>
|
||||
<TabPane tab={'Ai图片生成'} itemKey="2">
|
||||
<AiImage />
|
||||
</TabPane>
|
||||
<TabPane tab={'生成结果'} itemKey="3">
|
||||
<Tasks />
|
||||
</TabPane>
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import styles from './styles.module.less';
|
||||
import { Tag, TextArea, RadioGroup, Radio, Select, Image, Button, Slider, Toast } from '@douyinfe/semi-ui';
|
||||
import { observer } from 'mobx-react';
|
||||
import SourceList from './SourceList';
|
||||
import { getClosestVideoRatioEnhanced } from '@pages/editor/tools/tools';
|
||||
import { getImageToVideoParams } from './aiConfig';
|
||||
import { stores } from '@stores/index';
|
||||
// import { StarOne } from '@icon-park/react';
|
||||
|
||||
/** cheaperinference 视频单价(USD/秒,来自其 /v1/models 的 resolution_prices,2026-10 实测) */
|
||||
const VIDEO_PRICE: Record<string, Record<string, number>> = {
|
||||
'grok-imagine-video': { '480p': 0.0325, '720p': 0.0455 },
|
||||
'veo-3.1-lite-generate-001': { '720p': 0.03, '1080p': 0.05 },
|
||||
'seedance-2.0-fast': { '480p': 0.034971, '720p': 0.078624 },
|
||||
};
|
||||
/** 与 localGenerateVideo 相同的降级顺序,取第一个支持该分辨率的模型价 */
|
||||
function videoPricePerSec(resolution: string) {
|
||||
const order = ['grok-imagine-video', 'veo-3.1-lite-generate-001', 'seedance-2.0-fast'];
|
||||
for (const m of order) {
|
||||
const v = VIDEO_PRICE[m]?.[resolution];
|
||||
if (v) return { price: v, model: m };
|
||||
}
|
||||
return { price: 0, model: '-' };
|
||||
}
|
||||
|
||||
export interface IProps {}
|
||||
|
||||
function AiVideo(props: IProps) {
|
||||
const { editor } = stores;
|
||||
const [aiAction, setAiAction] = useState('image-to-video');
|
||||
const [duration, setDuration] = useState(10);
|
||||
const [description, setDescription] = useState('');
|
||||
|
||||
const { ratio } = getClosestVideoRatioEnhanced(editor.data.width, editor.data.height);
|
||||
const [size, setSize] = useState(ratio);
|
||||
|
||||
const [clarity, setClarity] = useState('720p');
|
||||
const [count, setCount] = useState(1);
|
||||
const sourceListRef = useRef<any>(null);
|
||||
|
||||
const Icon = (props: { size?: number }) => {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={props.size || 16}
|
||||
height={props.size || 16}
|
||||
focusable="false"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
d="M9.68 5.45c.22-1.1 1.8-1.1 2.02 0a8.79 8.79 0 0 0 6.85 6.85c1.1.22 1.1 1.8 0 2.02a8.79 8.79 0 0 0-6.85 6.85c-.22 1.1-1.8 1.1-2.02 0a8.79 8.79 0 0 0-6.85-6.85c-1.1-.22-1.1-1.8 0-2.02a8.79 8.79 0 0 0 6.85-6.85Zm8.48-3.85c.16-.8 1.31-.8 1.48 0a3.54 3.54 0 0 0 2.76 2.76c.8.17.8 1.32 0 1.48a3.54 3.54 0 0 0-2.76 2.76c-.17.8-1.32.8-1.48 0a3.54 3.54 0 0 0-2.76-2.76c-.8-.16-.8-1.31 0-1.48a3.54 3.54 0 0 0 2.76-2.76Z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
|
||||
// 处理表单提交
|
||||
const handleGenerate = async () => {
|
||||
// 获取参考元素数据
|
||||
const urls = sourceListRef.current?.getURLs() || [];
|
||||
|
||||
// 整合所有表单数据
|
||||
const formData = {
|
||||
aiAction,
|
||||
description,
|
||||
size,
|
||||
clarity,
|
||||
duration,
|
||||
count,
|
||||
urls: urls.map(d => d.url),
|
||||
};
|
||||
console.log('表单数据:', formData);
|
||||
|
||||
// 图生视频
|
||||
const params = await getImageToVideoParams(formData);
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
const [res, err] = await editor.apiServer.createAiTask(params);
|
||||
if (!err) {
|
||||
Toast.success('任务创建成功');
|
||||
} else {
|
||||
Toast.error(err);
|
||||
}
|
||||
// 这里可以添加后续的生成逻辑,比如调用API等
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.ai + ' scroll'}>
|
||||
<h1>参数设置</h1>
|
||||
<div className={styles.model}>
|
||||
<Select value={aiAction} style={{ width: '100%' }} onChange={setAiAction} placeholder="选择AI类型">
|
||||
<Select.Option value="text-to-video">文生视频</Select.Option>
|
||||
<Select.Option value="image-to-video">图生视频</Select.Option>
|
||||
<Select.Option value="first-to-video">首帧生成视频</Select.Option>
|
||||
<Select.Option value="first-last-to-video">首尾帧过渡视频</Select.Option>
|
||||
<Select.Option value="action-to-video">动作模仿</Select.Option>
|
||||
</Select>
|
||||
{/* <div className={styles.desc}>根据输入的文本内容进行</div> */}
|
||||
{aiAction !== 'text-to-video' && (
|
||||
<div className={styles.inner}>
|
||||
<h2>参考元素</h2>
|
||||
<SourceList action={aiAction} ref={sourceListRef} />
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.inner}>
|
||||
<h2>描述信息</h2>
|
||||
<div className={styles.inner}>
|
||||
<TextArea
|
||||
style={{ width: '100%' }}
|
||||
rows={4}
|
||||
placeholder="请输入描述信息"
|
||||
value={description}
|
||||
onChange={setDescription}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>尺寸设置</h2>
|
||||
<Select value={size} style={{ width: '100%' }} onChange={setSize} placeholder="选择尺寸">
|
||||
<Select.Option value="16:9">16:9</Select.Option>
|
||||
<Select.Option value="9:16">9:16</Select.Option>
|
||||
<Select.Option value="4:3">4:3</Select.Option>
|
||||
<Select.Option value="3:4">3:4</Select.Option>
|
||||
<Select.Option value="1:1">1:1</Select.Option>
|
||||
<Select.Option value="21:9">21:9</Select.Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>清晰度设置</h2>
|
||||
<RadioGroup
|
||||
value={clarity}
|
||||
style={{ width: '100%' }}
|
||||
type="button"
|
||||
buttonSize="middle"
|
||||
name="clarity"
|
||||
onChange={setClarity as any}
|
||||
>
|
||||
<Radio value={'480p'}>480p</Radio>
|
||||
<Radio value={'720p'}>720p</Radio>
|
||||
<Radio value={'1080p'}>1080p</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>时长: {duration}s</h2>
|
||||
{/*@ts-ignore*/}
|
||||
<Slider value={duration} min={2} max={12} onChange={setDuration}></Slider>
|
||||
</div>
|
||||
<div className={styles.inner}>
|
||||
<h2>生成数量</h2>
|
||||
<RadioGroup
|
||||
value={count}
|
||||
style={{ width: '100%' }}
|
||||
type="button"
|
||||
buttonSize="middle"
|
||||
name="count"
|
||||
onChange={setCount as any}
|
||||
>
|
||||
<Radio value={1}>1</Radio>
|
||||
<Radio value={2}>2</Radio>
|
||||
<Radio value={3}>3</Radio>
|
||||
<Radio value={4}>4</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.model}>
|
||||
{/* <div className={styles.credit}>
|
||||
<span>
|
||||
预计消耗积分:<em>881</em>
|
||||
</span>
|
||||
<span>
|
||||
剩余:
|
||||
<i>
|
||||
<Icon size={12} />
|
||||
9881
|
||||
</i>
|
||||
</span>
|
||||
</div> */}
|
||||
<div className={styles.desc} style={{ marginBottom: 8, fontSize: 12 }}>
|
||||
预估费用 ≈ <b>${(videoPricePerSec(clarity).price * duration * count).toFixed(3)}</b>
|
||||
({videoPricePerSec(clarity).model} {clarity} ${videoPricePerSec(clarity).price}/秒 × {duration} 秒 × {count} 条,生成成功才计费)
|
||||
</div>
|
||||
<Button icon={<Icon />} block className={styles.btn} theme="solid" type="primary" onClick={handleGenerate}>
|
||||
开始生成
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default observer(AiVideo);
|
||||
Reference in new issue
Block a user