mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-22 10:51:33 +02:00
Show a 'please wait' error message if the server is still starting up
This commit is contained in:
parent
281e3152f9
commit
5e78ed5ba0
@ -70,11 +70,14 @@
|
|||||||
<script>
|
<script>
|
||||||
const HEALTH_PING_INTERVAL = 5 // seconds
|
const HEALTH_PING_INTERVAL = 5 // seconds
|
||||||
|
|
||||||
|
let serverStatus = 'offline'
|
||||||
|
|
||||||
function setStatus(statusType, msg, msgType) {
|
function setStatus(statusType, msg, msgType) {
|
||||||
let el = ''
|
let el = ''
|
||||||
|
|
||||||
if (statusType === 'server') {
|
if (statusType === 'server') {
|
||||||
el = '#serverStatus'
|
el = '#serverStatus'
|
||||||
|
serverStatus = msg
|
||||||
} else if (statusType === 'request') {
|
} else if (statusType === 'request') {
|
||||||
el = '#reqStatus'
|
el = '#reqStatus'
|
||||||
}
|
}
|
||||||
@ -152,7 +155,11 @@ async function makeImage() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (res.status != 200) {
|
if (res.status != 200) {
|
||||||
logError('Stable Diffusion had an error: ' + await res.text() + '. This happens some times. Maybe modify the prompt or seed a bit?', res)
|
if (serverStatus === 'online') {
|
||||||
|
logError('Stable Diffusion had an error: ' + await res.text() + '. This happens sometimes. Maybe modify the prompt or seed a little bit?', res)
|
||||||
|
} else {
|
||||||
|
logError("Stable Diffusion is still starting up, please wait. If this goes on beyond a few minutes, Stable Diffusion has probably crashed. Please check the logs in your command line.", res)
|
||||||
|
}
|
||||||
res = undefined
|
res = undefined
|
||||||
} else {
|
} else {
|
||||||
res = await res.json()
|
res = await res.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user