ionium commited on
Commit
e617050
1 Parent(s): 3f3df3e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +610 -16
index.html CHANGED
@@ -1,19 +1,613 @@
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>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
+ <link rel="preconnect" href="https://fonts.googleapis.com">
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@100&display=swap" rel="stylesheet">
9
+ <title>Free AI Image Generator | SDXL | Stable diffusion</title>
10
+
11
+ <style>
12
+
13
+ #images {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ justify-content: center;margin-top: 20px;
17
+ }
18
+ @media screen and (max-width:600px) {
19
+ #images{
20
+ flex-direction: row;
21
+ }
22
+ }
23
+ #images img {
24
+ margin: 10px;
25
+ max-width: 400px;
26
+ height: auto;
27
+ }
28
+ #status{
29
+ color: aquamarine;
30
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
31
+ margin-top: 100px;
32
+ }
33
+
34
+ @font-face {
35
+ font-family: 'Bangers';
36
+ src: url('Bangers-Regular.ttf') format('truetype');
37
+ }
38
+ @import url('https://fonts.googleapis.com/css?family=Encode+Sans+Condensed:400,600');
39
+ *{
40
+ padding: 0;
41
+ margin: 0;
42
+ box-sizing: border-box;
43
+ }
44
+
45
+
46
+ body{
47
+ background: radial-gradient(circle at center, rgba(170, 170, 170, 0.1) 6%, rgb(0, 6, 18)100%), rgb(0,7,20);
48
+ }
49
+ #cv{
50
+
51
+ position: absolute;
52
+ top: 50%;
53
+ left: 50%;
54
+ transform: translate(-50%,-50%);
55
+ width: 100%;
56
+ height: 100%;
57
+ z-index: -1;
58
+ }
59
+ @keyframes colorChange {
60
+ 0% {
61
+ color: #e2335f;
62
+ }
63
+ 25% {
64
+ color: #e429b5;
65
+ }
66
+ 50% {
67
+ color: rgb(115, 14, 209);
68
+ }
69
+ 75% {
70
+ color: rgb(7, 240, 189);
71
+ }
72
+ 100% {
73
+ color: rgb(200, 238, 229);
74
+ }
75
+ }
76
+
77
+ h1 {
78
+ font-family: 'Barlow Condensed', sans-serif;
79
+ text-align: center;
80
+ margin-top: 10px;
81
+ animation: colorChange 10s linear infinite;
82
+ }
83
+
84
+ h2{
85
+ color: #fdfdfd;
86
+ font-weight: 1;
87
+ font-size: 22px;
88
+ margin: auto;
89
+ margin-top: 40px;
90
+ font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
91
+ text-align: left;
92
+ margin-bottom: 17px;
93
+
94
+ width: 69%;
95
+ }
96
+
97
+ #h21{
98
+ margin-bottom: 0px;
99
+ }
100
+
101
+ #try{
102
+ margin: auto;
103
+ margin-top: 40px;
104
+ width: 61%;
105
+ border: none;
106
+ border-radius: 10px;
107
+
108
+ box-shadow: 0px 0px 5px 1px cyan;
109
+ }
110
+ #try input{
111
+ padding: 24px;
112
+
113
+ width: 50%;
114
+ border: none;
115
+ margin-left: 2px;
116
+ border-radius: 10px;
117
+ background-color: transparent;
118
+ color: rgb(145, 145, 145);
119
+ outline: none;
120
+ }
121
+ #try:hover{
122
+ outline: none;
123
+ box-shadow:0px 0px 18px 1px rgb(0, 155, 191);
124
+ border: none;
125
+
126
+
127
+ }
128
+
129
+
130
+
131
+
132
+ @keyframes buttonColorChange {
133
+ 0% {
134
+ background: linear-gradient(to right, #e2335f, #d64dd6);
135
+ }
136
+ 25% {
137
+ background: linear-gradient(to right, #d64dd6, #730ed1);
138
+ }
139
+ 50% {
140
+ background: linear-gradient(to right, #730ed1, #04ecc6);
141
+ }
142
+ 75% {
143
+ background: linear-gradient(to right, #7f4fda, #11e7b2);
144
+ }
145
+ 100% {
146
+ background: linear-gradient(to right, #11e7b2, #e2335f);
147
+ }
148
+ }
149
+
150
+ #try button {
151
+ padding: 13.3px;
152
+ float: right;
153
+ margin-top: 9.5px;
154
+ margin-right: 10px;
155
+ border: none;
156
+ border-radius: 3px;
157
+ font-family: Verdana, Geneva, Tahoma, sans-serif;
158
+ z-index: 100;
159
+ outline: none;
160
+ transition: all ease 10s;
161
+ cursor: pointer;
162
+ animation: buttonColorChange 10s infinite linear;
163
+ }
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ #try button:hover {
172
+ background-color: rgb(0, 155, 191);
173
+ outline: none;
174
+ border: none;
175
+ transition: all ease 2s;
176
+
177
+
178
+ }
179
+
180
+ #try button:active{
181
+ transform: scale(0.5)
182
+
183
+ }
184
+ @media screen and (max-width:600px){
185
+ h2{
186
+ width: 95%;
187
+ margin: auto;
188
+ justify-content: center;
189
+
190
+
191
+ }
192
+ #try{
193
+ display: flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ width: 92%;
197
+ }
198
+
199
+ #try input{
200
+ width: 60%;
201
+ }
202
+ #try button{
203
+ position: relative;
204
+ top: 50%;
205
+ transform: translateY(-0%);
206
+ width: 35%;
207
+ height: 50px;
208
+ margin: 0;
209
+ padding: 0;
210
+ margin-left: 5px;
211
+
212
+
213
+ }
214
+
215
+ }
216
+ @media screen and (max-width:375px){
217
+ #try button{
218
+ width: 30%;
219
+ }
220
+ }
221
+
222
+
223
+ #idk{
224
+ color: #ad0fd4;
225
+ }
226
+
227
+ </style>
228
+ <body>
229
+
230
+
231
+ <style>
232
+ #images {
233
+ flex-wrap: wrap;
234
+ margin: 0;
235
+ color: gainsboro;
236
+ flex-direction: column;
237
+ margin-bottom: 0;
238
+ gap: 10px; /* Adjust the gap between images as needed */
239
+ margin: 0;
240
+ margin-top: 5px;
241
+ text-align: center;
242
+ justify-content: center;
243
+ margin: auto;
244
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
245
+ font-family: 'Barlow Condensed', sans-serif;
246
+ font-size: 20px;
247
+ }
248
+ #images img {
249
+ position: relative;
250
+ border-radius: 0px;
251
+ width: 340px;
252
+ height: 340px;
253
+ padding: 3px;
254
+ padding-bottom: 4.7px;
255
+ margin: 0;
256
+ margin-top: 3px ;
257
+
258
+
259
+
260
+ }
261
+
262
+ #cont {
263
+ margin: auto;
264
+ width: 350px;
265
+ height: 350px;
266
+ overflow-y: scroll;
267
+ overflow-x: hidden;
268
+ margin-top: 40px;
269
+ box-shadow: 0px 0px 5px 1px rgb(0, 155, 191);
270
+ border-radius: 10px;
271
+ display: flex;
272
+ justify-content: center; /* Horizontally center */
273
+ font-family: 'Barlow Condensed', sans-serif;
274
+ text-align: center; /* Horizontally center text content */
275
+ font-size: 15px;
276
+ }
277
+
278
+ #status {
279
+ font-family: 'Barlow Condensed', sans-serif;
280
+ position: absolute;
281
+ top: 50%;
282
+ left: 50%;
283
+ font-size: 15px;
284
+ transform: translate(-50%,-50%);
285
+ background: radial-gradient(circle at center, rgba(170, 170, 170, 0.1) 6%, rgb(0, 6, 18)100%), rgb(0,7,20);
286
+ }
287
+
288
+ p{
289
+ font-family: 'Barlow Condensed', sans-serif;
290
+ margin:0;
291
+ font-size: 15px;
292
+ }
293
+
294
+ @media screen and (min-width: 800px) {
295
+ #cont {
296
+ display: flex;
297
+ justify-content: center;
298
+ align-items: center;
299
+ text-align: center;
300
+ width: 705px;
301
+ height: 355px;
302
+ overflow: hidden;
303
+ flex-direction: row;
304
+ margin-bottom: 0;
305
+ font-family: 'Barlow Condensed', sans-serif;
306
+ }
307
+
308
+ #images {
309
+ flex-wrap: nowrap;
310
+ margin: 0;
311
+ align-items: center; /* Center vertically */
312
+ flex-direction: row;
313
+ margin-bottom: 0;
314
+ font-family: 'Barlow Condensed', sans-serif;
315
+ gap: 0px; /* Adjust the gap between images as needed */
316
+ margin-left: 5px;
317
+ margin-right: 5px;
318
+ }
319
+
320
+
321
+ #images img {
322
+ width: 350px;
323
+ height: 350px;
324
+ margin: 0;
325
+
326
+ border-radius: 6.5px;
327
+ }
328
+ }
329
+ @media screen and (min-width: 570px) and (max-width: 799px) {
330
+ #try button {
331
+ width: 20%;
332
+ }
333
+ #cont {
334
+ display: flex;
335
+ justify-content: center;
336
+ align-items: center;
337
+ text-align: center;
338
+ width: 550px;
339
+ height: 270px;
340
+ overflow: hidden;
341
+ flex-direction: column;
342
+ margin-bottom: 0;
343
+ }
344
+ #images {
345
+ flex-wrap: nowrap;
346
+ margin: 0;
347
+ align-items: center; /* Center vertically */
348
+ flex-direction: column;
349
+ margin-bottom: 0;
350
+
351
+ }
352
+
353
+ #images img {
354
+ width: 267px;
355
+ height: 267px;
356
+ margin: 0;
357
+ border-radius: 6.5px;
358
+ }
359
+ }
360
+
361
+
362
+
363
+
364
+ @media screen and (min-width:320px) and (max-width:370px) {
365
+ #cont {
366
+ display: flex;
367
+ justify-content: center;
368
+ align-items: center;
369
+ text-align: center;
370
+ width: 330px;
371
+ height: 330px;
372
+
373
+ flex-direction: column;
374
+ margin-bottom: 0;
375
+ }
376
+ #images {
377
+ flex-wrap: nowrap;
378
+ margin: 0;
379
+ align-items: center; /* Center vertically */
380
+ flex-direction: column;
381
+ margin-bottom: 0;
382
+ margin-top: 340px;
383
+ }
384
+
385
+ #images img {
386
+ width: 330px;
387
+ height: 330px;
388
+ margin: 0;
389
+ border-radius: 10px;
390
+
391
+ }
392
+
393
+ }
394
+ </style>
395
+ <style>
396
+ *{
397
+ margin:0;
398
+ padding:0;
399
+ box-sizing:border-box;
400
+ }
401
+ html,body{
402
+ height:100%;
403
+ width:100%;
404
+ }
405
+ p{
406
+ font-size: 20px;
407
+ }
408
+ </style>
409
+ <canvas id="cv"></canvas>
410
+ <h1>Image generator</h1>
411
+ <div id="try">
412
+ <input type="text" id="promptInput" placeholder="Enter image prompt">
413
+ <button id="submitButton" onclick="submitPrompt()">Generate Image</button>
414
+ </div>
415
+ <div id="cont">
416
+ <div id="images">
417
+ <p>generated image will appear here</p>
418
+ </div>
419
+ </div>
420
+ <script>
421
+ count = 25
422
+ let intervalId;
423
+
424
+ function tim(){
425
+ intervalId = setInterval(() => {
426
+ count -= 1;
427
+ let p = document.getElementById('images').firstChild;
428
+ p.innerText = `generating images.... estimated time ${count} `;
429
+ if(count==0){
430
+ count=0
431
+ }
432
+ }, 1600);
433
+ }
434
+
435
+
436
+ function submitPrompt(){
437
+ if(document.getElementById('promptInput').value == ''){
438
+ alert('enter some text')
439
+ }
440
+ else{
441
+ tim()
442
+ count=25
443
+
444
+ document.getElementById('images').innerHTML = ''
445
+ let p = document.createElement('p')
446
+ p.innerText = `generating images.... estimated time ${count} `
447
+ document.getElementById('images').append(p)
448
+ const url = "https://friendlyunselfishcodeview.mygyasir8.repl.co/generate_image";
449
+
450
+ inp = document.getElementById('promptInput')
451
+ const data = {
452
+
453
+ prompt: inp.value,
454
+ width: 1024,
455
+ height: 1024,
456
+ count: 2,
457
+ refine: "expert_ensemble_refiner",
458
+ scheduler: "DPMSolverMultistep",
459
+ guidance_scale: 9.5,
460
+ high_noise_frac: 1,
461
+ prompt_strength: 1,
462
+ num_inference_steps: 70
463
+ };
464
+
465
+ fetch(url, {
466
+ method: 'POST',
467
+ headers: {
468
+ 'Content-Type': 'application/json',
469
+ },
470
+ body: JSON.stringify(data),
471
+ })
472
+ .then(response => response.json())
473
+ .then(data => {
474
+ // Extract the image URLs from the response data
475
+ const imageUrls = data.images.images;
476
+ let img1 = document.createElement('img')
477
+ img1.src = imageUrls[0]
478
+ let img2 = document.createElement('img')
479
+ img2.src = imageUrls[1]
480
+ let div = document.getElementById('images')
481
+ div.append(img1)
482
+ div.append(img2)
483
+ p.innerHTML = ''
484
+ // Log the image URLs to the console
485
+ console.log('Image URLs:', imageUrls);
486
+ clearInterval(intervalId)
487
+ p.innerHTML=''
488
+ })
489
+ .catch((error) => {
490
+ console.error('Error:', error);
491
+ });
492
+ }
493
+ }
494
+
495
+ </script>
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+ <script>
506
+ const cv = document.getElementById('cv');
507
+ const ctx = cv.getContext('2d');
508
+ cv.width = window.innerWidth;
509
+ cv.height = window.innerHeight;
510
+
511
+ const colors = [
512
+ { r: 15, g: 100, b: 100 }, // Red
513
+ { r: 20, g: 55, b:140 }, // Green
514
+ { r: 450, g: 0, b: 80 }, // Blue
515
+ { r: 95, g: 12, b: 60 } // Pink
516
+ ];
517
+
518
+ let currentColorIndex = 0;
519
+ let lastColorChangeTime = 0;
520
+ let targetColor = colors[currentColorIndex];
521
+ let particleColor = colors[currentColorIndex];
522
+
523
+ class Particle {
524
+ constructor() {
525
+ this.x = Math.random() * cv.width;
526
+ this.y = Math.random() * cv.height;
527
+ this.size = Math.random() * 2 + 1;
528
+ this.vx = Math.sin(Math.random() * 4 - 1);
529
+ this.vy = Math.cos(Math.random() * 2 - 1);
530
+ }
531
+
532
+ draw() {
533
+ ctx.fillStyle = `rgb(${Math.round(particleColor.r)},${Math.round(particleColor.g)},${Math.round(particleColor.b)})`;
534
+
535
+ ctx.beginPath();
536
+ ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
537
+ ctx.fill();
538
+ }
539
+
540
+ update() {
541
+ if (this.x < this.size || this.x > cv.width) {
542
+ this.vx *= -1;
543
+ }
544
+ if (this.y < this.size || this.y > cv.height) {
545
+ this.vy *= -1;
546
+ }
547
+ this.x += this.vx;
548
+ this.y += this.vy;
549
+
550
+ // Update particle color gradually towards the target color
551
+ const colorStep = 0.01; // Adjust this value for the speed of color change
552
+ if (particleColor.r < targetColor.r) {
553
+ particleColor.r += colorStep;
554
+ } else if (particleColor.r > targetColor.r) {
555
+ particleColor.r -= colorStep;
556
+ }
557
+ if (particleColor.g < targetColor.g) {
558
+ particleColor.g += colorStep;
559
+ } else if (particleColor.g > targetColor.g) {
560
+ particleColor.g -= colorStep;
561
+ }
562
+ if (particleColor.b < targetColor.b) {
563
+ particleColor.b += colorStep;
564
+ } else if (particleColor.b > targetColor.b) {
565
+ particleColor.b -= colorStep;
566
+ }
567
+
568
+ // Check if the color has reached the target, and if so, set a new target
569
+ if (
570
+ Math.abs(particleColor.r - targetColor.r) < colorStep &&
571
+ Math.abs(particleColor.g - targetColor.g) < colorStep &&
572
+ Math.abs(particleColor.b - targetColor.b) < colorStep
573
+ ) {
574
+ currentColorIndex = (currentColorIndex + 1) % colors.length;
575
+ targetColor = colors[currentColorIndex];
576
+ }
577
+ }
578
+ }
579
+
580
+ let particles = [];
581
+ if(window.innerWidth>500){
582
+ for (let i = 0; i < 200; i++) {
583
+ particles.push(new Particle());
584
+ }
585
+ }
586
+ else{
587
+ for (let i = 0; i < 100; i++) {
588
+ particles.push(new Particle());
589
+ }
590
+ }
591
+ function animate() {
592
+ ctx.clearRect(0, 0, cv.width, cv.height);
593
+ particles.forEach((particle) => {
594
+ particle.draw();
595
+ particle.update();
596
+ });
597
+ requestAnimationFrame(animate);
598
+ }
599
+
600
+ animate();
601
+
602
+
603
+
604
+ </script>
605
+
606
+ </body>
607
+ </html>
608
+
609
+
610
+
611
+
612
+ </body>
613
  </html>