mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-10 11:08:20 +02:00
Fix bug with broken tag name in filename generator
This commit is contained in:
parent
b54c057c83
commit
64f0f1aa2c
@ -434,6 +434,7 @@ let serverStatusMsg = document.querySelector('#server-status-msg')
|
|||||||
|
|
||||||
let serverStatus = 'offline'
|
let serverStatus = 'offline'
|
||||||
let activeTags = []
|
let activeTags = []
|
||||||
|
let lastPromptUsed = ''
|
||||||
|
|
||||||
function getLocalStorageItem(key, fallback) {
|
function getLocalStorageItem(key, fallback) {
|
||||||
let item = localStorage.getItem(key)
|
let item = localStorage.getItem(key)
|
||||||
@ -565,6 +566,8 @@ async function doMakeImage(reqBody) {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastPromptUsed = reqBody['prompt']
|
||||||
|
|
||||||
for (let idx in res.output) {
|
for (let idx in res.output) {
|
||||||
let imgBody = ''
|
let imgBody = ''
|
||||||
|
|
||||||
@ -733,7 +736,7 @@ async function makeImage() {
|
|||||||
function createFileName() {
|
function createFileName() {
|
||||||
|
|
||||||
// Most important information is the prompt
|
// Most important information is the prompt
|
||||||
const underscoreName = promptField.value.replace(/[^a-zA-Z0-9]/g, '_');
|
const underscoreName = lastPromptUsed.replace(/[^a-zA-Z0-9]/g, '_');
|
||||||
const seed = seedField.value;
|
const seed = seedField.value;
|
||||||
const steps = numInferenceStepsField.value;
|
const steps = numInferenceStepsField.value;
|
||||||
const guidance = guidanceScaleField.value;
|
const guidance = guidanceScaleField.value;
|
||||||
@ -742,20 +745,20 @@ function createFileName() {
|
|||||||
let fileName = `sd_${underscoreName}_Seed-${seed}_Steps-${steps}_Guidance-${guidance}`;
|
let fileName = `sd_${underscoreName}_Seed-${seed}_Steps-${steps}_Guidance-${guidance}`;
|
||||||
|
|
||||||
// add the tags
|
// add the tags
|
||||||
let tags = [];
|
// let tags = [];
|
||||||
let tagString = '';
|
// let tagString = '';
|
||||||
document.querySelectorAll(modifyTagsSelector).forEach(function(tag) {
|
// document.querySelectorAll(modifyTagsSelector).forEach(function(tag) {
|
||||||
tags.push(tag.innerHTML);
|
// tags.push(tag.innerHTML);
|
||||||
})
|
// })
|
||||||
|
|
||||||
// join the tags with a pipe
|
// join the tags with a pipe
|
||||||
if (tags.length > 0) {
|
// if (activeTags.length > 0) {
|
||||||
tagString = '_Tags-';
|
// tagString = '_Tags-';
|
||||||
tagString += tags.join('|');
|
// tagString += tags.join('|');
|
||||||
}
|
// }
|
||||||
|
|
||||||
// append empty or populated tags
|
// // append empty or populated tags
|
||||||
fileName += `${tagString}`;
|
// fileName += `${tagString}`;
|
||||||
|
|
||||||
// add the file extension
|
// add the file extension
|
||||||
fileName += `.png`;
|
fileName += `.png`;
|
||||||
|
Loading…
Reference in New Issue
Block a user