-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
676 lines (636 loc) · 31.1 KB
/
index.html
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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DC-AE</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.5; /* Adjust this value to make the spacing larger */
margin: 0;
padding: 0;
color: black;
background-image: url('asset/samples/pexels-photo-28821825.jpeg'); /* Background image */
background-size: contain; /* Cover the entire viewport */
background-attachment: fixed; /* Fixed background */
background-position: center;
direction: ltr;
}
.hero {
text-align: center;
padding: 50px 0;
background-color: #fff;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
}
.hero h1 {
font-size: 5em;
margin: 0.2em 0;
}
.hero h2 {
font-size: 3em;
margin: 0.2em 0;
font-weight: normal;
line-height: 1.4; /* Adjust this value to make the spacing larger */
}
.hero p {
font-size: 1.5em;
margin-bottom: 1em;
}
.button {
display: inline-block;
padding: 10px 20px;
margin: 5px;
font-size: 0.9em;
color: white;
background-color: black;
border-radius: 30px;
text-decoration: none;
}
.gallery-container {
max-width: 77%; /* Limit the width of the gallery */
margin: 0 auto; /* Center the gallery */
padding: 20px 0; /* Add some padding on top and bottom */
}
.gallery {
display: grid;
grid-template-columns: repeat(12, 1fr); /* 12 columns grid */
grid-auto-rows: 150px; /* Adjust row height */
gap: 10px;
}
.gallery-item {
overflow: hidden;
/*aspect-ratio: 1/1; !* Keep the aspect ratio of the images *!*/
}
.gallery-item img {
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer; /* Cursor change on hover */
border-radius: 10px; /* Rounded corners */
transition: transform 0.3s ease; /* Add smooth transition */
}
.gallery-item video {
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer; /* Cursor change on hover */
border-radius: 10px; /* Rounded corners */
transition: transform 0.3s ease; /* Add smooth transition */
}
/* Image scaling on hover */
.gallery-item img:hover {
transform: scale(1.2);
}
/* Define specific grid item placements */
.item1 { grid-column: span 4; grid-row: span 4; }
.item2 { grid-column: span 8; grid-row: span 8; }
/* Modal styling */
#modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
justify-content: center; /* Horizontally center the image */
flex-direction: column;
align-items: center; /* Center align items vertically */
}
#modal img {
margin: auto;
display: block;
max-width: 77%;
max-height: 77%; /* Ensure the image doesn't overflow vertically */
object-fit: contain; /* Make sure the aspect ratio is preserved */
}
#modal-description {
color: white;
text-align: center;
margin-top: 10px; /* Adjust this value to move text closer to the image */
font-size: 1.2em;
}
.description {
font-family: Arial, sans-serif;
font-style: normal;
font-size: 17px;
line-height: 1.47;
color: #333;
/*color: black; !* Text color *!*/
letter-spacing: -0.022em;
font-weight: 400;
background-color: #fff; /* Solid background color that spans the entire width */
padding: 20px 0; /* Add vertical padding */
text-align: center; /* Center align text */
border-top-left-radius: 20px;
border-top-right-radius: 20px;
box-shadow: 2px 4px 12px #00000054;
}
.description-content {
/*background-color: rgba(255, 255, 255, 0.1); !* Semi-transparent background inside the section *!*/
/*border: 2px solid #555; !* Adding a lighter border *!*/
max-width: 65%; /* Limit the width to 80% of the screen */
margin: 0 auto; /* Center the content horizontally */
padding: 20px; /* Padding inside the border */
font-style: normal;
border-radius: 18px;
/*box-shadow: 2px 4px 12px #00000014;*/
}
.description-content h2 {
display: block;
color: black;
font-size: 1.5em;
line-height: 1.125;
letter-spacing: .004em;
font-weight: 600;
text-align: left; /* Center-align the h2 */
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-style: normal;
}
.description-content p {
font-size: 1.1em;
text-align: left; /* Left-align the p */
font-weight: normal;
}
.citation {
/*background-color: #333; !* Solid background color that spans the entire width *!*/
font-family: Arial, sans-serif;
color: black;
padding: 10px;
text-align: center;
margin-top: 10px;
box-shadow: 2px 4px 12px #00000054;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.citation-content {
/*background-color: rgba(255, 255, 255, 0.1); !* Semi-transparent background inside the section *!*/
/*border: 2px solid #444; !* Adding a lighter border *!*/
border-radius: 15px; /* Rounded corners */
font-size: 0.8em;
max-width: 65%; /* Limit the width to 80% of the screen */
margin: 0 auto; /* Center the content horizontally */
padding: 0px; /* Padding inside the border */
}
.citation-content h2 {
font-size: 2em;
text-align: left;
font-weight: normal;
}
.citation pre {
text-align: left;
white-space: pre-wrap; /* Allows text to wrap */
}
.footer {
background-color: #222;
color: #fff;
padding: 20px;
text-align: center;
}
.footer a {
color: #00d1b2;
text-decoration: none;
}
.inserted-image {
max-width: 80%; /* Set the maximum width for the image */
height: auto; /* Ensure the height adjusts automatically to maintain aspect ratio */
margin: 20px 0; /* Add space above and below the image */
display: block; /* Make sure the image is treated as a block-level element */
margin-left: auto; /* Center the image horizontally */
margin-right: auto;
margin-top: -10px;
border-radius: 10px;
box-shadow: 2px 4px 12px #00000024;
}
.video-container {
text-align: center; /* Center the video horizontally */
margin: 20px 0; /* Add some vertical margin around the video */
}
video {
max-width: 100%; /* The video will scale to fit the container */
height: auto; /* Maintain the video's aspect ratio */
border-radius: 10px; /* Rounded corners for the video */
box-shadow: 2px 4px 12px #00000054;
}
.logo {
color: black;
display: flex;
justify-content: center;
/*justify-content: left;*/
align-items: center;
text-align: center;
gap: 60px;
}
.logo-sup {
position: absolute;
top: -5px; /* Adjust this value to position it closer to the top */
right: -10px; /* Adjust this value to move it horizontally */
font-size: 14px; /* Increase the size of the superscript */
color: black; /* Change the color if needed */
}
@media (max-width: 4096px) {
.gallery {
/*grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); !* Adjust columns for smaller screens *!*/
grid-auto-columns: 100px; /* Adjust columns for smaller screens */
grid-auto-rows: 200px; /* Set a fixed height for the grid items */
}
}
@media (max-width: 2048px) {
.gallery {
/*grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); !* Adjust columns for smaller screens *!*/
grid-auto-columns: 60px; /* Adjust columns for smaller screens */
grid-auto-rows: 90px; /* Set a fixed height for the grid items */
}
}
@media (min-width: 2048px) {
.description-content {
max-width: 728px; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.citation-content {
max-width: 728px; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.inserted-image {
max-width: 1024px; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
/* video {
max-width: 1024px;
} */
}
@media (max-width: 1024px) {
.gallery {
/*grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); !* Adjust columns for smaller screens *!*/
grid-auto-columns: 40px; /* Adjust columns for smaller screens */
grid-auto-rows: 70px; /* Set a fixed height for the grid items */
}
}
@media (min-width: 1024px) {
.description-content {
max-width: 728px; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.citation-content {
max-width: 728px; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.inserted-image {
max-width: 960px; /* Limit the width to 80% of the screen */
padding: 5px; /* Padding inside the border */
}
/* video {
max-width: 728px;
} */
}
@media (max-width: 768px) {
.gallery {
/*grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); !* Adjust columns for smaller screens *!*/
grid-auto-columns: 20px; /* Adjust columns for smaller screens */
grid-auto-rows: 30px; /* Set a fixed height for the grid items */
gap: 5px;
}
.gallery-container {
max-width: 85%; /* Limit the width of the gallery */
padding: 10px 0; /* Add some padding on top and bottom */
}
.hero h1 {
font-size: 3em;
}
.hero h2 {
font-size: 2em;
}
.hero p {
font-size: 1em;
}
.description-content {
max-width: 92%; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.citation-content {
max-width: 92%; /* Limit the width to 80% of the screen */
padding: 10px; /* Padding inside the border */
}
.inserted-image {
max-width: 95%; /* Limit the width to 80% of the screen */
padding: 5px; /* Padding inside the border */
}
/* video {
max-width: 92%;
} */
.logo {
gap: 20px;
}
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
.description {
background-color: #333; /* Dark color for dark mode */
color: white; /* Light text color for dark mode */
}
.description h2 {
background-color: #333; /* Dark color for dark mode */
color: white; /* Light text color for dark mode */
}
.citation {
background-color: #333; /* Dark color for dark mode */
color: white; /* Light text color for dark mode */
}
}
</style>
</head>
<body>
<div class="hero">
<div style="display: flex; justify-content: center; align-items: center; margin-left: -50px;">
<h1 style="margin: 0;">DC-AE</h1>
</div>
<h2>Deep Compression Autoencoder for <br>
Efficient High-resolution diffusion models</h2>
<!-- Add author and institution information -->
<div style="margin-top: 20px; text-align: center;">
<p style="font-size: 1.3em; margin-bottom: 5px;">
<a href="https://scholar.google.com.hk/citations?hl=zh-CN&user=mWdYMZ8AAAAJ" target="_blank" style="color: #76b900;">Junyu Chen</a><sup>1,2*</sup>,
<a href="https://han-cai.github.io//" target="_blank" style="color: #76b900;">Han Cai</a><sup>3*†</sup>,
<a href="https://lawrence-cj.github.io/" target="_blank" style="color: #76b900;">Junsong Chen</a><sup>3</sup>,
<a href="https://xieenze.github.io/" target="_blank" style="color: #76b900;">Enze Xie</a><sup>3</sup>,<br>
<a href="https://ys-2020.github.io/" target="_blank" style="color: #76b900;">Shang Yang</a><sup>1</sup>,
<a href="http://kentang.net/" target="_blank" style="color: #76b900;">Haotian Tang</a><sup>1</sup>,
<a href="https://lmxyy.me//" target="_blank" style="color: #76b900;">Muyang Li</a><sup>1</sup>,
<a href="https://scholar.google.com/citations?user=OI7zFmwAAAAJ&hl=en/" target="_blank" style="color: #76b900;">Yao Lu</a><sup>3</sup>,
<a href="https://hanlab.mit.edu/songhan/" target="_blank" style="color: #76b900;">Song Han</a><sup>1,3</sup>
</p>
<p style="font-size: 1.2em; color: #888;">
<sup>1</sup>MIT, <sup>2</sup>Tsinghua University, <sup>3</sup>NVIDIA
<br>
*Equal contribution
†Project lead
</p>
</div>
<!-- <div style="overflow: hidden; background-color: #6699cc;">-->
<div style="overflow: hidden; background-color: #fff;">
<div class="logo" style="padding: 12px;">
<a href="https://hanlab.mit.edu/" style="text-decoration: none; font-size: 16px;">
<img src="assets/mit_han.png" alt="MIT Logo" style="width: auto; height: 30px;">
</a>
<a href="" style="text-decoration: none; font-size: 16px;">
<img src="assets/thu.jpg" alt="THU Logo" style="width: auto; height: 40px;">
</a>
<a href="https://www.nvidia.com/" style="text-decoration: none; font-size: 16px;">
<img src="https://nv-tlabs.github.io/3DStyleNet/assets/nvidia.svg" alt="NVIDIA Logo" style="width: auto; height: 30px;">
</a>
</div>
</div>
<a href="#" class="button">Paper</a>
<a href="https://github.com/mit-han-lab/efficientvit" class="button">Code</a>
</div>
<div class="gallery-container">
<section class="gallery" id="gallery">
<div class="gallery-item item1">
<video controls muted autoplay loop>
<source src="assets/videos/reconstruction/8_f64.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<div class="gallery-item item2">
<video controls muted autoplay loop>
<source src="assets/videos/diffusion/speed_comparison.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<div class="gallery-item item1">
<video controls muted autoplay loop>
<source src="assets/videos/reconstruction/3_f64.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</section>
</div>
<div class="gallery-container">
<section class="gallery" id="gallery">
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/logo_cropped.png" alt="Image 1" data-description='a cyberpunk cat with a neon sign that says “DC-AE”'></div>
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/Chinese architecture, ancient style,mountain, bird, lotus, pond, big tree, 4K Unity, octane renderin.jpg" alt="Image 2" data-description='Chinese architecture, ancient style,mountain, bird, lotus, pond, big tree, 4K Unity, octane rendering.'></div>
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/A serene lakeside during autumn with trees displaying a palette of fiery colors..jpg" alt="Image 3" data-description='Serene lakeside during autumn with trees displaying a palette of fiery colors.'></div>
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/A blue jay standing on a large basket of rainbow macarons..jpg" alt="Image 4" data-description='A blue jay standing on a large basket of rainbow macarons.'></div>
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/a close up of a helmet on a person, digital art, inspired by Han Gan, cloisonnism, female, victorian.jpg" alt="Image 5" data-description="A close up of a helmet on a person, digital art, inspired by Han Gan, cloisonnism, female, victorian armor, ultramarine, best of behance, anton fadeev 8 k, fined detail, sci-fi character, elegant armor, fantasy art behance"></div>
<div class="gallery-item item1"><img src="assets/images/diffusion/text_to_image/beautiful scene.jpg" alt="Image 6" data-description='Beautiful scene'></div>
</section>
</div>
<!-- The Modal -->
<div id="modal" onclick="this.style.display='none'">
<img id="modal-img" src="">
<div id="modal-description"></div> <!-- Text for description -->
</div>
<section class="description">
<div class="description-content">
<h2>About DC-AE</h2>
<p>We present Deep Compression Autoencoder (DC-AE), a new family of autoencoders for accelerating high-resolution diffusion models. Existing autoencoders have demonstrated impressive results at a moderate spatial compression ratio (e.g., 8x), but fail to maintain satisfactory reconstruction accuracy for high spatial compression ratios (e.g., 64x). We address this challenge by introducing two key techniques: (1) <strong style="font-size: 18px;">Residual Autoencoding</strong>, where we design our models to learn residuals based on the space-to-channel transformed features to alleviate the optimization difficulty of high spatial-compression autoencoders; (2) <strong style="font-size: 18px;">Decoupled High-Resolution Adaptation</strong>, an efficient decoupled three-phase training strategy for mitigating the generalization penalty of high spatial-compression autoencoders. With these designs, we improve the autoencoder's spatial compression ratio up to 128 while maintaining the reconstruction quality. Applying our \modelshort to latent diffusion models, we achieve significant speedup without accuracy drop. For example, on ImageNet 512x512, our DC-AE provides <strong style="font-size: 18px;">19.1x</strong> inference speedup and <strong style="font-size: 18px;">17.9x</strong> training speedup on H100 GPU for UViT-H while achieving a better FID, compared with the widely used SD-VAE-f8 autoencoder.</p>
</div>
<!-- Insert your image here -->
<div>
<img width="30%" src="assets/images/diffusion/uvit_speed_comparison.jpg" alt="Inference throughput comparison to SD-VAE-f8 on ImageNet 512x512 with UViT Variants" class="inserted-image">
</div>
<div class="description-content">
<h2>Method</h2>
<p>
<!-- • <strong style="font-size: 18px;">Deep Compression Autoencoder: </strong>
We introduce a new Autoencoder (AE) that aggressively increases the scaling factor to 32.
Compared with AE-F8, our AE-F32 outputs 16x fewer latent tokens, which is crucial for efficient training
and generating ultra-high-resolution images, such as 4K resolution.<br>
• <strong style="font-size: 18px;">Efficient Linear DiT: </strong>
We introduce a new linear DiT to replace vanilla quadratic attention modules, reducing the computational complexity from O(N<span style="font-size: 0.8em;"><sup>2</sup></span>) to O(N)
At the same time, we propose Mix-FFN, which integrates 3x3 depth-wise convolution into MLP to aggregate the local information of tokens.
We argue that linear attention can achieve results comparable to vanilla attention with proper design
and is more efficient for high-resolution image generation (e.g., accelerating by 1.7x at 4K).
Additionally, the indirect benefit of Mix-FFN is that we do not need position encoding (NoPE).
For the first time, we removed the positional embedding in DiT and find no quality loss.<br>
• <strong style="font-size: 18px;">Decoder-only Small LLM as Text Encoder: </strong>
We use the latest Large Language Model (LLM), Gemma, as the text encoder to enhance understanding and reasoning in user prompts.
While text-to-image models have improved, most still rely on CLIP or T5 for text encoding, which often lack strong comprehension and instruction-following skills.
Decoder-only LLMs like Gemma offer superior text understanding and instruction-following abilities.
In this work, we tackle training instability when adopting an LLM as a text encoder and
design complex human instructions (CHI) to leverage Gemma’s in-context learning and reasoning, improving image-text alignment.<br>
• <strong style="font-size: 18px;">Efficient Training and Inference Strategy: </strong>
We propose automatic labeling and training strategies to improve text-image consistency.
For each image, multiple VLMs generate re-captions, leveraging their complementary strengths to enhance caption diversity.
Additionally, we introduce a CLIPScore-based training strategy, dynamically selecting high-CLIPScore captions based on probability,
improving training convergence and text-image alignment. We also propose a <strong style="font-size: 1.05em;">Flow-DPM-Solver</strong>,
reducing inference sampling steps from 28-50 to 14-20 compared to the Flow-Euler-Solver, while achieving better results.</div> -->
<p>
<div>
<img src="asset/content/incremental.jpg" alt="details of difference parts for efficiency improvement" class="inserted-image">
</div>
<!--BibTex citation -->
<section class="citation" id="BibTeX">
<div class="citation-content">
<h2 class="title">BibTeX</h2>
<pre><code>@misc{,
}</code></pre>
</div>
</section>
</section>
<!--End BibTex citation -->
<!-- Footer Section -->
<footer class="footer">
<div class="container">
<div class="columns is-centered">
<div class="column is-8">
<div class="content">
<p class="has-text-centered">Total clicks: <span id="busuanzi_value_site_pv"></span></p>
</div>
</div>
</div>
</div>
</footer>
<!-- End Footer -->
<script>
// Function to open the modal and display the clicked image and description
function openModal(img) {
var modal = document.getElementById("modal");
var modalImg = document.getElementById("modal-img");
var modalDescription = document.getElementById("modal-description");
modal.style.display = "flex";
modalImg.src = img.src;
modalDescription.textContent = img.getAttribute('data-description'); // Get description from data-description attribute
}
// Add click event listeners to all images in the gallery with their descriptions
const images = document.querySelectorAll('.gallery-item img');
images.forEach((img) => {
img.addEventListener('click', () => openModal(img));
});
</script>
</body>
<head>
<style>
.splitscreen {
display: flex;
}
.splitscreen .split-0 {
flex: 33%;
}
.splitscreen .split-1 {
flex: 33%;
}
.splitscreen .split-2 {
flex: 33%;
}
.image-comparison-container-0, .image-comparison-container-1, .image-comparison-container-2 {
background-color: #fff; /* Solid background color that spans the entire width */
}
.image-comparison-content-0, .image-comparison-content-1, .image-comparison-content-2 {
position: relative;
width: 440px; /* Adjust the width as needed */
height: 440px; /* Adjust the height as needed */
overflow: hidden; /* Make sure overflow isn't hiding any part of the images */
margin: 0 auto;
margin-top: 10px;
margin-bottom: 20px;
cursor: ew-resize;
border-radius: 10px;
}
.image-comparison-content-0 img, .image-comparison-content-1 img, .image-comparison-content-2 img {
position: absolute;
width: 100%;
height: 99%;
background-color: #fff;
object-fit: contain; /* Use contain to ensure the whole image is visible */
}
.image-comparison-content-0 .slider-0, .image-comparison-content-1 .slider-1, .image-comparison-content-2 .slider-2 {
position: absolute;
top: 0;
bottom: 0;
left: 50%;
width: 2px;
background-color: #fff;
z-index: 10;
}
.image-comparison-content-0 .image-0-2, .image-comparison-content-1 .image-1-2, .image-comparison-content-2 .image-2-2 {
clip-path: inset(0 0 0 50%);
}
</style>
</head>
<div class="splitscreen">
<div class="split-0">
<section class="image-comparison-container-0">
<div class="image-comparison-content-0">
<img src="assets/images/reconstruction/0_ours_f64c128_with_text.png" alt="Image 1" class="image-0-1"/>
<img src="assets/images/reconstruction/0_sd_f64c128_with_text.png" alt="Image 2" class="image-0-2"/>
<div class="slider-0"></div>
</div>
</section>
</div>
<div class="split-1">
<section class="image-comparison-container-1">
<div class="image-comparison-content-1">
<img src="assets/images/reconstruction/8_ours_f64c128_with_text.png" alt="Image 1" class="image-1-1"/>
<img src="assets/images/reconstruction/8_sd_f64c128_with_text.png" alt="Image 2" class="image-1-2"/>
<div class="slider-1"></div>
</div>
</section>
</div>
<div class="split-2">
<section class="image-comparison-container-2">
<div class="image-comparison-content-2">
<img src="assets/images/reconstruction/10_ours_f64c128_with_text.png" alt="Image 1" class="image-1-1"/>
<img src="assets/images/reconstruction/10_sd_f64c128_with_text.png" alt="Image 2" class="image-1-2"/>
<div class="slider-2"></div>
</div>
</section>
</div>
</div>
<script>
const container = document.querySelector('.image-comparison-content-0');
const slider = document.querySelector('.slider-0');
const image2 = document.querySelector('.image-0-2');
container.addEventListener('mousemove', (e) => {
const rect = container.getBoundingClientRect();
let xPos = e.clientX - rect.left;
if (xPos < 0) xPos = 0;
if (xPos > rect.width) xPos = rect.width;
const percentage = (xPos / rect.width) * 100;
slider.style.left = `${percentage}%`;
// slider_black.style.left = `${percentage}%`;
image2.style.clipPath = `inset(0 0 0 ${percentage}%)`;
// image4.style.clipPath = `inset(0 0 0 ${percentage}%)`;
});
</script>
<script>
const container1 = document.querySelector('.image-comparison-content-1');
const slider1 = document.querySelector('.slider-1');
const image1_2 = document.querySelector('.image-1-2');
container1.addEventListener('mousemove', (e) => {
const rect = container1.getBoundingClientRect();
let xPos = e.clientX - rect.left;
if (xPos < 0) xPos = 0;
if (xPos > rect.width) xPos = rect.width;
const percentage = (xPos / rect.width) * 100;
slider1.style.left = `${percentage}%`;
image1_2.style.clipPath = `inset(0 0 0 ${percentage}%)`;
});
</script>
<script>
const container2 = document.querySelector('.image-comparison-content-2');
const slider2 = document.querySelector('.slider-2');
const image2_2 = document.querySelector('.image-2-2');
container2.addEventListener('mousemove', (e) => {
const rect = container2.getBoundingClientRect();
let xPos = e.clientX - rect.left;
if (xPos < 0) xPos = 0;
if (xPos > rect.width) xPos = rect.width;
const percentage = (xPos / rect.width) * 100;
slider2.style.left = `${percentage}%`;
image2_2.style.clipPath = `inset(0 0 0 ${percentage}%)`;
});
</script>
<video controls muted autoplay loop>
<source src="assets/videos/diffusion/speed_comparison.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</html>