|
<!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> |
|
|
|
.progress-container { |
|
width: 100%; |
|
background-color: #f3f3f3; |
|
border-radius: 40px; |
|
overflow: hidden; |
|
margin-top: 30px; |
|
} |
|
.progress-bar { |
|
width: 0%; |
|
height: 28px; |
|
background-color: #000000; |
|
text-align: center; |
|
line-height: 20px; |
|
color: white; |
|
transition: width 20s; |
|
} |
|
</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; |
|
background-repeat: no-repeat; |
|
color: #333; |
|
} |
|
|
|
body { |
|
margin: 0; |
|
} |
|
|
|
#main { |
|
display: flex; |
|
flex-direction: column; |
|
margin: 70px auto; |
|
width: 80%; |
|
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 #000000; |
|
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: #000000; |
|
border: 0px solid #000000; |
|
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:-400px; |
|
max-width: 500px; |
|
width: 80%; |
|
} |
|
|
|
dialog::backdrop { |
|
background: rgba(0, 0, 0, 0.5); |
|
} |
|
|
|
#dialog p { |
|
font-size: 17px; |
|
font-weight: 400; |
|
color: #000000; |
|
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: #000000; |
|
color: #fff; |
|
margin-right: 10px; |
|
} |
|
|
|
#close { |
|
background-color: #000000; |
|
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: #000000; |
|
border: 1px solid #000000; |
|
border-radius: 6px; |
|
font-size: 13px; |
|
cursor: pointer; |
|
font-family: 'Poppins', sans-serif; |
|
} |
|
|
|
#jd:hover { |
|
background: #000000; |
|
color: #fff; |
|
} |
|
|
|
#ow { |
|
float: right; |
|
margin: 10px; |
|
padding: 10px; |
|
background-color: #fff; |
|
color: #000000; |
|
border: 1px solid #000000; |
|
border-radius: 6px; |
|
cursor: pointer; |
|
} |
|
|
|
#ow:hover { |
|
background: #000000; |
|
color: #fff; |
|
} |
|
|
|
#ad { |
|
display: flex; |
|
flex-direction: row; |
|
} |
|
|
|
#fk { |
|
width: 250px; |
|
margin-bottom: 0px; |
|
padding: 0px; |
|
} |
|
|
|
</style> |
|
<title>OptiRealism 4K</title> |
|
</head> |
|
<body> |
|
<div id="dvv"> |
|
<button id="jd"><i class="fab fa-discord"></i> Discord</button> |
|
|
|
</div> |
|
|
|
<div id="main"> |
|
<div id="cont"> |
|
<input type="text" name="" id="inp" placeholder="Enter Prompt here.."> |
|
<button id="create">Generate</button> |
|
</div> |
|
|
|
<div id="as"> |
|
<select name="" id="model"> |
|
<option value="realX" class="mod">OptiRealism 4K</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>Default</p><input type="radio" name="style" value="fumes" id="fumes"> |
|
<p>More 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"> |
|
</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/YkmkHq8k') |
|
} |
|
|
|
|
|
|
|
|
|
|
|
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, unrealistic, semi semi realistic, 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, portrait photo,(high detailed skin:1. 2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm' |
|
nps = ' , realistic image, deformed fingers,mutated hands,realistic 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, unrealistic, 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 = ' ,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, Unrealistic, 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 = ''; |
|
|
|
|
|
let pi = document.createElement('div'); |
|
pi.classList.add('progress-container'); |
|
|
|
|
|
let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); |
|
svg.setAttribute("class", "progress-circle"); |
|
svg.setAttribute("viewBox", "0 0 100 100"); |
|
|
|
|
|
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"); |
|
|
|
|
|
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"); |
|
progressArc.setAttribute("stroke-dashoffset", "283"); |
|
|
|
svg.appendChild(bgCircle); |
|
svg.appendChild(progressArc); |
|
pi.appendChild(svg); |
|
div.appendChild(pi); |
|
|
|
|
|
let progress = 0; |
|
let interval = setInterval(() => { |
|
progress += 5; |
|
if (progress <= 100) { |
|
progressArc.style.strokeDashoffset = 283 - (283 * progress / 100); |
|
} else { |
|
clearInterval(interval); |
|
} |
|
}, 100); |
|
|
|
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 |
|
|
|
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; |
|
|
|
|
|
setTimeout(() => { |
|
progressBar.style.width = '100%'; |
|
}, 100); |
|
|
|
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!!' |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 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> |
|
|