Spaces:
Running
Running
yasir
commited on
Update index.html
Browse files- index.html +3 -98
index.html
CHANGED
@@ -562,103 +562,7 @@ const div = document.getElementById('imshow');
|
|
562 |
div.innerHTML = '';
|
563 |
document.getElementById('imshow').innerHTML = ''
|
564 |
let pi = document.createElement('p')
|
565 |
-
pi.innerText = 'Generating Image...
|
566 |
-
document.getElementById('imshow').append(pi)
|
567 |
-
let count = 0;
|
568 |
-
seed = seed
|
569 |
-
async function generate(){
|
570 |
-
|
571 |
-
const params = {
|
572 |
-
'prompt': inp.value+prompt,
|
573 |
-
'negative_prompt': np.value+nps,
|
574 |
-
"steps": step.value,
|
575 |
-
'gd': gd.value
|
576 |
-
};
|
577 |
-
|
578 |
-
try {
|
579 |
-
const response = await fetch(url, {
|
580 |
-
method: 'POST',
|
581 |
-
headers: {
|
582 |
-
'Content-Type': 'application/json',
|
583 |
-
'Connection': 'keep-alive',
|
584 |
-
},
|
585 |
-
body: JSON.stringify(params)
|
586 |
-
});
|
587 |
-
/* console.log(np.value)
|
588 |
-
const imgData = await response.text();
|
589 |
-
const div = document.getElementById('imshow')
|
590 |
-
const img = document.createElement('img');
|
591 |
-
pi.innerHTML = ''
|
592 |
-
pi.innerText = ''
|
593 |
-
img.src = imgData;
|
594 |
-
div.appendChild(img);
|
595 |
-
*/
|
596 |
-
|
597 |
-
const imgData = await response.text();
|
598 |
-
idlist.push(imgData)
|
599 |
-
|
600 |
-
|
601 |
-
} catch (error) {
|
602 |
-
btn.disabled = false
|
603 |
-
console.error('An error occurred:', error);
|
604 |
-
pi.innerText = 'An error occurred, try changing your prompt';
|
605 |
-
}
|
606 |
-
}
|
607 |
-
|
608 |
-
await Promise.all([generate(), generate()]);
|
609 |
-
|
610 |
-
isf = false
|
611 |
-
btn.onclick = async ()=>{
|
612 |
-
let url2 = 'https://flask-hello-world-murex-sigma.vercel.app/get_prediction'
|
613 |
-
let idlist = []
|
614 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
|
615 |
-
var selectElement = document.getElementById("model");
|
616 |
-
var selectedIndex = selectElement.selectedIndex;
|
617 |
-
if (selectedIndex === -1) {
|
618 |
-
console.log("No option is selected.");
|
619 |
-
} else {
|
620 |
-
var selectedOption = selectElement.options[selectedIndex];
|
621 |
-
|
622 |
-
if(selectedOption.value == 'rv6'){
|
623 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/proteus'
|
624 |
-
|
625 |
-
}
|
626 |
-
if(selectedOption.value == 'ds8'){
|
627 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/dream'
|
628 |
-
if(step.value>50){
|
629 |
-
step.value = 50
|
630 |
-
}
|
631 |
-
|
632 |
-
}
|
633 |
-
if(selectedOption.value == 'ra'){
|
634 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/playground'
|
635 |
-
|
636 |
-
}
|
637 |
-
if(selectedOption.value == 'ar'){
|
638 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
|
639 |
-
|
640 |
-
}
|
641 |
-
if(selectedOption.value == 'er'){
|
642 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/pixart'
|
643 |
-
|
644 |
-
}
|
645 |
-
if(selectedOption.value == 'anything'){
|
646 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/anything'
|
647 |
-
|
648 |
-
}
|
649 |
-
if(selectedOption.value == 'focus'){
|
650 |
-
url = 'https://flask-hello-world-murex-sigma.vercel.app/focus'
|
651 |
-
url2 = 'https://flask-hello-world-murex-sigma.vercel.app/foocus'
|
652 |
-
isf = true
|
653 |
-
}
|
654 |
-
}
|
655 |
-
negative_prompt = nps
|
656 |
-
btn.disabled = true
|
657 |
-
const div = document.getElementById('imshow');
|
658 |
-
div.innerHTML = '';
|
659 |
-
document.getElementById('imshow').innerHTML = ''
|
660 |
-
let pi = document.createElement('p')
|
661 |
-
pi.innerText = 'Generating Image... generation Usually Complete Within 15 seconds'
|
662 |
document.getElementById('imshow').append(pi)
|
663 |
let count = 0;
|
664 |
seed = seed
|
@@ -767,10 +671,11 @@ final1()
|
|
767 |
|
768 |
}
|
769 |
|
|
|
|
|
770 |
</script>
|
771 |
|
772 |
|
773 |
|
774 |
</body>
|
775 |
</html>
|
776 |
-
|
|
|
562 |
div.innerHTML = '';
|
563 |
document.getElementById('imshow').innerHTML = ''
|
564 |
let pi = document.createElement('p')
|
565 |
+
pi.innerText = 'Generating Image... Estimated Time: 30s'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
566 |
document.getElementById('imshow').append(pi)
|
567 |
let count = 0;
|
568 |
seed = seed
|
|
|
671 |
|
672 |
}
|
673 |
|
674 |
+
|
675 |
+
|
676 |
</script>
|
677 |
|
678 |
|
679 |
|
680 |
</body>
|
681 |
</html>
|
|