mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-19 17:39:16 +02:00
Tweak the seed behavior
Update the seed *before* starting the processing, so interrupting the processing retains the seed being used for the batch being currently processed. The idea behind that is that if I like the gen I'm currently seeing and want to build on top of it, I can create a new task with the same seed without having to wait for the current task to complete.
This commit is contained in:
parent
13654cb8c0
commit
69f14edd80
@ -695,6 +695,12 @@ async function checkTasks() {
|
|||||||
|
|
||||||
const genSeeds = Boolean(typeof task.reqBody.seed !== 'number' || (task.reqBody.seed === task.seed && task.numOutputsTotal > 1))
|
const genSeeds = Boolean(typeof task.reqBody.seed !== 'number' || (task.reqBody.seed === task.seed && task.numOutputsTotal > 1))
|
||||||
const startSeed = task.reqBody.seed || task.seed
|
const startSeed = task.reqBody.seed || task.seed
|
||||||
|
|
||||||
|
// Update the seed *before* starting the processing so it's retained if user stops the task
|
||||||
|
if (randomSeedField.checked) {
|
||||||
|
seedField.value = task.seed
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < task.batchCount; i++) {
|
for (let i = 0; i < task.batchCount; i++) {
|
||||||
let newTask = task
|
let newTask = task
|
||||||
if (task.batchCount > 1) {
|
if (task.batchCount > 1) {
|
||||||
@ -741,10 +747,6 @@ async function checkTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (randomSeedField.checked) {
|
|
||||||
seedField.value = task.seed
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTask = null
|
currentTask = null
|
||||||
|
|
||||||
if (typeof requestIdleCallback === 'function') {
|
if (typeof requestIdleCallback === 'function') {
|
||||||
@ -1201,7 +1203,7 @@ async function getModels() {
|
|||||||
function checkRandomSeed() {
|
function checkRandomSeed() {
|
||||||
if (randomSeedField.checked) {
|
if (randomSeedField.checked) {
|
||||||
seedField.disabled = true
|
seedField.disabled = true
|
||||||
seedField.value = "0"
|
//seedField.value = "0" // This causes the seed to be lost if the user changes their mind after toggling the checkbox
|
||||||
} else {
|
} else {
|
||||||
seedField.disabled = false
|
seedField.disabled = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user