V 4.0.5(2025.11.07)
1. 修复ComfyUI转视频初始化视频时长同步 2. 修复ComfyUI转视频工作流选择 3. 增加ComfyUI请求重试
This commit is contained in:
parent
b4ee555c03
commit
6b23ff2697
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,3 +11,5 @@ Database
|
|||||||
build
|
build
|
||||||
src/renderer/src/components/Original/MainHome/OriginalTaskCard.vue
|
src/renderer/src/components/Original/MainHome/OriginalTaskCard.vue
|
||||||
resources/image/预设
|
resources/image/预设
|
||||||
|
resources/scripts/db/option.realm
|
||||||
|
resources/scripts/db/option.realm.lock
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "laitool-pro",
|
"name": "laitool-pro",
|
||||||
"productName": "LaiToolPro",
|
"productName": "LaiToolPro",
|
||||||
"version": "v4.0.4",
|
"version": "v4.0.5",
|
||||||
"description": "来推 Pro - 一款集音频处理、文案生成、图片生成、视频生成等功能于一体的多合一AI工具软件。",
|
"description": "来推 Pro - 一款集音频处理、文案生成、图片生成、视频生成等功能于一体的多合一AI工具软件。",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "xiangbei",
|
"author": "xiangbei",
|
||||||
|
|||||||
3
resources/scripts/db/dbconfig.json
Normal file
3
resources/scripts/db/dbconfig.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"notInstall": false
|
||||||
|
}
|
||||||
@ -18,13 +18,9 @@ import { BookTaskModel } from '../../model/bookTask'
|
|||||||
import { PresetModel } from '../../model/preset'
|
import { PresetModel } from '../../model/preset'
|
||||||
import { define } from '@/define/define'
|
import { define } from '@/define/define'
|
||||||
import { WorkFlowModel } from '../../model/workflow'
|
import { WorkFlowModel } from '../../model/workflow'
|
||||||
|
import { CheckFileOrDirExist } from '@/define/Tools/file'
|
||||||
const { app } = require('electron')
|
import { ValidateJson } from '@/define/Tools/validate'
|
||||||
// Determine database path based on environment
|
import { isEmpty } from 'lodash'
|
||||||
const isDev = !app.isPackaged
|
|
||||||
let dbPath = isDev
|
|
||||||
? path.resolve(process.cwd(), 'Database/option.realm') // Development path
|
|
||||||
: path.resolve(app.getPath('userData'), '../laitool-pro/Database/option.realm') // Production path
|
|
||||||
|
|
||||||
// 版本迁移
|
// 版本迁移
|
||||||
const migration = (_oldRealm: Realm, _newRealm: Realm) => { }
|
const migration = (_oldRealm: Realm, _newRealm: Realm) => { }
|
||||||
@ -32,25 +28,41 @@ const migration = (_oldRealm: Realm, _newRealm: Realm) => { }
|
|||||||
export class RealmBaseService extends BaseService {
|
export class RealmBaseService extends BaseService {
|
||||||
static instance: RealmBaseService | null = null
|
static instance: RealmBaseService | null = null
|
||||||
protected realm: Realm | null = null
|
protected realm: Realm | null = null
|
||||||
dbpath: string
|
|
||||||
|
|
||||||
protected constructor() {
|
protected constructor() {
|
||||||
super()
|
super()
|
||||||
this.dbpath = dbPath
|
}
|
||||||
|
|
||||||
|
private async initDBPath() {
|
||||||
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
let dbConfigPath = path.resolve(define.db_path, "dbconfig.json");
|
||||||
|
let hasConfig = true;
|
||||||
|
|
||||||
|
let notInstall = false;
|
||||||
|
if (!await CheckFileOrDirExist(dbConfigPath)) {
|
||||||
|
hasConfig = false;
|
||||||
|
} else {
|
||||||
|
let dbCinfigString = await fs.promises.readFile(dbConfigPath, 'utf-8')
|
||||||
|
if (isEmpty(dbCinfigString) || !ValidateJson(dbCinfigString)) {
|
||||||
|
hasConfig = false;
|
||||||
|
}
|
||||||
|
let dbConfig = hasConfig ? JSON.parse(dbCinfigString) : null;
|
||||||
|
notInstall = dbConfig?.notInstall;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine database path based on environment
|
||||||
|
const isDev = !app.isPackaged
|
||||||
|
|
||||||
|
let dbPath = isDev
|
||||||
|
? path.resolve(process.cwd(), 'Database/option.realm') // Development path
|
||||||
|
: notInstall == true ? path.resolve(define.db_path, "option.realm") : path.resolve(app.getPath('userData'), '../laitool-pro/Database/option.realm') // Production path
|
||||||
|
|
||||||
|
return dbPath
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async getInstance() {
|
public static async getInstance() {
|
||||||
if (RealmBaseService.instance === null) {
|
if (RealmBaseService.instance === null) {
|
||||||
// 将数写道本地文件
|
|
||||||
await fs.promises.writeFile(path.join(process.cwd(), '123.txt'),
|
|
||||||
`
|
|
||||||
dbPath : ${dbPath}
|
|
||||||
resourcesPath : ${define.resources_path},
|
|
||||||
log_folder : ${define.log_folder}
|
|
||||||
image_path : ${define.image_path}
|
|
||||||
cache_path : ${define.cache_path}
|
|
||||||
__dirname : ${__dirname}
|
|
||||||
`, 'utf-8')
|
|
||||||
RealmBaseService.instance = new RealmBaseService()
|
RealmBaseService.instance = new RealmBaseService()
|
||||||
await RealmBaseService.instance.open()
|
await RealmBaseService.instance.open()
|
||||||
}
|
}
|
||||||
@ -64,6 +76,21 @@ export class RealmBaseService extends BaseService {
|
|||||||
async open() {
|
async open() {
|
||||||
try {
|
try {
|
||||||
if (this.realm != null) return
|
if (this.realm != null) return
|
||||||
|
|
||||||
|
const dbPath = await this.initDBPath()
|
||||||
|
|
||||||
|
// 将数写道本地文件
|
||||||
|
await fs.promises.writeFile(path.join(process.cwd(), '123.txt'),
|
||||||
|
`
|
||||||
|
dbPath : ${dbPath}
|
||||||
|
resourcesPath : ${define.resources_path},
|
||||||
|
log_folder : ${define.log_folder}
|
||||||
|
image_path : ${define.image_path}
|
||||||
|
cache_path : ${define.cache_path}
|
||||||
|
__dirname : ${__dirname}
|
||||||
|
`, 'utf-8')
|
||||||
|
|
||||||
|
|
||||||
// 判断当前全局是不是又当前这个
|
// 判断当前全局是不是又当前这个
|
||||||
const config = {
|
const config = {
|
||||||
schema: [
|
schema: [
|
||||||
@ -81,7 +108,7 @@ export class RealmBaseService extends BaseService {
|
|||||||
PresetModel,
|
PresetModel,
|
||||||
WorkFlowModel
|
WorkFlowModel
|
||||||
],
|
],
|
||||||
path: this.dbpath,
|
path: dbPath,
|
||||||
schemaVersion: 25, // 数据库版本号,修改时需要增加
|
schemaVersion: 25, // 数据库版本号,修改时需要增加
|
||||||
migration: migration
|
migration: migration
|
||||||
}
|
}
|
||||||
|
|||||||
@ -201,7 +201,7 @@ export class BookVideoServiceHandle extends BookBasicHandle {
|
|||||||
|
|
||||||
let duration = 5;
|
let duration = 5;
|
||||||
if (bookTaskDetail.endTime != null && bookTaskDetail.startTime != null) {
|
if (bookTaskDetail.endTime != null && bookTaskDetail.startTime != null) {
|
||||||
let d = (bookTaskDetail.endTime - bookTaskDetail.startTime) / 1000000;
|
let d = (bookTaskDetail.endTime - bookTaskDetail.startTime) / 1000.0;
|
||||||
duration = Math.ceil(d); // 向上取整
|
duration = Math.ceil(d); // 向上取整
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import { BookTaskDetail } from '@/define/model/book/bookTaskDetail'
|
|||||||
import { VideoStatus } from '@/define/enum/video'
|
import { VideoStatus } from '@/define/enum/video'
|
||||||
import { ResponseMessageType } from '@/define/enum/softwareEnum'
|
import { ResponseMessageType } from '@/define/enum/softwareEnum'
|
||||||
import { ComfyUIWorkflowType } from '@/define/enum/comfyuiEnum'
|
import { ComfyUIWorkflowType } from '@/define/enum/comfyuiEnum'
|
||||||
|
import { RetryWithBackoff } from '@/define/Tools/common'
|
||||||
|
|
||||||
export class ComfyUIServiceHandle extends SDServiceHandle {
|
export class ComfyUIServiceHandle extends SDServiceHandle {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -164,7 +165,10 @@ export class ComfyUIServiceHandle extends SDServiceHandle {
|
|||||||
|
|
||||||
let comfyuiSimpleSetting = await this.GetComfyUISetting()
|
let comfyuiSimpleSetting = await this.GetComfyUISetting()
|
||||||
|
|
||||||
let workflow_file = comfyuiOptions.workflow_file ?? comfyuiSimpleSetting.imageToVideoSelectWorkflow ?? "";
|
let workflow_file = comfyuiOptions.workflow_file;
|
||||||
|
if (isEmpty(workflow_file)) {
|
||||||
|
workflow_file = comfyuiSimpleSetting.imageToVideoSelectWorkflow || "";
|
||||||
|
}
|
||||||
|
|
||||||
let prompt = videoMessage.prompt || comfyuiOptions.prompt || '';
|
let prompt = videoMessage.prompt || comfyuiOptions.prompt || '';
|
||||||
let negativePrompt = comfyuiOptions.negative_prompt || '';
|
let negativePrompt = comfyuiOptions.negative_prompt || '';
|
||||||
@ -283,7 +287,7 @@ export class ComfyUIServiceHandle extends SDServiceHandle {
|
|||||||
data: data
|
data: data
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await axios(config);
|
let res = await RetryWithBackoff(async () => await axios(config), 5, 2000);
|
||||||
|
|
||||||
let resData = res.data;
|
let resData = res.data;
|
||||||
|
|
||||||
@ -514,7 +518,7 @@ export class ComfyUIServiceHandle extends SDServiceHandle {
|
|||||||
data: body
|
data: body
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = await axios(config)
|
let res = await RetryWithBackoff(async () => await axios(config), 5, 2000);
|
||||||
let resData = res.data
|
let resData = res.data
|
||||||
// 判断是不是失败
|
// 判断是不是失败
|
||||||
if (resData.error) {
|
if (resData.error) {
|
||||||
@ -900,7 +904,8 @@ export class ComfyUIServiceHandle extends SDServiceHandle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = await axios.request(config)
|
let res = await RetryWithBackoff(async () => await axios.request(config), 5, 2000);
|
||||||
|
|
||||||
let resData = res.data
|
let resData = res.data
|
||||||
// 判断状态是失败还是成功
|
// 判断状态是失败还是成功
|
||||||
let data = resData[promptId]
|
let data = resData[promptId]
|
||||||
@ -1005,7 +1010,7 @@ export class ComfyUIServiceHandle extends SDServiceHandle {
|
|||||||
responseType: 'arraybuffer' as 'arraybuffer' // 明确指定类型
|
responseType: 'arraybuffer' as 'arraybuffer' // 明确指定类型
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = await axios.request(config)
|
let res = await RetryWithBackoff(async () => axios.request(config), 5, 2000);
|
||||||
|
|
||||||
// 检查响应状态和类型
|
// 检查响应状态和类型
|
||||||
console.log(`图片下载状态: ${res.status}, 内容类型: ${res.headers['content-type']}`)
|
console.log(`图片下载状态: ${res.status}, 内容类型: ${res.headers['content-type']}`)
|
||||||
|
|||||||
@ -378,7 +378,6 @@ export function useWordGroupBase(initData) {
|
|||||||
initData: data,
|
initData: data,
|
||||||
onSaveWord: (newWords) => {
|
onSaveWord: (newWords) => {
|
||||||
da?.destroy()
|
da?.destroy()
|
||||||
debugger
|
|
||||||
for (let i = 0; i < data.value.length; i++) {
|
for (let i = 0; i < data.value.length; i++) {
|
||||||
const element = data.value[i]
|
const element = data.value[i]
|
||||||
element.afterGpt = ''
|
element.afterGpt = ''
|
||||||
@ -441,7 +440,6 @@ export function useWordGroupBase(initData) {
|
|||||||
onPositiveClick: async () => {
|
onPositiveClick: async () => {
|
||||||
try {
|
try {
|
||||||
da?.destroy()
|
da?.destroy()
|
||||||
debugger
|
|
||||||
|
|
||||||
// 深度清理数据,移除不可序列化的属性
|
// 深度清理数据,移除不可序列化的属性
|
||||||
const cleanData = toRaw(data.value).map(item => ({
|
const cleanData = toRaw(data.value).map(item => ({
|
||||||
|
|||||||
@ -1,11 +1,30 @@
|
|||||||
{
|
{
|
||||||
"latestVersion": "v4.0.4",
|
"latestVersion": "v4.0.5",
|
||||||
"updateDate": "2025-11-06",
|
"updateDate": "2025-11-07",
|
||||||
"updateInfo": [
|
"updateInfo": [
|
||||||
|
{
|
||||||
|
"version": "v4.0.5",
|
||||||
|
"updateDate": "2025-11-07",
|
||||||
|
"status": "unreleased",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"type": "bugfix",
|
||||||
|
"description": "修复 ComfyUI 转视频工作流选择"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bugfix",
|
||||||
|
"description": "修复 ComfyUI 视频时长同步"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "improvement",
|
||||||
|
"description": "增加 ComfyUI 请求重试"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "v4.0.4",
|
"version": "v4.0.4",
|
||||||
"updateDate": "2025-11-06",
|
"updateDate": "2025-11-06",
|
||||||
"status": "unreleased",
|
"status": "released",
|
||||||
"changes": [
|
"changes": [
|
||||||
{
|
{
|
||||||
"type": "add",
|
"type": "add",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user