Spaces:
Running
Running
File size: 15,994 Bytes
5cd0fe5 fe98b62 5cd0fe5 |
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 |
document.getElementById('jd').onclick = ()=>{
window.open('https://discord.gg/ju4yQBfQ7p')
}
//@sshole
// PINK PUSSY
/*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(black, black) 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 cn = false
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 = ''
let nps = ' ,(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 = ' ,NSFW,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 = ' ,NSFW,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, 16mm, beautiful,attractive,color graded portra 400 film, remarkable color, ultra realistic, textured skin, remarkable detailed pupils, realistic dull skin noise, visible skin detail, skin fuzz, dry skin, shot with cinematic camera, sun soaked colors'
nps = ' ,NSFW,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 = ' ,NSFW,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 = ' ,NSFW,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 = ' ,RAW photo,dynamic lights, photorealistic, extremely detailed informations, dynamic colors,realistic,SciFi,award winning photography,film grain,beautiful,attarctive'
let nps = ' ,NSFW,deformed fingers,mutated hands,unrealistic hands,extra fingers,less fingers,mutated eyes,poorly drawn,malformed hands,malformed fingers,malformed faces,malformed body parts,mutated body parts,malfromed eyes,mutated fingers,mutated hands, disfigured,oversaturated,bad anatomy,deformed body features ,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, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck,deformed eyes'
}
if(selectedStyle.value == 'no'){
prompt = ''
nps = ',NSFW'
isFumes = false
}
}
isf = false
let isreal = false
reload = false
let fullPrompt = inp.value+prompt
setTimeout(()=>{
reload = true
},200000)
btn.onclick = async ()=>{
if(cn==true){
window.location.reload()
}
btn.innerText = "CANCEL"
cn = true
let isc = false
let id = ''
let url2 = 'https://flask-hello-world-murex-sigma.vercel.app/status'
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'
prompt = ',masterpiece,HDR,anime,anime style,beuatiful anime'
fullPrompt = inp.value+prompt
isreal = false
}
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'
isreal = false
}
if(selectedOption.value == 'k'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/k'
isreal = false
}
if(selectedOption.value == 'op'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/op'
isreal = false
}
if(selectedOption.value == 'p3'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/p3'
isreal = false
}
if(selectedOption.value == 'emo'){
url = 'https://flask-hello-world-murex-sigma.vercel.app/emo'
isreal = false
}
if(selectedOption.value == 'real'){
isreal = true
if(step.value>50){
step.value = 50
}
}
if(selectedOption.value == 'p4'){
isreal = false
isFumes = false
url = 'https://flask-hello-world-murex-sigma.vercel.app/p4'
}
if(selectedOption.value == 'nut'){
isreal = false
isFumes = false
url = 'https://flask-hello-world-murex-sigma.vercel.app/nut'
}
if(selectedOption.value == 'piss'){
isreal = false
isFumes = false
url = 'https://flask-hello-world-murex-sigma.vercel.app/piss'
}
}
let div = document.getElementById('imshow');
if(isFumes == true){
fullPrompt = inp.value
div.innerHTML = '';
document.getElementById('imshow').innerHTML = ''
let pi = document.createElement('p')
pi.innerText = 'Generating Image... Estimated Time: 20s'
// document.getElementById('imshow').append(pi)
let chatId = Math.floor(Math.random() * 99999999) + 1;
let data = {
prompt: inp.value+prompt
};
await fetch('https://l-d83c.onrender.com/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data =>{
fullPrompt = data.result
})
.catch((error) => {
console.error('Error:', error);
});
}
else{
fullPrompt = inp.value+prompt
}
//https://hacking-is-serious-illegal-crime-you.onrender.com/sdxl
negative_prompt = nps
div.innerHTML = '';
document.getElementById('imshow').innerHTML = ''
let pi = document.createElement('p')
pi.innerText = 'Generating Image... Estimated Time: 20s'
//document.getElementById('imshow').append(pi)
let count = 0;
seed = seed
if(isreal == false){
let progress = document.createElement('progress');
progress.value = 1;
progress.max = 100;
div.appendChild(progress);
setInterval(()=>{
progress.value+=5
console.log(progress.value)
},1100)
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(),generate()]);
/* 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';
});
}*/
let intervalId = null;
function checkProcessStatus(n) {
console.log(idlist)
const id = idlist[n].trim().replace(/^"|"$/g, '');
fetch(url2, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: id,
}),
})
.then((response) => response.json())
.then((data) => {
if (data.status == 'generating') {
console.log('in progress');
// Call the function again after a delay if the status is 'generating'
setTimeout(() => checkProcessStatus(n), 2000);
} else {
cn = false
progress.innerHTML = ''
progress.style.display = 'none'
// Process is complete, handle the data
console.log(data)
const img = document.createElement('img');
if(n==1){
img.id = "i1"
}
pi.innerHTML = '';
pi.innerText = '';
img.src = data.trim().replace(/^"|"$/g, '');
div.appendChild(img);
btn.disabled = false;
}
})
.catch((error) => {
btn.disabled = false;
console.error('An error occurred:', error);
});
}
checkProcessStatus(0);
checkProcessStatus(1);
}
} |