Spaces:
Running
Running
ya_sir
commited on
Update script.js
Browse files
script.js
CHANGED
|
@@ -311,7 +311,7 @@ console.log(progress.value)
|
|
| 311 |
|
| 312 |
}
|
| 313 |
|
| 314 |
-
await Promise.all([generate()
|
| 315 |
|
| 316 |
|
| 317 |
/* function final2(){
|
|
@@ -364,23 +364,40 @@ console.log(progress.value)
|
|
| 364 |
// Call the function again after a delay if the status is 'generating'
|
| 365 |
setTimeout(() => checkProcessStatus(n), 2000);
|
| 366 |
} else {
|
| 367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
btn.innerText = "CREATE"
|
| 369 |
-
progress.innerHTML =
|
| 370 |
progress.style.display = 'none'
|
| 371 |
-
|
| 372 |
console.log(data)
|
| 373 |
const img = document.createElement('img');
|
|
|
|
| 374 |
if(window.innerWidth<700){
|
| 375 |
-
|
| 376 |
img.id = "i1"
|
| 377 |
-
|
| 378 |
}
|
| 379 |
pi.innerHTML = '';
|
| 380 |
pi.innerText = '';
|
| 381 |
-
img.src =
|
|
|
|
| 382 |
div.appendChild(img);
|
|
|
|
| 383 |
btn.disabled = false;
|
|
|
|
| 384 |
|
| 385 |
}
|
| 386 |
})
|
|
@@ -392,7 +409,6 @@ console.log(progress.value)
|
|
| 392 |
}
|
| 393 |
|
| 394 |
checkProcessStatus(0);
|
| 395 |
-
checkProcessStatus(1);
|
| 396 |
|
| 397 |
|
| 398 |
|
|
|
|
| 311 |
|
| 312 |
}
|
| 313 |
|
| 314 |
+
await Promise.all([generate()]);
|
| 315 |
|
| 316 |
|
| 317 |
/* function final2(){
|
|
|
|
| 364 |
// Call the function again after a delay if the status is 'generating'
|
| 365 |
setTimeout(() => checkProcessStatus(n), 2000);
|
| 366 |
} else {
|
| 367 |
+
if(data.nsfw == "NSFW ERROR PLEASE CHANGE YOUR PROMPT"){
|
| 368 |
+
|
| 369 |
+
|
| 370 |
+
cn = false
|
| 371 |
+
btn.innerText = "CREATE"
|
| 372 |
+
progress.innerHTML = ''
|
| 373 |
+
progress.style.display = 'none'
|
| 374 |
+
|
| 375 |
+
console.log(data)
|
| 376 |
+
pi.innerText = "NSFW ERROR PLEASE CHANGE YOUR PROMPT";
|
| 377 |
+
}else{
|
| 378 |
+
src1 = data.0
|
| 379 |
+
src2 = data.1
|
| 380 |
+
cn = false
|
| 381 |
btn.innerText = "CREATE"
|
| 382 |
+
progress.innerHTML = ""
|
| 383 |
progress.style.display = 'none'
|
| 384 |
+
|
| 385 |
console.log(data)
|
| 386 |
const img = document.createElement('img');
|
| 387 |
+
const img2 = document.createElement('img');
|
| 388 |
if(window.innerWidth<700){
|
| 389 |
+
|
| 390 |
img.id = "i1"
|
| 391 |
+
|
| 392 |
}
|
| 393 |
pi.innerHTML = '';
|
| 394 |
pi.innerText = '';
|
| 395 |
+
img.src = src1.trim().replace(/^"|"$/g, '');
|
| 396 |
+
img2.src = src2.trim().replace(/^"|"$/g, '');
|
| 397 |
div.appendChild(img);
|
| 398 |
+
div.appendChild(img2);
|
| 399 |
btn.disabled = false;
|
| 400 |
+
}
|
| 401 |
|
| 402 |
}
|
| 403 |
})
|
|
|
|
| 409 |
}
|
| 410 |
|
| 411 |
checkProcessStatus(0);
|
|
|
|
| 412 |
|
| 413 |
|
| 414 |
|