Delete static/index.html
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FastAPI App</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css"> <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@100&display=swap" rel="stylesheet"> <style> html, body { margin: 0; padding: 0; box-sizing: border-box; overflow-x: hidden !important; } body { background-color: #000000; margin: 0; } #cont { background-color: #030303; padding: 0px; border-radius: 12px; box-shadow: 8px 8px 16px #050505, -8px -8px 16px #080808; display: flex; align-items: center; border: 2px solid rgb(247, 6, 187); } #prompt { flex-grow: 1; padding: 10px; margin: 10px; background: transparent; border: none; border-radius: 8px; box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b); color: #fff; outline: none; }#cont button { padding: 2.5vh 4.6vh; margin: 1vh; background: linear-gradient(145deg, rgb(0, 149, 249), #ff0095, rgb(255, 0, 43)); border: none; border-radius: 8px; color: #fff; cursor: pointer; } #cont button:hover { background: linear-gradient(145deg, #00ffab, #4e00f9, rgb(255, 0, 43)); } .container { text-align: center; }
h1 { margin-bottom: 20px; font-family: 'Barlow Condensed'; color: pink; } #inputs { flex-grow: 1; padding: 10px; margin: 10px; background: transparent; border: none; border-radius: 8px; box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b); color: #fff; outline: none;}
.image-container { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; }
.image-box { width: 200px; /* Adjust the width as needed */ height: 200px; /* Adjust the height as needed */ border: 2px solid #ffffff; /* Set the border color to white */ border-radius: 10px; overflow: hidden; /* Ensure the image does not overflow the box */ position: relative; /* Positioning context for absolute positioning of image */}
.spinner { border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top: 3px solid #ffffff; width: 20px; height: 20px; animation: spin 2s linear infinite; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }}
.image-box img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; /* Maintain aspect ratio and cover the entire box */ }
#noise_level { flex-grow: 1; padding: 10px; margin: 10px; background: transparent; border: none; border-radius: 8px; box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b); color: #fff; outline: none; } #image-box { border: 2px solid blue; width: 330px; height: 330px; display: flex; flex-direction: column; overflow-y: scroll; margin: auto; margin-top: 30px; padding-bottom: 7px; gap: 14px; background: linear-gradient(black, black) padding-box, linear-gradient(to right, red, blue) border-box; border-radius: 20px; border: 2.5px solid transparent;}
#image-box p { width: 80%; font-size: 20px; color: white; } #showadv{ padding: 10px 20px; margin: 10px; background: linear-gradient(145deg, rgb(0, 149, 249), #ff0095, rgb(255, 0, 43)); border: none; border-radius: 8px; cursor: pointer; color: #fff; } #advanced-options { flex-grow: 1; padding: 10px; margin: 10px; background: transparent; border: none; border-radius: 8px; box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b); color: #fff; outline: none; background-color: #030303; padding: 0px; border-radius: 12px; box-shadow: 8px 8px 16px #050505, -8px -8px 16px #080808; display: none; align-items: center; border: 2px solid rgb(247, 6, 187); } #advanced-options label, #advanced-options input { margin: 10px; color: #fff; } #advanced-options input[type="number"] { width: 50px; padding: 5px; } #advanced-options button { padding: 10px 20px; margin: 10px; background: linear-gradient(145deg, rgb(0, 149, 249), #ff0095, rgb(255, 0, 43)); border: none; border-radius: 8px; cursor: pointer; color: #fff; } #advanced-options button:hover { background: linear-gradient(145deg, #00ffab, #4e00f9, rgb(255, 0, 43)); } </style></head><body> <div class="container"> <h1>Aiconvert.online </h1> <div id="cont"> <div> <label for="prompt">Enter text:</label> <input type="text" id="prompt" name="prompt"> </div> <br> <div> <button onclick="generatePrompts()">Generate Prompts</button> <div id="promptSpinner" class="spinner" style="display: none;"></div> </div> </div> <br> <div id="cont"> <div> <label for="inputs">Enter prompt:</label> <input type="text" id="inputs" name="inputs"> </div> <br> <div> <button onclick="sendInputs()">generate image </button> <div id="sendSpinner" class="spinner" style="display: none;"></div> </div> </div> <br> <button id="showadv" onclick="toggleAdvancedOptions()">Advanced Options</button> <div id="advanced-options"> <label for="is_negative">Negative prompt :</label> <input type="text" id="is_negative" name="is_negative" value="blurry, fuzziness"> <br> <label for="steps">Steps:</label><input type="range" id="steps" name="steps" min="30" max="100" value="50"><span id="steps-value">50</span><br><label for="cfg_scale">Guidance Scale:</label><input type="range" id="cfg_scale" name="cfg_scale" min="5" max="14" value="7.5" step="1"><span id="cfg-scale-value">7.5</span><br><label for="seed">Seed:</label><input type="range" id="seed" name="seed" min="1" max="99999" value="0" step="1"><span id="seed-value">0</span><br><label for="noise_level">Noise Level:</label><input type="range" id="noise_level" name="noise_level" min="0" max="10" step="1" value="0"><span id="noise-level-value">0</span>
<br> <button onclick="toggleAdvancedOptions()">Hide Advanced Options</button> </div> <br> <div id="output-container" class="image-container"> <div id="image-box" class="image-box"> <p>Your Generated Arts Will Appear Here</p> </div> </div> </div> <script> function showSpinner(spinnerId) { document.getElementById(spinnerId).style.display = 'block'; }
function hideSpinner(spinnerId) { document.getElementById(spinnerId).style.display = 'none'; }
function generatePrompts() { const prompt = document.getElementById("prompt").value; const promptBox = document.getElementById("prompt-box"); const promptSpinner = document.getElementById("promptSpinner"); if (!prompt) { promptBox.innerHTML = "<p>Please enter text before generating prompts.</p>"; return; } promptBox.innerHTML = ""; // Clear previous content promptSpinner.style.display = "block"; // Display spinner fetch(`/generate_prompts?prompt_text=${encodeURIComponent(prompt)}`) .then(response => response.text()) .then(data => { document.getElementById("inputs").value = data.trim(); promptSpinner.style.display = 'none'; // Hide spinner }) .catch(error => { console.error('Error:', error); promptSpinner.style.display = 'none'; // Hide spinner });}
function sendInputs() { const inputs = document.getElementById("inputs").value; if (!inputs) { const imageBox = document.getElementById("image-box"); imageBox.innerHTML = "<p>Please enter prompt before sending.</p>"; return; } showSpinner('sendSpinner'); const noiseLevel = document.getElementById("noise_level").value; const isNegative = document.getElementById("is_negative").value; const steps = document.getElementById("steps").value; const cfgScale = document.getElementById("cfg_scale").value; const seed = document.getElementById("seed").value; fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}&is_negative=${isNegative}&steps=${steps}&cfg_scale=${cfgScale}&seed=${seed}`) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }) .then(data => { const imageBox = document.getElementById("image-box"); const img = new Image(); img.src = 'data:image/jpeg;base64,' + data.image_base64; const maxWidth = 200; const maxHeight = 200; if (img.width > maxWidth || img.height > maxHeight) { const ratio = Math.min(maxWidth / img.width, maxHeight / img.height); img.width *= ratio; img.height *= ratio; } imageBox.appendChild(img); hideSpinner('sendSpinner'); }) .catch(error => { console.error('Error:', error); const imageBox = document.getElementById("image-box"); imageBox.innerHTML = "<p>An error occurred. Please try again later.</p>"; hideSpinner('sendSpinner'); });}
function toggleAdvancedOptions() { const advancedOptions = document.getElementById("advanced-options"); if (advancedOptions.style.display === "none") { advancedOptions.style.display = "block"; } else { advancedOptions.style.display = "none"; }}
// Function to update slider value display function updateSliderValue(sliderId, spanId) { const slider = document.getElementById(sliderId); const span = document.getElementById(spanId); span.textContent = slider.value; }
// Event listeners to update slider values document.getElementById("steps").addEventListener("input", () => { updateSliderValue("steps", "steps-value"); });
document.getElementById("cfg_scale").addEventListener("input", () => { updateSliderValue("cfg_scale", "cfg-scale-value"); });
document.getElementById("seed").addEventListener("input", () => { updateSliderValue("seed", "seed-value"); });
document.getElementById("noise_level").addEventListener("input", () => { updateSliderValue("noise_level", "noise-level-value"); });
</script></body></html>static/index.htmlDeleted-381