save changes
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user