Compare commits

..

2 Commits

Author SHA1 Message Date
fcd1df0102 Merge branch 'master' of https://git.yasue.org/ken/RandomVideoMaker 2025-08-23 10:23:06 +02:00
b25f6990d9 save changes 2025-08-23 10:23:00 +02:00
2 changed files with 14 additions and 9 deletions

View File

@ -14,17 +14,17 @@ interface VideoRecord {
}
const servers = [
{
/*{
baseUrl: process.env.SERVER1_COMFY_BASE_URL,
outputDir: process.env.SERVER1_COMFY_OUTPUT_DIR,
},
},*/
/*
{
baseUrl: process.env.SERVER2_COMFY_BASE_URL,
outputDir: process.env.SERVER2_COMFY_OUTPUT_DIR,
},
*/
];
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
@ -63,7 +63,7 @@ async function worker(server: any) {
while (true) {
await sleep(Math.random() * 3000); // Random delay
const videosToProcess = (await query(
"SELECT * FROM video WHERE image_prompt IS NOT NULL AND (image_path IS NULL OR image_path = '') LIMIT 1"
"SELECT * FROM video WHERE image_prompt IS NOT NULL AND (video_path IS NULL OR image_path = '') LIMIT 1"
)) as any[];
if (videosToProcess.length === 0) {

View File

@ -64,8 +64,13 @@ async function generateImage(
await fs.mkdir('./generated', { recursive: true });
const sourcePath = path.join(COMFY_OUTPUT_DIR!, latestFile);
try {
await fs.unlink(sourcePath);
} catch (err) {
// ignore if not exists
}
await fs.copyFile(sourcePath, newFilePath);
//await fs.unlink(sourcePath);
return newFilePath;
}