save changes

This commit is contained in:
2025-08-17 17:48:02 +02:00
parent dc4e57db2c
commit a87fc4da3d
2 changed files with 8 additions and 2 deletions

View File

@ -62,7 +62,10 @@ async function generateImage(
const newFilePath = path.resolve('./generated', newFileName);
await fs.mkdir('./generated', { recursive: true });
await fs.rename(path.join(COMFY_OUTPUT_DIR!, latestFile), newFilePath);
const sourcePath = path.join(COMFY_OUTPUT_DIR!, latestFile);
await fs.copyFile(sourcePath, newFilePath);
//await fs.unlink(sourcePath);
return newFilePath;
}

View File

@ -52,7 +52,10 @@ async function generateVideo(
const newFilePath = path.resolve('./generated', newFileName);
await fs.mkdir('./generated', { recursive: true });
await fs.rename(path.join(COMFY_OUTPUT_DIR!, latestFile), newFilePath);
const sourcePath = path.join(COMFY_OUTPUT_DIR!, latestFile);
await fs.copyFile(sourcePath, newFilePath);
await fs.unlink(sourcePath);
return newFilePath;
}