Update static/index.html
Browse files- static/index.html +9 -5
static/index.html
CHANGED
@@ -469,19 +469,22 @@
|
|
469 |
|
470 |
// Display loading spinner
|
471 |
const loadingSpinner = document.getElementById('loadingSpinner');
|
472 |
-
loadingSpinner
|
473 |
|
474 |
try {
|
475 |
const response = await fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}&is_negative=${isNegative}&steps=${steps}&cfg_scale=${cfgScale}&seed=${seed}`);
|
476 |
|
477 |
-
// Hide loading spinner
|
478 |
-
loadingSpinner.style.display = 'none';
|
479 |
-
|
480 |
if (!response.ok) {
|
481 |
throw new Error('Network response was not ok');
|
482 |
}
|
483 |
|
484 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
} catch (error) {
|
486 |
console.error('Error:', error);
|
487 |
resultContainer.innerHTML = `<p style="color: white;">Oops! Something went wrong. Please try again later.</p>`;
|
@@ -496,6 +499,7 @@
|
|
496 |
|
497 |
|
498 |
|
|
|
499 |
function toggleAdvancedOptions() {
|
500 |
const advancedOptions = document.getElementById("advanced-options");
|
501 |
if (advancedOptions.style.display === "none") {
|
|
|
469 |
|
470 |
// Display loading spinner
|
471 |
const loadingSpinner = document.getElementById('loadingSpinner');
|
472 |
+
showSpinner('loadingSpinner');
|
473 |
|
474 |
try {
|
475 |
const response = await fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}&is_negative=${isNegative}&steps=${steps}&cfg_scale=${cfgScale}&seed=${seed}`);
|
476 |
|
|
|
|
|
|
|
477 |
if (!response.ok) {
|
478 |
throw new Error('Network response was not ok');
|
479 |
}
|
480 |
|
481 |
+
const data = await response.json();
|
482 |
+
|
483 |
+
// Hide loading spinner
|
484 |
+
hideSpinner('loadingSpinner');
|
485 |
+
|
486 |
+
// Display the result image
|
487 |
+
resultContainer.innerHTML = `<img src="${data.image_url}" alt="Generated Image">`;
|
488 |
} catch (error) {
|
489 |
console.error('Error:', error);
|
490 |
resultContainer.innerHTML = `<p style="color: white;">Oops! Something went wrong. Please try again later.</p>`;
|
|
|
499 |
|
500 |
|
501 |
|
502 |
+
|
503 |
function toggleAdvancedOptions() {
|
504 |
const advancedOptions = document.getElementById("advanced-options");
|
505 |
if (advancedOptions.style.display === "none") {
|