Auto-Photoshop-StableDiffus.../utility/general.js

11 lines
370 B
JavaScript

function newOutputImageName(format = 'png') {
const random_id = Math.floor(Math.random() * 100000000000 + 1) // Date.now() doesn't have enough resolution to avoid duplicate
const image_name = `output- ${Date.now()}-${random_id}.${format}`
console.log('generated image name:', image_name)
return image_name
}
module.exports = {
newOutputImageName,
}