Spaces:
Running
Running
File size: 27,149 Bytes
3c12b39 0ff302f 3c12b39 7548ce7 3c12b39 bedeeed 3c12b39 7548ce7 3c12b39 686a091 3c12b39 d9e92b1 3c12b39 d9e92b1 3c12b39 0fc653e 3c12b39 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 |
<!DOCTYPE html>
<html lang="en">
<head>
<script id="aclib" type="text/javascript" src="//acscdn.com/script/aclib.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" />
<style>
/* Styling for the progress bar */
.progress-container {
width: 100%;
background-color: #f3f3f3;
border-radius: 40px;
overflow: hidden;
margin-top: 30px;
}
.progress-bar {
width: 0%;
height: 25px;
background-color: #36454F;
text-align: center;
line-height: 20px;
color: white;
transition: width 20s; /* Simulate loading time */
}
</style>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
html, body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
background-image: url('');
background-size: cover; /* Ensures the image covers the entire background */
background-repeat: no-repeat; /* Prevents the image from repeating */
color: #333;
}
body {
margin: 0;
}
#main {
display: flex;
flex-direction: column;
margin: 70px auto;
width: 100%;
max-width: 1200px;
}
#cont {
background-color: #fff;
padding: 0;
border-radius: 00px;
box-shadow: 0 4px 12px rgba(3, 4, 1, 0.1);
display: flex;
align-items: center;
border: 1px solid #36454F;
width: 100%;
max-width: 600px;
height: 60px;
margin: auto;
margin-top: 20px;
margin-bottom: 30px;
font-family: 'Poppins', sans-serif;
}
#inp {
flex-grow: 1;
padding: 10px;
margin: 10px;
background: transparent;
border: none;
color: #333;
outline: none;
font-size: 16px;
font-family: 'Poppins', sans-serif;
}
#cont button {
padding: 15px 20px;
margin: 0px;
background: #36454F;
border: 0px solid #36454F;
border-radius: 0px;
color: #fff;
cursor: pointer;
font-size: 18px;
white-space: nowrap;
font-family: 'Poppins', sans-serif;
}
#cont button:hover {
background: #081112;
}
#as {
display: flex;
flex-direction: row;
width: 100%;
max-width: 600px;
margin: auto;
justify-content: space-between;
font-family: 'Poppins', sans-serif;
}
#as button, #model {
background-color: #fff;
border: 1px solid #ddd;
padding: 10px 20px;
font-size: 15px;
color: #333;
cursor: pointer;
border-radius: 0px;
transition: box-shadow 0.3s ease-in-out;
font-family: 'Poppins', sans-serif;
}
#as button:hover, #model:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
@media only screen and (max-width: 600px) {
#cont {
flex-direction: column;
align-items: stretch;
height: 110px;
}
#inp, #cont button {
width: 100%;
box-sizing: border-box;
}
#as {
flex-direction: column;
align-items: stretch;
width: 90%;
}
#as button, #model {
width: 100%;
box-sizing: border-box;
margin-top: 10px;
font-family: 'Poppins', sans-serif;
}
}
@media only screen and (max-width: 365px) {
#cont {
width: 94%;
}
#main {
width: 94%;
}
#as {
width: 94%;
}
}
dialog {
background: #fff;
border-radius: 0px;
border: 1px solid #ddd;
padding: px;
margin: px;
margin-top:-350px;
max-width: 500px;
width: 80%;
}
dialog::backdrop {
background: rgba(0, 0, 0, 0.5);
}
#dialog p {
font-size: 17px;
font-weight: 400;
color: #36454F;
margin-bottom: 15px;
font-family: 'Poppins', sans-serif;
}
#styles {
display: flex;
flex-direction: row;
gap: 6px;
color: #333;
font-size: 10px;
flex-wrap: wrap;
}
#sli {
display: flex;
flex-direction: row;
align-items: center;
color: #333;
margin-bottom: 1px;
}
label {
font-size: 15px;
margin-right: 10px;
font-family: 'Poppins', sans-serif;
}
#sli input[type="text"] {
border: 1px solid #ddd;
outline: none;
border-radius: ppx;
padding: 10px 10px;
background-color: #fff;
color: #333;
font-size: 14px;
flex-grow: 1;
}
#sli input[type="range"] {
flex-grow: 1;
}
#Apply, #close {
padding: 10px 20px;
border: none;
font-weight: 600;
font-size: 14px;
border-radius: 6px;
cursor: pointer;
}
#Apply {
background-color: #36454F;
color: #fff;
margin-right: 10px;
}
#close {
background-color: #36454F;
color: #fff;
font-family: 'Poppins', sans-serif;
}
#imshow {
width: 100%;
max-width: 600px;
display: flex;
flex-direction: column;
margin: auto;
gap: 1px;
margin-top: 0px;
padding: 10px;
background: #fff;
border: 1px solid #ddd;
border-radius: 8px;
overflow-y: auto;
}
#imshow img {
width: 100%;
height: auto;
border-radius: 0px;
}
#imshow p {
color: #333;
margin: auto;
font-size: 18px;
text-align: center;
}
@media screen and (min-width: 500px) and (max-width: 720px) {
dialog {
max-width: 420px;
}
#imshow {
width: 100%;
height: auto;
}
#cont {
height: auto;
}
}
@media screen and (max-width: 500px) {
dialog {
max-width: 300px;
}
#imshow {
width: 90%;
height: auto;
}
#jd {
font-size: 14px;
}
#imshow p {
width: 80%;
}
}
#jd {
margin: 20px;
padding: 10px;
background-color: #fff;
color: #36454F;
border: 1px solid #36454F;
border-radius: 6px;
font-size: 13px;
cursor: pointer;
font-family: 'Poppins', sans-serif;
}
#jd:hover {
background: #36454F;
color: #fff;
}
#ow {
float: right;
margin: 10px;
padding: 10px;
background-color: #fff;
color: #36454F;
border: 1px solid #36454F;
border-radius: 6px;
cursor: pointer;
}
#ow:hover {
background: #36454F;
color: #fff;
}
#ad {
display: flex;
flex-direction: row;
}
#fk {
width: 250px;
margin-bottom: 0px;
padding: 0px;
}
</style>
<title>Dalle Realism 4K</title>
</head>
<body>
<div id="dvv">
<button id="jd"><i class="fab fa-discord"></i> Join Discord</button>
<!-- <button id="ow">Donate</button> -->
</div>
<div id="main">
<div id="cont">
<input type="text" name="" id="inp" placeholder="Enter Prompt here..">
<button id="create">Create</button>
</div>
<div id="as">
<select name="" id="model">
<option value="realX" class="mod">Dalle Realism V3</option>
</select>
<div id="Advance Setting">
<button>More Settings</button>
</div>
</div>
</div>
<dialog id="dialog">
<p style="font-size: 20px; font-family: 'Poppins', sans-serif; margin: 0px; color: #000;">Styles:</p>
<div id="styles">
<p>Original</p><input type="radio" name="style" value="fumes" id="fumes">
<p>Hyper Realistic</p><input type="radio" name="style" value="real">
<p>Photography</p><input type="radio" name="style" value="photo">
<p>Cinematic</p><input type="radio" name="style" value="cinema">
<p>Fantasy</p><input type="radio" name="style" value="fantasy">
</div>
<br><br>
<div id="sli">
<label for="#np" style="margin-bottom: 15px;">Negative Prompt: </label>
<input type="text" placeholder="" id="np" style="margin-bottom: 15px;">
</div>
<div id="sli">
<label for="#gds">Guidance Scale: </label>
<input type="range" id="gds" value="20" min="5" max="20" step="1"><p id="gdsp">20</p>
</div>
<div id="sli">
<label for="#step">Steps: </label>
<input type="range" id="step" value="30" min="30" max="100" step="1"><p id="stepp">30</p>
</div>
<div id="sli">
<label for="#gds">Seed: </label>
<input type="range" id="seed" min="0" value="0" step="1" max="99999"><p id="seedp">0</p>
</div>
<button id="close">Close</button>
</dialog>
<div id="imshow">
<p style="width: 220px;">Your Generated Arts Will Appear Here</p>
</div>
<script>
document.getElementById('jd').onclick = ()=>{
window.open('https://discord.com/invite/EM4uHQrakm')
}
/*document.getElementById('ow').onclick = ()=>{
window.open('https://www.buymeacoffee.com/mygx')
}*/
document.getElementById('fumes').checked = true
let dialog = document.getElementById('dialog')
let openbtn = document.getElementById('Advance Setting')
let closebtn = document.getElementById('close')
openbtn.onclick = ()=>{
dialog.show()
document.getElementById('imshow').style.border = '0px solid black transparent'
}
closebtn.onclick= ()=>{
dialog.close()
document.getElementById('imshow').style.background = 'linear-gradient(white, white) padding-box,linear-gradient(to right, red, blue) border-box'
}
let inp = document.getElementById('inp')
let np = document.getElementById('np')
let gd = document.getElementById('gds')
let step = document.getElementById('step')
let seed = document.getElementById('seed')
let seedp = document.getElementById('seedp')
let stepp = document.getElementById('stepp')
let gdsp = document.getElementById('gdsp')
let btn = document.getElementById('create')
gd.addEventListener('input',()=>{
gdsp.innerText = gd.value
})
step.addEventListener('input',()=>{
stepp.innerText = step.value
})
seed.addEventListener('input',()=>{
seedp.innerText = seed.value
})
isFumes = true
let prompt = ',RAW photo, 3d cartoon, unrealistic, extremely detailed informations,HIGHLY INTRICATE DETAILS,EXTREMELY MASTERPIECE'
let nps = ' , realistic, close shot, (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3),poorly drawn,deformed hands,deformed fingers,deformed faces,deformed eyes,mutated fingers,deformedbody parts,mutated body parts,mutated hands, disfigured,oversaturated,bad anatom,cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, deformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck,deformed eyes'
document.getElementById('styles').onchange = ()=>{
const selectedStyle = document.querySelector('input[name="style"]:checked');
if(selectedStyle.value =='photo'){
isFumes = true
prompt = ' ,RAW photo, unrealistic photo,(high detailed skin:1. 2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm'
nps = ' ,deformed fingers,mutated hands,unrealistic hands,extra fingers,less fingers,mutated eyes,malformed hands,malformed fingers,malformed faces,malfromed eyes,malformed body parts,mutated body parts,mutated fingers,mutated hands,(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck'
}
if(selectedStyle.value == 'cinema'){
isFumes = true
prompt = ' ,cinematic film still awardwinning photo, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy'
nps = ' ,deformed fingers,mutated hands,unrealistic hands,extra fingers,less fingers,mutated eyes,malformed hands,malformed fingers,malformed faces,malfromed eyes,malformed body parts,mutated body parts,mutated fingers,mutated hands,(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck'
}
if(selectedStyle.value == 'real'){
isFumes = true
prompt = ' , unrealistic, RAW candid cinema,Modern colors, beautiful,attractive,color graded portra 400 film, remarkable color, semi realistic, textured skin, remarkable detailed pupils, semi realistic dull skin noise, visible skin detail, skin fuzz, dry skin, sun soaked colors'
nps = ' ,deformed fingers,mutated hands,unrealistic hands,extra fingers,less fingers,mutated eyes,malformed hands,malformed fingers,malformed faces,malfromed eyes,malformed body parts,mutated body parts,mutated fingers,mutated hands,poorly drawn,lowres, disfigured,bad anatomy,deformed body features ,cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck,deformed eyes'
}
if(selectedStyle.value == 'fantasy'){
isFumes = true
prompt = ' ,centered shot, wide angle, full body, dd, fantasy, highly detailed, digital painting, artstation, smooth, sharp focus, digital art'
nps = ' ,deformed fingers,mutated hands,unrealistic hands,extra fingers,less fingers,mutated eyes,malformed hands,malformed fingers,malformed faces,malfromed eyes,malformed body parts,mutated body parts,mutated fingers,mutated hands,missing legs, missing feet, worst quality, low quality, jpeg artifacts, signature, logo, watermark, text, realistic, hyper-realistic, ultra-detailed, RAW photo'
}
if(selectedStyle.value == 'anime'){
isFumes = true
prompt = ' ,masterpiece,HDR,anime,anime style,beuatiful anime'
nps = ' ,malformed hands,malformed fingers,malformed faces,malformed body parts,mutated body parts,malfromed eyes,mutated fingers,mutated hands,realistic,worst quality, low quality, blurry, pixelated, extra limb, extra fingers, bad hand, text, name, letters, out of frame, lowres, text, error, cropped, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature'
}
if(selectedStyle.value == 'fumes'){
isFumes = true
let prompt = ' , DALLE 3 styles, Semi-Realistic, 3d, 8k, very wide shot'
let nps = ' , realistic, close shot'
}
if(selectedStyle.value == 'no'){
prompt = ''
nps = ''
isFumes = false
}
}
isf = false
let isreal = false
reload = false
let fullPrompt = inp.value+prompt
setTimeout(()=>{
reload = true
},250000)
btn.onclick = async ()=>{
let isc = false
let id = ''
if(reload == true){
window.location.reload();
}
if(isFumes == 'no'){
fullPrompt = inp.value;
const div = document.getElementById('imshow');
div.innerHTML = '';
// Create a container for the progress indicator
let pi = document.createElement('div');
pi.classList.add('progress-container');
// Create an SVG element for the circular progress bar
let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute("class", "progress-circle");
svg.setAttribute("viewBox", "0 0 100 100");
// Create the background circle
let bgCircle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
bgCircle.setAttribute("class", "progress-circle-bg");
bgCircle.setAttribute("cx", "50");
bgCircle.setAttribute("cy", "50");
bgCircle.setAttribute("r", "45");
// Create the progress arc
let progressArc = document.createElementNS("http://www.w3.org/2000/svg", "circle");
progressArc.setAttribute("class", "progress-circle-progress");
progressArc.setAttribute("cx", "50");
progressArc.setAttribute("cy", "50");
progressArc.setAttribute("r", "45");
progressArc.setAttribute("stroke-dasharray", "283"); // Circumference of a circle with radius 45 is 2 * π * 45 ≈ 283
progressArc.setAttribute("stroke-dashoffset", "283");
svg.appendChild(bgCircle);
svg.appendChild(progressArc);
pi.appendChild(svg);
div.appendChild(pi);
// Simulate the loading progress
let progress = 0;
let interval = setInterval(() => {
progress += 5; // Adjust the increment value as needed for the desired speed of progress
if (progress <= 100) {
progressArc.style.strokeDashoffset = 283 - (283 * progress / 100);
} else {
clearInterval(interval);
}
}, 100); // Start the animation
let chatId = Math.floor(Math.random() * 99999999) + 1;
let data = {
prompt: inp.value + prompt
};
await fetch('https://flask-hello-world-murex-sigma.vercel.app/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data =>{
id = data
})
.catch((error) => {
console.error('Error:', error);
});
}
else{
fullPrompt = inp.value+prompt
}
let X = false
//https://hacking-is-serious-illegal-crime-you.onrender.com/sdxl
let url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
let idlist = []
url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
var selectElement = document.getElementById("model");
var selectedIndex = selectElement.selectedIndex;
if (selectedIndex === -1) {
console.log("No option is selected.");
} else {
var selectedOption = selectElement.options[selectedIndex];
if(selectedOption.value == 'rv6'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/proteus'
isreal = false
}
if(selectedOption.value == 'ds8'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/dream'
if(step.value>50){
step.value = 50
}
isreal = false
}
if(selectedOption.value == 'ra'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/playground'
isreal = false
}
if(selectedOption.value == 'ar'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
isreal = false
}
if(selectedOption.value == 'er'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/pixart'
isreal = false
}
if(selectedOption.value == 'anything'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/anything'
isreal = false
fullPrompt = inp.value + ", anime, anime style"
}
if(selectedOption.value == 'focus'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/focus'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/foocus'
isf = true
isreal = false
}
if(selectedOption.value == 'cas'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/cascade'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/cascade'
isc = true
isreal = false
}
if(selectedOption.value == 'w'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/w'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
isreal = false
}
if(selectedOption.value == 'k'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/k'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
isreal = false
}
if(selectedOption.value == 'op'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/op'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
isreal = false
}
if(selectedOption.value == 'p3'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/p3'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
isreal = false
}
if(selectedOption.value == 'emo'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/emo'
url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
isreal = false
}
if(selectedOption.value == 'real'){
isreal = true
if(step.value>50){
step.value = 50
}
}
if(selectedOption.value == 'realX'){
isreal = true
X = true
if(step.value>50){
step.value = 50
}
}
}
let negative_prompt = nps;
btn.disabled = true;
const div = document.getElementById('imshow');
div.innerHTML = '';
let pi = document.createElement('div');
pi.classList.add('progress-container');
let progressBar = document.createElement('div');
progressBar.classList.add('progress-bar');
progressBar.innerText = 'Generating...';
pi.appendChild(progressBar);
div.appendChild(pi);
let count = 0;
seed = seed;
// Simulate the loading progress
setTimeout(() => {
progressBar.style.width = '100%';
}, 100); // Start the animation after a brief delay
if(isreal == false){
async function generate(){
params={
'prompt': fullPrompt,
'negative_prompt': np.value + nps,
'steps': step.value,
'gd': gd.value
};
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Connection': 'keep-alive',
},
body: JSON.stringify(params)
});
if (response.status === 429) {
pi.innerText = 'you have reached your limit of 50 generation per hour, you will get 50 more image generaions after an hour!!'
}
/* console.log(np.value)
const imgData = await response.text();
const div = document.getElementById('imshow')
const img = document.createElement('img');
pi.innerHTML = ''
pi.innerText = ''
img.src = imgData;
div.appendChild(img);
*/
const imgData = await response.text();
idlist.push(imgData)
} catch (error) {
btn.disabled = false
console.error('An error occurred:', error);
pi.innerText = 'An error occurred, try changing your prompt';
}
}
await Promise.all([generate()]);
setTimeout(()=>{
/* function final2(){
const id = idlist[1].trim().replace(/^"|"$/g, '');
fetch(url2, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: id,
}),
})
.then((response) => response.text())
.then((data) => {
const img = document.createElement('img');
pi.innerHTML = ''
pi.innerText = ''
img.src = data.trim().replace(/^"|"$/g, '');
div.appendChild(img);
btn.disabled = false
console.log(data)
})
.catch((error) =>{
btn.disabled = false
console.error('An error occurred:', error);
pi.innerText = 'An error occurred, try changing your prompt';
});
}*/
function final1(){
const id = idlist[0].trim().replace(/^"|"$/g, '');
fetch(url2, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: id,
}),
})
.then((response) => response.text())
.then((data) => {
const img = document.createElement('img');
pi.innerHTML = ''
pi.innerText = ''
img.src = data.trim().replace(/^"|"$/g, '');
div.appendChild(img);
btn.disabled = false
console.log(data)
})
.catch((error) => {
btn.disabled = false
console.error('An error occurred:', error);
pi.innerText = 'An error occurred, try changing your prompt';
});
}
final1()
},8000)
}
if(isreal == true){
console.log('hh')
url = 'https://hacking-is-serious-illegal-crime-you.onrender.com/real'
if(X==true){
url = 'https://hacking-is-serious-illegal-crime-you.onrender.com/realX'
console.log(8)
}
else{
url = 'https://hacking-is-serious-illegal-crime-you.onrender.com/real'
}
function final1(){
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: inp.value,
nprompt: np.value + ' , realistic, (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3),poorly drawn,deformed hands,deformed fingers,deformed faces,deformed eyes,mutated fingers,deformedbody parts,mutated body parts,mutated hands, disfigured,oversaturated,bad anatom,cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, deformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck,deformed eyes',
steps: step.value,
gd: gd.value
}),
})
.then((response) => response.text())
.then((data) => {
const img = document.createElement('img');
pi.innerHTML = ''
pi.innerText = ''
img.src = data.trim().replace(/^"|"$/g, '');
div.appendChild(img);
btn.disabled = false
console.log(data)
})
.catch((error) => {
btn.disabled = false
console.error('An error occurred:', error);
pi.innerText = 'An error occurred, please try again or use another model';
});
}
final1()
}
}
</script>
</body>
</html>
|