yasir commited on
Commit
eea38a5
1 Parent(s): 258c669

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +251 -253
script.js CHANGED
@@ -1,275 +1,273 @@
1
  document.getElementById('jd').onclick = ()=>{
2
- window.open('https://discord.gg/ju4yQBfQ7p')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
- /*document.getElementById('ow').onclick = ()=>{
5
- window.open('https://www.buymeacoffee.com/mygx')
6
- }*/
7
- document.getElementById('fumes').checked = true
8
- alert('the site is under maintenance it will be fixed under 24 hours please be patient! ')
9
- let dialog = document.getElementById('dialog')
10
- let openbtn = document.getElementById('Advance Setting')
11
- let closebtn = document.getElementById('close')
12
- openbtn.onclick = ()=>{
13
- dialog.show()
14
- document.getElementById('imshow').style.border = '0px solid black transparent'
15
  }
16
- closebtn.onclick= ()=>{
17
- dialog.close()
18
- document.getElementById('imshow').style.background = 'linear-gradient(black, black) padding-box,linear-gradient(to right, red, blue) border-box'
 
19
  }
20
- let inp = document.getElementById('inp')
21
- let np = document.getElementById('np')
22
- let gd = document.getElementById('gds')
23
- let step = document.getElementById('step')
24
- let seed = document.getElementById('seed')
25
- let seedp = document.getElementById('seedp')
26
- let stepp = document.getElementById('stepp')
27
- let gdsp = document.getElementById('gdsp')
28
- let btn = document.getElementById('create')
29
- gd.addEventListener('input',()=>{
30
- gdsp.innerText = gd.value
31
- })
32
- step.addEventListener('input',()=>{
33
- stepp.innerText = step.value
34
- })
35
- seed.addEventListener('input',()=>{
36
- seedp.innerText = seed.value
37
- })
38
- isFumes = true
39
- let prompt = ',RAW photo,dynamic lights, photorealistic, extremely detailed informations, hyper:realistic,analog film,cinematic,best colors,mind blowing, extra ordinary art'
40
- 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'
41
- document.getElementById('styles').onchange = ()=>{
42
- const selectedStyle = document.querySelector('input[name="style"]:checked');
43
- if(selectedStyle.value =='photo'){
44
- isFumes = false
45
- prompt = ' ,RAW photo, portrait photo,(high detailed skin:1. 2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm'
46
- 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'
47
- }
48
- if(selectedStyle.value == 'cinema'){
49
- isFumes = false
50
- prompt = ' ,cinematic film still awardwinning photo, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy'
51
- 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'
52
- }
53
- if(selectedStyle.value == 'real'){
54
- isFumes = false
55
- 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'
56
- 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'
57
- }
58
- if(selectedStyle.value == 'fantasy'){
59
- isFumes = false
60
- prompt = ' ,centered shot, wide angle, full body, dd, fantasy, highly detailed, digital painting, artstation, smooth, sharp focus, digital art'
61
- 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'
62
- }
63
- if(selectedStyle.value == 'anime'){
64
- isFumes = false
65
- prompt = ' ,masterpiece,HDR,anime,anime style,beuatiful anime'
66
- 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'
67
- }
68
- if(selectedStyle.value == 'fumes'){
69
- isFumes = true
70
- let prompt = ' ,RAW photo,dynamic lights, photorealistic, extremely detailed informations, dynamic colors,realistic,SciFi,award winning photography,film grain,beautiful,attarctive'
71
- let nps = ' ,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'
72
- }
73
- if(selectedStyle.value == 'no'){
74
- prompt = ''
75
- nps = ''
76
- isFumes = false
77
- }
78
  }
79
- isf = false
80
- let fullPrompt = inp.value+prompt
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
- btn.onclick = async ()=>{
83
- if(isFumes == true){
84
- fullPrompt = inp.value
85
- const div = document.getElementById('imshow');
86
- div.innerHTML = '';
87
- document.getElementById('imshow').innerHTML = ''
88
- let pi = document.createElement('p')
89
- pi.innerText = 'Generating Image... Estimated Time: 50s'
90
- document.getElementById('imshow').append(pi)
91
- let chatId = Math.floor(Math.random() * 99999999) + 1;
92
- let data = {
93
- prompt: inp.value
94
  };
95
  await fetch('https://l-d83c.onrender.com/generate', {
96
- method: 'POST',
97
- headers: {
98
- 'Content-Type': 'application/json'
99
- },
100
- body: JSON.stringify(data)
101
  })
102
  .then(response => response.json())
103
  .then(data =>{
104
- fullPrompt=data.result
105
  })
106
  .catch((error) => {
107
- console.error('Error:', error);
108
  });
109
 
110
- }
111
- else{
112
- fullPrompt = inp.value+prompt
113
- }
114
 
115
 
116
 
117
- let url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/get_prediction'
118
- let idlist = []
119
- url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
120
- var selectElement = document.getElementById("model");
121
- var selectedIndex = selectElement.selectedIndex;
122
- if (selectedIndex === -1) {
123
- console.log("No option is selected.");
124
- } else {
125
- var selectedOption = selectElement.options[selectedIndex];
126
-
127
- if(selectedOption.value == 'rv6'){
128
- url = 'https://flask-hello-world-murex-sigma.vercel.app/proteus'
129
-
 
 
 
 
 
130
  }
131
- if(selectedOption.value == 'ds8'){
132
- url = 'https://flask-hello-world-murex-sigma.vercel.app/dream'
133
- if(step.value>50){
134
- step.value = 50
135
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
 
137
- }
138
- if(selectedOption.value == 'ra'){
139
- url = 'https://flask-hello-world-murex-sigma.vercel.app/playground'
140
 
141
- }
142
- if(selectedOption.value == 'ar'){
143
- url = 'https://flask-hello-world-murex-sigma.vercel.app/predict'
144
-
145
- }
146
- if(selectedOption.value == 'er'){
147
- url = 'https://flask-hello-world-murex-sigma.vercel.app/pixart'
148
-
149
- }
150
- if(selectedOption.value == 'anything'){
151
- url = 'https://flask-hello-world-murex-sigma.vercel.app/anything'
152
-
153
- }
154
- if(selectedOption.value == 'focus'){
155
- url = 'https://flask-hello-world-murex-sigma.vercel.app/focus'
156
- url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/foocus'
157
- isf = true
158
- }
159
- }
160
- negative_prompt = nps
161
- btn.disabled = true
162
- const div = document.getElementById('imshow');
163
- div.innerHTML = '';
164
- document.getElementById('imshow').innerHTML = ''
165
- let pi = document.createElement('p')
166
- pi.innerText = 'Generating Image... Estimated Time: 50s'
167
- document.getElementById('imshow').append(pi)
168
- let count = 0;
169
- seed = seed
170
- async function generate(){
171
-
172
- const params = {
173
- 'prompt': fullPrompt,
174
- 'negative_prompt': np.value+nps,
175
- "steps": step.value,
176
- 'gd': gd.value
177
- };
178
-
179
- try {
180
- const response = await fetch(url, {
181
- method: 'POST',
182
- headers: {
183
- 'Content-Type': 'application/json',
184
- 'Connection': 'keep-alive',
185
- },
186
- body: JSON.stringify(params)
187
- });
188
- /* console.log(np.value)
189
- const imgData = await response.text();
190
- const div = document.getElementById('imshow')
191
- const img = document.createElement('img');
192
- pi.innerHTML = ''
193
- pi.innerText = ''
194
- img.src = imgData;
195
- div.appendChild(img);
196
- */
197
-
198
- const imgData = await response.text();
199
- idlist.push(imgData)
200
-
201
-
202
- } catch (error) {
203
  btn.disabled = false
204
- console.error('An error occurred:', error);
205
- pi.innerText = 'An error occurred, try changing your prompt';
206
- }
207
- }
208
-
209
- await Promise.all([generate(), generate()]);
210
-
211
- setTimeout(()=>{
212
- function final2(){
213
- const id = idlist[1].trim().replace(/^"|"$/g, '');
214
- fetch(url2, {
215
- method: 'POST',
216
- headers: {
217
- 'Content-Type': 'application/json',
218
- },
219
- body: JSON.stringify({
220
- id: id,
221
- }),
222
- })
223
- .then((response) => response.text())
224
- .then((data) => {
225
- const img = document.createElement('img');
226
- pi.innerHTML = ''
227
- pi.innerText = ''
228
- img.src = data.trim().replace(/^"|"$/g, '');
229
- div.appendChild(img);
230
- btn.disabled = false
231
- console.log(data)
232
- })
233
- .catch((error) =>{
234
- btn.disabled = false
235
- console.error('An error occurred:', error);
236
- pi.innerText = 'An error occurred, try changing your prompt';
237
- });
238
- }
239
- function final1(){
240
- const id = idlist[0].trim().replace(/^"|"$/g, '');
241
- fetch(url2, {
242
- method: 'POST',
243
- headers: {
244
- 'Content-Type': 'application/json',
245
- },
246
- body: JSON.stringify({
247
- id: id,
248
- }),
249
- })
250
- .then((response) => response.text())
251
- .then((data) => {
252
- const img = document.createElement('img');
253
- pi.innerHTML = ''
254
- pi.innerText = ''
255
- img.src = data.trim().replace(/^"|"$/g, '');
256
- div.appendChild(img);
257
- btn.disabled = false
258
- console.log(data)
259
- })
260
-
261
- .catch((error) => {
262
- btn.disabled = false
263
- console.error('An error occurred:', error);
264
- pi.innerText = 'An error occurred, try changing your prompt';
265
- });
266
- }
267
-
268
- final2()
269
- final1()
270
- },15000)
271
-
272
-
273
-
274
- }
275
-
 
1
  document.getElementById('jd').onclick = ()=>{
2
+ window.open('https://discord.gg/ju4yQBfQ7p')
3
+ }
4
+
5
+ /*document.getElementById('ow').onclick = ()=>{
6
+ window.open('https://www.buymeacoffee.com/mygx')
7
+ }*/
8
+ document.getElementById('fumes').checked = true
9
+ let dialog = document.getElementById('dialog')
10
+ let openbtn = document.getElementById('Advance Setting')
11
+ let closebtn = document.getElementById('close')
12
+ openbtn.onclick = ()=>{
13
+ dialog.show()
14
+ document.getElementById('imshow').style.border = '0px solid black transparent'
15
+ }
16
+ closebtn.onclick= ()=>{
17
+ dialog.close()
18
+ document.getElementById('imshow').style.background = 'linear-gradient(black, black) padding-box,linear-gradient(to right, red, blue) border-box'
19
+ }
20
+ let inp = document.getElementById('inp')
21
+ let np = document.getElementById('np')
22
+ let gd = document.getElementById('gds')
23
+ let step = document.getElementById('step')
24
+ let seed = document.getElementById('seed')
25
+ let seedp = document.getElementById('seedp')
26
+ let stepp = document.getElementById('stepp')
27
+ let gdsp = document.getElementById('gdsp')
28
+ let btn = document.getElementById('create')
29
+ gd.addEventListener('input',()=>{
30
+ gdsp.innerText = gd.value
31
+ })
32
+ step.addEventListener('input',()=>{
33
+ stepp.innerText = step.value
34
+ })
35
+ seed.addEventListener('input',()=>{
36
+ seedp.innerText = seed.value
37
+ })
38
+ isFumes = true
39
+ let prompt = ',RAW photo,dynamic lights, photorealistic, extremely detailed informations, hyper:realistic,analog film,cinematic,best colors,mind blowing, extra ordinary art'
40
+ 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'
41
+ document.getElementById('styles').onchange = ()=>{
42
+ const selectedStyle = document.querySelector('input[name="style"]:checked');
43
+ if(selectedStyle.value =='photo'){
44
+ isFumes = false
45
+ prompt = ' ,RAW photo, portrait photo,(high detailed skin:1. 2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm'
46
+ 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'
47
  }
48
+ if(selectedStyle.value == 'cinema'){
49
+ isFumes = false
50
+ prompt = ' ,cinematic film still awardwinning photo, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy'
51
+ 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'
 
 
 
 
 
 
 
52
  }
53
+ if(selectedStyle.value == 'real'){
54
+ isFumes = false
55
+ 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'
56
+ 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'
57
  }
58
+ if(selectedStyle.value == 'fantasy'){
59
+ isFumes = false
60
+ prompt = ' ,centered shot, wide angle, full body, dd, fantasy, highly detailed, digital painting, artstation, smooth, sharp focus, digital art'
61
+ 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'
62
+ }
63
+ if(selectedStyle.value == 'anime'){
64
+ isFumes = false
65
+ prompt = ' ,masterpiece,HDR,anime,anime style,beuatiful anime'
66
+ 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'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
+ if(selectedStyle.value == 'fumes'){
69
+ isFumes = true
70
+ let prompt = ' ,RAW photo,dynamic lights, photorealistic, extremely detailed informations, dynamic colors,realistic,SciFi,award winning photography,film grain,beautiful,attarctive'
71
+ let nps = ' ,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'
72
+ }
73
+ if(selectedStyle.value == 'no'){
74
+ prompt = ''
75
+ nps = ''
76
+ isFumes = false
77
+ }
78
+ }
79
+
80
+ isf = false
81
+ let fullPrompt = inp.value+prompt
82
 
83
+ btn.onclick = async ()=>{
84
+ if(isFumes == true){
85
+ fullPrompt = inp.value
86
+ const div = document.getElementById('imshow');
87
+ div.innerHTML = '';
88
+ document.getElementById('imshow').innerHTML = ''
89
+ let pi = document.createElement('p')
90
+ pi.innerText = 'Generating Image... Estimated Time: 20s'
91
+ document.getElementById('imshow').append(pi)
92
+ let chatId = Math.floor(Math.random() * 99999999) + 1;
93
+ let data = {
94
+ prompt: inp.value+prompt
95
  };
96
  await fetch('https://l-d83c.onrender.com/generate', {
97
+ method: 'POST',
98
+ headers: {
99
+ 'Content-Type': 'application/json'
100
+ },
101
+ body: JSON.stringify(data)
102
  })
103
  .then(response => response.json())
104
  .then(data =>{
105
+ fullPrompt=data.result
106
  })
107
  .catch((error) => {
108
+ console.error('Error:', error);
109
  });
110
 
111
+ }
112
+ else{
113
+ fullPrompt = inp.value+prompt
114
+ }
115
 
116
 
117
 
118
+ let url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/sdxl'
119
+ let idlist = []
120
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/fsdxl'
121
+ var selectElement = document.getElementById("model");
122
+ var selectedIndex = selectElement.selectedIndex;
123
+ if (selectedIndex === -1) {
124
+ console.log("No option is selected.");
125
+ } else {
126
+ var selectedOption = selectElement.options[selectedIndex];
127
+
128
+ if(selectedOption.value == 'rv6'){
129
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/proteus'
130
+
131
+ }
132
+ if(selectedOption.value == 'ds8'){
133
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/dream'
134
+ if(step.value>50){
135
+ step.value = 50
136
  }
137
+
138
+ }
139
+ if(selectedOption.value == 'ra'){
140
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/playground'
141
+
142
+ }
143
+ if(selectedOption.value == 'ar'){
144
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/fsdxl'
145
+
146
+ }
147
+ if(selectedOption.value == 'er'){
148
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/pixart'
149
+
150
+ }
151
+ if(selectedOption.value == 'anything'){
152
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/anything'
153
+
154
+ }
155
+ if(selectedOption.value == 'focus'){
156
+ url = 'https://flask-hello-world-murex-sigma.vercel.app/focus'
157
+ url2 = 'https://hacking-is-serious-illegal-crime-you.onrender.com/foocus'
158
+ isf = true
159
+ }
160
+ }
161
+ negative_prompt = nps
162
+ btn.disabled = true
163
+ const div = document.getElementById('imshow');
164
+ div.innerHTML = '';
165
+ document.getElementById('imshow').innerHTML = ''
166
+ let pi = document.createElement('p')
167
+ pi.innerText = 'Generating Image... Estimated Time: 20s'
168
+ document.getElementById('imshow').append(pi)
169
+ let count = 0;
170
+ seed = seed
171
+ async function generate(){
172
+
173
+ const params = {
174
+ 'prompt': fullPrompt,
175
+ 'negative_prompt': np.value+nps,
176
+ "steps": step.value,
177
+ 'gd': gd.value
178
+ };
179
+
180
+ try {
181
+ const response = await fetch(url, {
182
+ method: 'POST',
183
+ headers: {
184
+ 'Content-Type': 'application/json',
185
+ 'Connection': 'keep-alive',
186
+ },
187
+ body: JSON.stringify(params)
188
+ });
189
+ /* console.log(np.value)
190
+ const imgData = await response.text();
191
+ const div = document.getElementById('imshow')
192
+ const img = document.createElement('img');
193
+ pi.innerHTML = ''
194
+ pi.innerText = ''
195
+ img.src = imgData;
196
+ div.appendChild(img);
197
+ */
198
 
199
+ const imgData = await response.text();
200
+ idlist.push(imgData)
 
201
 
202
+
203
+ } catch (error) {
204
+ btn.disabled = false
205
+ console.error('An error occurred:', error);
206
+ pi.innerText = 'An error occurred, try changing your prompt';
207
+ }
208
+ }
209
+
210
+ await Promise.all([generate(), generate()]);
211
+
212
+ setTimeout(()=>{
213
+ function final2(){
214
+ const id = idlist[1].trim().replace(/^"|"$/g, '');
215
+ fetch(url2, {
216
+ method: 'POST',
217
+ headers: {
218
+ 'Content-Type': 'application/json',
219
+ },
220
+ body: JSON.stringify({
221
+ id: id,
222
+ }),
223
+ })
224
+ .then((response) => response.text())
225
+ .then((data) => {
226
+ const img = document.createElement('img');
227
+ pi.innerHTML = ''
228
+ pi.innerText = ''
229
+ img.src = data.trim().replace(/^"|"$/g, '');
230
+ div.appendChild(img);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  btn.disabled = false
232
+ console.log(data)
233
+ })
234
+ .catch((error) =>{
235
+ btn.disabled = false
236
+ console.error('An error occurred:', error);
237
+ pi.innerText = 'An error occurred, try changing your prompt';
238
+ });
239
+ }
240
+ function final1(){
241
+ const id = idlist[0].trim().replace(/^"|"$/g, '');
242
+ fetch(url2, {
243
+ method: 'POST',
244
+ headers: {
245
+ 'Content-Type': 'application/json',
246
+ },
247
+ body: JSON.stringify({
248
+ id: id,
249
+ }),
250
+ })
251
+ .then((response) => response.text())
252
+ .then((data) => {
253
+ const img = document.createElement('img');
254
+ pi.innerHTML = ''
255
+ pi.innerText = ''
256
+ img.src = data.trim().replace(/^"|"$/g, '');
257
+ div.appendChild(img);
258
+ btn.disabled = false
259
+ console.log(data)
260
+ })
261
+
262
+ .catch((error) => {
263
+ btn.disabled = false
264
+ console.error('An error occurred:', error);
265
+ pi.innerText = 'An error occurred, try changing your prompt';
266
+ });
267
+ }
268
+
269
+ final2()
270
+ final1()
271
+ },10000)
272
+
273
+ }