yasir commited on
Commit
e167b93
1 Parent(s): 6b916ca

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +645 -19
index.html CHANGED
@@ -1,19 +1,645 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
7
+ <script type='text/javascript'>
8
+ window.smartlook||(function(d) {
9
+ var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName('head')[0];
10
+ var c=d.createElement('script');o.api=new Array();c.async=true;c.type='text/javascript';
11
+ c.charset='utf-8';c.src='https://web-sdk.smartlook.com/recorder.js';h.appendChild(c);
12
+ })(document);
13
+ smartlook('init', 'ab064cf709cc86cb945d2dfb051a3a1254d7fb19', { region: 'eu' });
14
+ </script>
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css">
18
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@100&display=swap" rel="stylesheet" <meta
19
+ charset="UTF-8">
20
+ <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8419334759638161"
21
+ crossorigin="anonymous"></script>
22
+ <title>AI Image Creator</title>
23
+ <style>
24
+ html, body {
25
+ margin: 0;
26
+ padding: 0;
27
+ box-sizing: border-box;
28
+ overflow-x: hidden !important;
29
+ }
30
+ body {
31
+ background-color: #000000;
32
+ margin: 0;
33
+ }
34
+ #main {
35
+ display: flex;
36
+ flex-direction: column;
37
+ margin: 50px;
38
+ margin: auto;
39
+ }
40
+ #cont {
41
+ background-color: #030303;
42
+ padding: 0px;
43
+ border-radius: 12px;
44
+ box-shadow: 8px 8px 16px #050505, -8px -8px 16px #080808;
45
+ display: flex;
46
+ align-items: center;
47
+ background: linear-gradient(black, black) padding-box,
48
+ linear-gradient(to left, cyan, purple) border-box;
49
+ border-radius: 12px;
50
+ border: 2.5px solid transparent;
51
+ width: 70%;
52
+ height: 9vh;
53
+ margin: auto;
54
+ margin-top: 5%;
55
+ margin-bottom: 20px;
56
+ }
57
+ #inp {
58
+ flex-grow: 1;
59
+ padding: 10px;
60
+ margin: 10px;
61
+ background: transparent;
62
+ border: none;
63
+ border-radius: 8px;
64
+ box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b);
65
+ color: #fff;
66
+ outline: none;
67
+ }
68
+ #cont button {
69
+ padding: 2.5vh 4.6vh;
70
+ margin: 1vh;
71
+ background: linear-gradient(155deg, rgb(0, 149, 249), #9D00FF, rgb(255, 0, 43));
72
+ border: none;
73
+ border-radius: 8px;
74
+ color: #fff;
75
+ cursor: pointer;
76
+ }
77
+ #cont button:hover {
78
+ background: linear-gradient(145deg, #00ffab, #, rgb(255, 0, 43));
79
+ }
80
+ #as {
81
+ display: flex;
82
+ flex-direction: row;
83
+ width: 70%;
84
+ margin: auto;
85
+ justify-content: space-between;
86
+ }
87
+ #as button {
88
+ background-color: #0a0a0a;
89
+ border: none;
90
+ padding: 3vh 4.5vh;
91
+ font-size: 15px;
92
+ color: #ffffff;
93
+ cursor: pointer;
94
+ border-radius: 12px;
95
+ transition: box-shadow 0.3s ease-in-out;
96
+ }
97
+ #model{
98
+ background-color: #181717;
99
+ border: none;
100
+ padding: 3vh 4.5vh;
101
+ font-size: 15px;
102
+ color: #ffffff;
103
+ cursor: pointer;
104
+ border-radius: 12px;
105
+ transition: box-shadow 0.3s ease-in-out;
106
+
107
+ padding: 0px 0px 0px 20px ;
108
+ }
109
+ #as button:hover {
110
+ box-shadow: 15px 15px 30px #0d0d0d, -15px -15px 30px #1a1a1a; /* Adjusted shadow and highlight on hover */
111
+ }
112
+ @media only screen and (max-width: 600px) {
113
+ #cont {
114
+ width: 90%;
115
+ margin-bottom: 20px;
116
+ }
117
+ #main{
118
+ width: 90%;
119
+ }
120
+ #cont button {
121
+ padding: 15px 15px; /* Adjust button padding for smaller screens */
122
+ }
123
+ #as{
124
+ width: 88%;
125
+ }
126
+ #as button{
127
+
128
+ padding: 15px 20px; /* Adjust button padding for smaller screens */
129
+ }
130
+ .mod{
131
+
132
+ }
133
+ }
134
+ @media only screen and (max-width: 365px){
135
+ #cont{
136
+ width: 94%;
137
+ }
138
+ #main{
139
+ width: 94%;
140
+ }
141
+ #as{
142
+ width: 94%;
143
+ }
144
+ }
145
+ dialog{
146
+ background: rgba(29, 29, 29, 1);
147
+ border-radius: 16px;
148
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
149
+ margin-top: 20px;
150
+ border: 1px solid rgba(14, 13, 13, 0.3);
151
+ }
152
+ #sli{
153
+ display: flex;
154
+ flex-direction: row;
155
+ align-items: center;
156
+ color: #eeeeee;
157
+ }
158
+ label{
159
+ font-family: 'Barlow Condensed';
160
+
161
+ font-size: 21px;
162
+ margin-right: 10px;
163
+ }
164
+ #sli input{
165
+ border: 1px solid rgb(137, 9, 223);
166
+ outline: none;
167
+ border-radius: 5px;
168
+ padding: 7px 20px;
169
+ background-color: transparent ;
170
+ color: white;
171
+ font-family: 'Barlow Condensed';
172
+ }
173
+ #Apply{
174
+ background-color: rgb(0, 247, 173);
175
+ padding: 5px 10px;
176
+ border: none;
177
+ color: #000000;
178
+ font-weight:500;
179
+ font-family: Arial, Helvetica, sans-serif;
180
+ font-size: 15px;
181
+ border-radius: 4px;
182
+ }
183
+ #close{
184
+ float: right;background-color: rgb(223, 7, 79); padding: 5px 10px;
185
+ border: none;
186
+ color: #000000;
187
+ font-weight:500;
188
+ font-family: Arial, Helvetica, sans-serif;
189
+ font-size: 15px;
190
+ border-radius: 4px;
191
+ }
192
+ #styles{
193
+ display: flex;
194
+ flex-direction: row;
195
+ gap: 6px;
196
+ color: white;
197
+ font-family: 'Barlow Condensed';
198
+ font-size: 20px;
199
+ flex-wrap: wrap;
200
+
201
+ }
202
+ #imshow{
203
+
204
+ width: 56vh;
205
+ height: 54vh;
206
+ display: flex;
207
+ flex-direction: row;
208
+ overflow-y: hidden;
209
+ margin: auto;
210
+ gap: 6px;
211
+ margin-top: 30px;
212
+ padding-bottom: 4px;
213
+ background: linear-gradient(black, black) padding-box,
214
+ linear-gradient(to right, red, blue) border-box;
215
+ border-radius: 20px;
216
+ border: 2.5px solid transparent;
217
+
218
+ }
219
+ #imshow img{
220
+ width: 54vh;
221
+ height: 53vh;
222
+ margin: auto;
223
+ margin-top: 7px;
224
+ border-radius: 10px;
225
+ margin-left: 0px;
226
+ }
227
+ #imshow p{
228
+ color: white;font-family: 'Barlow Condensed'; margin: auto; font-size: 3vh;text-align: center;
229
+ }
230
+ @media screen and (min-width: 500px) and (max-width: 720px) {
231
+ dialog{
232
+
233
+ max-width: 420px;
234
+ }
235
+ #imshow{
236
+
237
+ border: 2px solid blue;
238
+ width: 400px;
239
+ height: 400px;
240
+ display: flex;
241
+ flex-direction: column;
242
+ overflow-y: scroll;
243
+ margin: auto;
244
+ background: linear-gradient(black, black) padding-box,
245
+ linear-gradient(to right, red, blue) border-box;
246
+ border-radius: 20px;
247
+ border: 2.5px solid transparent;
248
+ margin-top: 30px;
249
+ padding-bottom: 7px;
250
+ gap: 14px;
251
+ }
252
+ #imshow img{
253
+ width: 95%;
254
+ height: 100%;
255
+ margin: auto;
256
+ margin-top: 7px;
257
+ }
258
+ #cont{
259
+ height: 7vh;
260
+ }
261
+ }
262
+ #styles{
263
+ align-items: center;
264
+ justify-content: center;
265
+ }
266
+ @media screen and (max-width: 500px) {
267
+ .ad{
268
+ display: flex;
269
+ flex-direction: row;
270
+ }
271
+ dialog {
272
+ max-width: 300px;
273
+ }
274
+ #imshow{
275
+
276
+ border: 2px solid blue;
277
+ width: 330px;
278
+ height: 330px;
279
+ display: flex;
280
+ flex-direction: column;
281
+ overflow-y: scroll;
282
+ margin: auto;
283
+ margin-top: 30px;
284
+ padding-bottom: 7px;
285
+ gap: 14px;
286
+ background: linear-gradient(black, black) padding-box,
287
+ linear-gradient(to right,#FF0000, #9900FF) border-box;
288
+ border-radius: 20px;
289
+ border: 2.5px solid transparent;
290
+ }
291
+ #jd{
292
+ font-size: 14px;
293
+ }
294
+ #imshow p{
295
+ width: 80%;
296
+ }
297
+ #imshow img{
298
+ width: 95%;
299
+ height: 100%;
300
+ margin: auto;
301
+ }
302
+ #imshow p{
303
+ font-size: 20px;
304
+ }
305
+ #styles{
306
+ align-items: center;
307
+ justify-content: center;
308
+ }
309
+ }
310
+ #jd{
311
+ margin: 10px;
312
+ padding: 5px;
313
+ background-color: transparent;
314
+ color: #eeeeee;
315
+ margin-right: 0;
316
+ margin-left: 0;
317
+ background: linear-gradient(black, rgb(0, 0, 0)) padding-box,
318
+ linear-gradient(to right, rgb(1, 255, 234),#ff0055) border-box;
319
+ border-radius: 20px;
320
+ border: 2.5px solid transparent;
321
+ border-radius: 7px;
322
+ margin-left: 0px;
323
+ font-family: 'Barlow Condensed';
324
+ font-size: 18px;
325
+ color: white;
326
+ }
327
+ #jd:hover{
328
+ background: linear-gradient(black, black) padding-box,
329
+ linear-gradient(to right, blue,#00ffdd) border-box;
330
+ border-radius: 10px;
331
+ border: 2.5px solid transparent;
332
+ }
333
+ #ow{
334
+ float: right;
335
+ margin: 10px;
336
+ padding: 10px;
337
+ background-color: transparent;
338
+ color: #eeeeee;
339
+ background: linear-gradient(black, black) padding-box,
340
+ linear-gradient(to right, rgb(0, 255, 149), rgb(174, 0, 255)) border-box;
341
+ border-radius: 10px;
342
+ border: 2.5px solid transparent;
343
+ border-radius: 10px;
344
+ margin-bottom: 0px;
345
+ margin-right: 0;
346
+ margin-left: 0;
347
+ border: 2px solid white;
348
+ }
349
+ #ow:hover{
350
+ background: linear-gradient(black, black) padding-box,
351
+ linear-gradient(to right, rgb(174, 0, 255),rgb(0, 255, 149)) border-box;
352
+ border-radius: 10px;
353
+ border: 2.5px solid transparent;
354
+ }
355
+ #dvv{
356
+ width: 100%;
357
+ margin-left: 10px;
358
+ }
359
+ #model{
360
+ width: 170px;
361
+ height: 50px;
362
+ overflow: visible;
363
+ }
364
+ #model option{
365
+ white-space: normal;
366
+ padding: 10px;
367
+ font-family: 'Barlow Condensed';
368
+ line-height: 1.2;
369
+ font-size: 24px;
370
+ }
371
+
372
+ .ad{
373
+ display: flex;
374
+ flex-direction: row;
375
+ }
376
+ </style>
377
+ </head>
378
+ <body>
379
+ <div id="dvv">
380
+ <button id="jd">Discord</button>
381
+
382
+ <!--<button id="ow">
383
+ Donate
384
+ </button>-->
385
+ </div>
386
+
387
+
388
+
389
+ </div>
390
+ <div id="main">
391
+ <div id="cont">
392
+ <input type="text" name="" id="inp" placeholder=" Enter Prompt here..">
393
+ <button id="create">Create </button>
394
+ </div>
395
+
396
+ <div id="as">
397
+ <select name="" id="model">
398
+ <option value="p4" class="mod">Leonardo AI</option>
399
+
400
+
401
+
402
+ </select>
403
+ <div id="Advance Setting"><button>Setting</button></div>
404
+ </div>
405
+
406
+ </div>
407
+
408
+
409
+
410
+
411
+
412
+ <dialog id="dialog">
413
+
414
+ <p style="font-size: 23px; font-family: 'Barlow Condensed'; margin: 0px; color: rgb(197, 14, 188);">Styles: </p>
415
+ <div id="styles">
416
+ <p>Cinematic</p>
417
+ <input type="radio" name="style" value="cinema" checked>
418
+ <p>Photography</p>
419
+ <input type="radio" name="style" value="photo">
420
+ <p>FILM<p>
421
+ <input type="radio" name="style" value="fumes">
422
+ <p>Creative</p>
423
+ <input type="radio" name="style" value="fantasy">
424
+ <p>No Style</p>
425
+ <input type="radio" name="style" value="no">
426
+ </div>
427
+
428
+ <div id="sli">
429
+ <label for="#np" style="margin-bottom: 15px;">Negative Prompt: </label>
430
+ <input type="text" placeholder="Negative prompt" id="np" style="margin-bottom: 15px;">
431
+ </div>
432
+ <div id="sli">
433
+ <label for="#gds">Guidence Scale: </label>
434
+ <input type="range" id="gds" value="10" min="7" max="20" step="1"><p id="gdsp">7</p>
435
+ </div>
436
+ <div id="sli">
437
+ <label for="#step">Steps: </label>
438
+ <input type="range" id="step" value="20" min="10" max="40" step="1"><p id="stepp">50</p>
439
+ </div>
440
+ <div id="sli">
441
+ <label for="#gds">Seed: </label>
442
+ <input type="range" id="seed" min="0" value="0" step="1" max="99999"><p id="seedp">0</p>
443
+ </div>
444
+
445
+ <button id="close">Close</button>
446
+ </dialog>
447
+
448
+ <div id="imshow">
449
+ <p style="width: 220px;">Your Generarted Arts Will appear Here</p>
450
+
451
+
452
+ </div>
453
+ <script>document.getElementById('jd').onclick = ()=>{
454
+ window.open('https://discord.gg/ju4yQBfQ7p')
455
+ }
456
+
457
+
458
+
459
+ /*document.getElementById('ow').onclick = ()=>{
460
+ window.open('https://www.buymeacoffee.com/mygx')
461
+ }*/
462
+
463
+ let dialog = document.getElementById('dialog')
464
+ let openbtn = document.getElementById('Advance Setting')
465
+ let closebtn = document.getElementById('close')
466
+ openbtn.onclick = ()=>{
467
+ dialog.show()
468
+ document.getElementById('imshow').style.border = '0px solid black transparent'
469
+ }
470
+ closebtn.onclick= ()=>{
471
+ dialog.close()
472
+ document.getElementById('imshow').style.background = 'linear-gradient(black, black) padding-box,linear-gradient(to right, red, blue) border-box'
473
+ }
474
+ let inp = document.getElementById('inp')
475
+ let np = document.getElementById('np')
476
+ let gd = document.getElementById('gds')
477
+ let step = document.getElementById('step')
478
+ let seed = document.getElementById('seed')
479
+ let seedp = document.getElementById('seedp')
480
+ let stepp = document.getElementById('stepp')
481
+ let gdsp = document.getElementById('gdsp')
482
+ let btn = document.getElementById('create')
483
+ gd.addEventListener('input',()=>{
484
+ gdsp.innerText = gd.value
485
+ })
486
+ step.addEventListener('input',()=>{
487
+ stepp.innerText = step.value
488
+ })
489
+ seed.addEventListener('input',()=>{
490
+ seedp.innerText = seed.value
491
+ })
492
+ isFumes = true
493
+ let prompt = 'CINEMATIC'
494
+ 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'
495
+
496
+
497
+ document.getElementById('styles').onchange = ()=>{
498
+ const selectedStyle = document.querySelector('input[name="style"]:checked');
499
+ if(selectedStyle.value =='photo'){
500
+
501
+ prompt = 'PHOTOGRAPHY'
502
+
503
+
504
+ }
505
+ if(selectedStyle.value == 'cinema'){
506
+
507
+ prompt = "CINEMATIC"}
508
+ if(selectedStyle.value == 'fantasy'){
509
+
510
+ prompt = "CREATIVE"
511
+ }
512
+
513
+ if(selectedStyle.value == 'fumes'){
514
+
515
+ prompt = 'FILM'
516
+ }
517
+ if(selectedStyle.value == 'no'){
518
+ prompt = 'LEONARDO'
519
+
520
+ }
521
+ }
522
+
523
+ btn.onclick = async ()=>{
524
+ let isc = false
525
+ let id = ''
526
+
527
+
528
+
529
+
530
+
531
+ negative_prompt = nps
532
+ btn.disabled = true
533
+ const div = document.getElementById('imshow');
534
+ div.innerHTML = '';
535
+ document.getElementById('imshow').innerHTML = ''
536
+ let pi = document.createElement('p')
537
+ pi.innerText = 'Generating Image... Estimated Time: 20s'
538
+ document.getElementById('imshow').append(pi)
539
+ let count = 0;
540
+ seed = seed
541
+
542
+
543
+ async function generate(){
544
+ cookie = localStorage.getItem("cookie")
545
+ u = localStorage.getItem("u")
546
+ sub = localStorage.getItem("sub")
547
+ if(cookie == null){
548
+ cookie = ''
549
+ }
550
+ if(cookie == "undefined"){
551
+ cookie = ''
552
+ }
553
+ params={
554
+
555
+ 'prompt': inp.value,
556
+ 'nprompt': np.value,
557
+ "steps": step.value,
558
+ 'gd': gd.value,
559
+ "style": prompt,
560
+ "width": 1024,
561
+ "height":1024,
562
+ "alchemy":true,
563
+ "pr":true,
564
+ "cookie": cookie,
565
+ "u":u,
566
+ "sub":sub
567
+ };
568
+
569
+
570
+ try {
571
+ const response = await fetch('https://l-d83c.onrender.com/leonardo', {
572
+ method: 'POST',
573
+ headers: {
574
+ 'Content-Type': 'application/json',
575
+ 'Connection': 'keep-alive',
576
+ },
577
+ body: JSON.stringify(params)
578
+ });
579
+ if (response.status === 429) {
580
+ pi.innerText = 'you have reached your limit of 50 generation per hour, you will get 50 more image generaions after an hour!!'
581
+ }
582
+ /* console.log(np.value)
583
+ const imgData = await response.text();
584
+ const div = document.getElementById('imshow')
585
+ const img = document.createElement('img');
586
+ pi.innerHTML = ''
587
+ pi.innerText = ''
588
+ img.src = imgData;
589
+ div.appendChild(img);
590
+ */
591
+
592
+ const data = await response.json();
593
+ localStorage.setItem("cookie", data.token);
594
+ localStorage.setItem("sub", data.sub);
595
+ localStorage.setItem("u", data.u);
596
+ console.log(data.result)
597
+ const div = document.getElementById('imshow')
598
+ const img = document.createElement('img');
599
+ pi.innerHTML = ''
600
+ pi.innerText = ''
601
+ img.src = data.result;
602
+ div.appendChild(img);
603
+ btn.disabled = false
604
+
605
+ } catch (error) {
606
+ btn.disabled = false
607
+ console.error('An error occurred:', error);
608
+ pi.innerText = 'An error occurred, try changing your prompt';
609
+ }
610
+
611
+
612
+ }
613
+
614
+ await Promise.all([generate()]);
615
+
616
+
617
+
618
+
619
+ }
620
+ </script>
621
+
622
+
623
+ <script type="module">
624
+ // Import the functions you need from the SDKs you need
625
+ import { initializeApp } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js";
626
+ import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-analytics.js";
627
+ // TODO: Add SDKs for Firebase products that you want to use
628
+ // https://firebase.google.com/docs/web/setup#available-libraries
629
+ // Your web app's Firebase configuration
630
+ // For Firebase JS SDK v7.20.0 and later, measurementId is optional
631
+ const firebaseConfig = {
632
+ apiKey: "AIzaSyDA40xpjwKzWIHmDz5oRu9BircpHfqncuI",
633
+ authDomain: "fumesai.firebaseapp.com",
634
+ projectId: "fumesai",
635
+ storageBucket: "fumesai.appspot.com",
636
+ messagingSenderId: "573294764046",
637
+ appId: "1:573294764046:web:f98a507a60045cf8a91c5f",
638
+ measurementId: "G-CZ2LETVP9K"
639
+ };
640
+ // Initialize Firebase
641
+ const app = initializeApp(firebaseConfig);
642
+ const analytics = getAnalytics(app);
643
+ </script>
644
+ </body>
645
+ </html>