-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
766 lines (721 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
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Visii: Visual Instruction Inversion: Image Editing via Image Prompting</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,500,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/assets/css/Highlight-Clean.css">
<link rel="stylesheet" href="/assets/css/styles.css">
<link rel="apple-touch-icon" sizes="180x180" href="https://em-content.zobj.net/source/animated-noto-color-emoji/356/eyes_1f440.gif">
<link rel="icon" type="image/png" sizes="32x32" href="https://em-content.zobj.net/source/animated-noto-color-emoji/356/eyes_1f440.gif">
<link rel="icon" type="image/png" sizes="16x16" href="https://em-content.zobj.net/source/animated-noto-color-emoji/356/eyes_1f440.gif">
<link rel="manifest" href="/site.webmanifest">
<meta property="og:site_name" content="Visual Instruction Inversion: Image Editing via Image Prompting" />
<!-- <meta property="og:type" content="video.other" /> -->
<meta property="og:title" content="Visual Instruction Inversion: Image Editing via Image Prompting" />
<meta property="og:description" content="A framework for inverting visual prompts* into *editing instructions for text-to-image diffusion models." />
<meta property="og:url" content="https://thaoshibe.github.io/visii" />
<meta property="og:image" content="./assets/images/preview.png" />
<meta name="twitter:title" content="Visual Instruction Inversion: Image Editing via Image Prompting" />
<meta name="twitter:description" content="A framework for inverting visual prompts into editing instructions for text-to-image diffusion models." />
<meta name="twitter:url" content="https://thaoshibe.github.io/visii" />
<meta name="twitter:image" content="./assets/images/preview.png" />
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-RK8Z1K8X2K');
</script>
<!-- <meta name="twitter:site" content="" /> -->
<style type="text/css">
.btn {
color:black;
text-decoration:none;
}
.btn:hover {
color: black;
text-decoration:none;
}
* {box-sizing:border-box}
/* Slideshow container */
.slideshow-container {
max-width: 768px;
position: relative;
margin: auto;
}
.citation {
background-color: #f1f1f1; /* Replace with your desired color */
border: 1px solid #DCDCDC;
padding-left: 30px;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 8px;
}
/* Hide the images by default */
/* Next & previous buttons */
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
margin-top: 0px;
padding: 16px;
color: white;
font-weight: bold;
font-size: 18px;
/* transition: 0.6s ease;*/
border-radius: 0 3px 3px 0;
}
/* Position the "next button" to the right */
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
background-color: rgba(0,0,0,0);
}
/* Caption text */
/*.text {
color: #f2f2f2;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}*/
/* Number text (1/3 etc) */
/*.numbertext {
color: #f2f2f2;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 0;
}*/
/* The dots/bullets/indicators */
.dot {
cursor: pointer;
height: 9px;
width: 9px;
margin: 0 2px;
background-color: #bbb;
color:gray;
display: inline-block;
/* transition: background-color 0.6s ease;*/
}
.active, .dot:hover {
background-color: #FFFFCC;
}
/* Fading animation */
.fade {
animation-name: fade;
animation-duration: 1s;
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
table.demo1 {
width:900;
text-align:center;
margin-left:auto;
margin-right: auto;
}
td.prompt {
width:100%;
text-align:center;
font-family: times, serif;
font-size:110%;
}
td.prompt a {
color: #B0B0B0;
text-decoration:none;
}
td.prompt a:hover, td.prompt a.active {
color:black;
text-decoration:none;
}
.img-stack {
position:relative;
display: block;
width:256px;
height:256px;
}
.img-stack img {
position: absolute;
top: 0px;
left: 0px;
z-index: 0;
}
.img-stack img.active {
z-index: 0;
}
.img-stack .overlay {
width: 256px;
height: 256px;
opacity: 0;
transition: opacity 0.2s;
z-index: 0;
position: absolute;
top: 0px;
left: 0px;
background: white;
}
.carousel > table {
position:absolute;
top: 0px;
transition: left 0.2s;
width:1000px;
}
.carousel_table td {
text-align:center;
}
.carousel_table td:nth-child(4) {
font-size:200%;
}
pre {
background-color:#eee;
border: 1px solid #999;
border-radius: 5px;
padding: 10px;
white-space: break-spaces;
width:80%;
text-align:left;
}
.dl_link {
display: inline-block;
padding-right: 6px;
padding-left: 6px;
padding-top: 2px;
padding-bottom: 2px;
}
.dl_link, .dl_link td {
color: black;
text-decoration: none;
font-size: 120%;
}
.dl_link, .dl_link table {
border-radius: 5px;
background-color: none;
}
.dl_link:hover, .dl_link:hover * {
color: #404040 !important;
background-color: #d9d9d9 !important;
}
@media only screen and (max-width: 768px) {
.content { width:100% !important; }
}
<style type="text/css">
.btn {
color:black;
text-decoration:none;
}
.btn:hover {
color:gray;
text-decoration:none;
}
table.demo1 {
width:90%;
text-align:center;
}
/*.demo1 img {
width:256px;
}*/
td.prompt {
width:100%;
text-align:center;
font-family: fantasy;
font-size:100%;
};
td.prompt a {
color:#ddd;
text-decoration:none;
}
td.prompt a:hover, td.prompt a.active {
color:black;
text-decoration:none;
}
.img-stack {
position:relative;
display: block;
/* width:256px;
height:256px;*/
}
.img-stack img {
position: absolute;
top: 0px;
left: 0px;
z-index: 0;
}
.img-stack img.active {
z-index: 1;
}
.img-stack .overlay {
width: 256px;
height: 256px;
opacity: 0;
transition: opacity .2s;
z-index: 2;
position: absolute;
top: 0px;
left: 0px;
background: white;
}
/*.carousel {
position:relative;
width:650px;
height:385px;
overflow:hidden;
}*/
/*.carousel > table {
position:absolute;
top: 0px;
transition: left 0.2s;
width:256px;
}*/
/*.carousel_table td {
text-align:center;
}*/
/*.carousel_table td:nth-child(5) {
font-size:150%;
}*/
.citation-container {
position: relative;
}
.copy-button {
position: absolute;
top: 55px;
right: 20px;
background: none;
border: none;
cursor: pointer;
/* font-size: 12px;*/
/* color: black; /* Adjust the color as needed */*/
}
/*.copy-icon {
display: inline-block;
width: 12px;
height: 12px;
border: 2px solid #333;
border-top: none;
border-right: none;
transform: rotate(-45deg);
}*/
pre {
background-color:#eee;
border: 1px solid #999;
border-radius: 5px;
padding: 10px;
white-space: break-spaces;
width:80%;
text-align:left;
}
td.gif {
width: 33%;
font-family: monospace;
font-size: 120%;
}
.dl_link {
display: inline-block;
padding-right: 6px;
padding-left: 6px;
padding-top: 2px;
padding-bottom: 2px;
}
.dl_link, .dl_link td {
color: black;
text-decoration: none;
font-size: 120%;
}
.dl_link, .dl_link table {
border-radius: 5px;
background-color: none;
}
.dl_link:hover, .dl_link:hover * {
color: #404040 !important;
background-color: #d9d9d9 !important;
}
@media only screen and (max-width: 930px) {
.content { width:100% !important; }
}
</style>
<script type="text/javascript">
var curr_idx = 0;
var num_tables = 5;
function move(direction) {
if (curr_idx == 0 && direction < 0) {
move(num_tables - 1);
return;
}
if (curr_idx == num_tables - 1 && direction > 0) {
move(-1 * (num_tables - 1));
return;
}
tables = document.getElementsByClassName("carousel_table");
for(var i = 0; i < tables.length; i++) {
tables[i].style.left = (parseInt(tables[i].style.left.substring(0, tables[i].style.left.length - 2)) - direction * 650).toString() + "px";
}
curr_idx += direction;
}
function hideOverlay(classname) {
document.getElementById(classname + "_overlay").style.opacity = "0";
}
function activate_img(classname, idx, max) {
document.getElementById(classname + "_overlay").style.opacity = "1";
setTimeout(function() {
for(var i = 1; i <= max; i++) {
document.getElementById(classname + "_" + i.toString()).className = "";
document.getElementById(classname + "_text_" + i.toString()).className = "";
}
document.getElementById(classname + "_" + idx.toString()).className = "active";
document.getElementById(classname + "_text_" + idx.toString()).className = "active";
setTimeout(hideOverlay, 200, classname);
}, 200);
}
let img_id = 1;
let interval_id;
function activate(classname,idx,max){
activate_img(classname, idx, max);
clearInterval(interval_id);
}
if (!interval_id){
interval_id = setInterval(()=>{
img_id = img_id + 1;
if (img_id > 9){
img_id = 1;
}
activate_img('bo', img_id, 9);
}, 2500);
}
function copyToClipboard() {
const citationText = document.getElementById("citation").innerText;
// Create a temporary textarea element
const textarea = document.createElement("textarea");
textarea.value = citationText;
document.body.appendChild(textarea);
// Copy the text from the textarea to the clipboard
textarea.select();
document.execCommand("copy");
// Remove the temporary textarea
document.body.removeChild(textarea);
// Display a success message or perform any other desired action
// alert("Citation copied to clipboard!");
}
function toggleblock(blockId)
{
var block = document.getElementById(blockId);
if (block.style.display == 'none') {
block.style.display = 'block' ;
} else {
block.style.display = 'none' ;
}
}
$( document ).ready(function() {
$( ".blockId" ).click(function() {
$('.blockId').toggle();
$(this).toggleClass('open');
});
});
</script>
</head>
<!-- <body> -->
<body>
<div class="highlight-clean" style="padding-top: 15px;padding-bottom:10px;">
<div class="container" style="max-width: 768px;">
<h1 class="text-center"><b>Visual Instruction Inversion</b>:<br>
Image Editing via Visual Prompting
</h1>
</div>
<div><center><h5>——— NeurIPS 2023 ———</h5></center></div>
<div class="container" style="max-width: 600px;">
<div class="row authors">
<div class="col-sm-3">
<h5 class="text-center"><a class="text-center" href="https://thaoshibe.github.io/">Thao Nguyen</a></h5>
</div>
<div class="col-sm-3">
<h5 class="text-center"><a href="https://yuheng-li.github.io/">Yuheng Li</a></h5>
</div>
<div class="col-sm-3">
<h5 class="text-center"><a class="text-center" href="https://utkarshojha.github.io/">Utkarsh Ojha</a></h5>
</div>
<div class="col-sm-3">
<h5 class="text-center"><a class="text-center" href="https://pages.cs.wisc.edu/~yongjaelee/">Yong Jae Lee</a></h5>
</div>
</div>
<div><center><h6 class="text-center">University of Wisconsin - Madison</h6></center></div>
</div>
<div class="buttons" style="margin-bottom: 8px;">
<center>
<a class="btn btn-light" role="button" href="https://arxiv.org/abs/2307.14331">
<svg style="width:24px;height:24px;margin-left:-12px;margin-right:12px" viewBox="0 0 24 24">
<path fill="currentColor" d="M16 0H8C6.9 0 6 .9 6 2V18C6 19.1 6.9 20 8 20H20C21.1 20 22 19.1 22 18V6L16 0M20 18H8V2H15V7H20V18M4 4V22H20V24H4C2.9 24 2 23.1 2 22V4H4M10 10V12H18V10H10M10 14V16H15V14H10Z"></path>
</svg>Paper
</a>
<a class="btn btn-light" role="button" href="https://neurips.cc/media/PosterPDFs/NeurIPS%202023/70612.png?t=1702527232.3909361">
<svg style="width:24px;height:24px;margin-left:-12px;margin-right:12px" viewBox="0 0 24 24">
<path fill="currentColor" d="M16 0H8C6.9 0 6 .9 6 2V18C6 19.1 6.9 20 8 20H20C21.1 20 22 19.1 22 18V6L16 0M20 18H8V2H15V7H20V18M4 4V22H20V24H4C2.9 24 2 23.1 2 22V4H4M10 10V12H18V10H10M10 14V16H15V14H10Z"></path>
</svg>Poster
</a>
<a class="btn btn-light" role="button" href="https://github.com/thaoshibe/visii">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
Code
</a>
</center>
</div>
</div>
<div class="container" style="max-width: 900px;">
<table class="demo1">
<tr>
<td style="width:100%;">
<table id ="bo_table" class="carousel_table">
<tr>
<td></td>
<td></td>
<td><b>Test Image</b></td>
<td></td>
<td><b>Edited Image</b></td>
</tr>
<tr>
<td><b>Before</b><br><img src="images/0_0.png" width="100"/></td>
<td><b>After</b><br><img src="assets/images/demo1/after.png" width="100"/></td>
<td><img src="images/1_0.png" width="256"/></td>
<td><center>→</center></td>
<td>
<div class="img-stack">
<img src="assets/images/demo1/husky.png" id="bo_2" width="256" />
<img src="assets/images/demo1/tiger.png" id="bo_3" width="256" />
<img src="assets/images/demo1/squirrel.png" id="bo_4" width="256" />
<img src="assets/images/demo1/polar_bear.png" id="bo_5" width="256" />
<img src="assets/images/demo1/rabbit.png" id="bo_6" width="256" />
<img src="assets/images/demo1/bluejay.png" id="bo_7" width="256" />
<img src="assets/images/demo1/badger.png" id="bo_8" width="256" />
<img src="assets/images/demo1/pitbull.png" id="bo_9" width="256" />
<img src="assets/images/demo1/ins.png" id="bo_1" width="256" activate="True"/>
<div class="overlay" id="bo_overlay"></div>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="font-family: fantasy;"><b><font color='blue'>Visual Prompt</font></b><br>(Before -> After direction)<br><font style="color:red">‹ins›</font></td>
<!-- <td></td> -->
<td colspan="3" class="prompt" style="text-align: left;"> <b><font color='green'>Editing instruction:</font></b>
<a href="#" id="bo_text_1" onclick="activate('bo', 1, 9);" class="active">[<font style="color:red">‹ins›</font> only]</a>
<a href="#" id="bo_text_2" onclick="activate('bo', 2, 9);">[‹ins› + "husky" 🐕]</a>
<a href="#" id="bo_text_3" onclick="activate('bo', 3, 9);">[<font style="color:red">‹ins›</font> + "tiger" 🐯]</a><br>
<a href="#" id="bo_text_4" onclick="activate('bo', 4, 9);">[<font style="color:red">‹ins›</font> + "squirrel" 🐿️]</a>
<a href="#" id="bo_text_5" onclick="activate('bo', 5, 9);">[<font style="color:red">‹ins›</font> + "polar bear" 🐻❄️]</a>
<a href="#" id="bo_text_6" onclick="activate('bo', 6, 9);">[<font style="color:red">‹ins›</font> + "rabbit" 🐰]</a><br>
<a href="#" id="bo_text_7" onclick="activate('bo', 7, 9);">[<font style="color:red">‹ins›</font> + "blue jay" 🐦]</a>
<a href="#" id="bo_text_8" onclick="activate('bo', 8, 9);">[<font style="color:red">‹ins›</font> + "badger" 🦡]</a>
<a href="#" id="bo_text_9" onclick="activate('bo', 9, 9);">[<font style="color:red">‹ins›</font> + "pit bull" 🐶]</a>
</td>
</tr>
</table>
</div>
</center>
</td>
</tr>
</table>
</div>
<hr class="divider" />
<div class="container" style="max-width: 768px;">
<div class="row">
<div class="col-md-12">
<!-- <h5></h5> -->
<p><b>TL;DR:</b>
A framework for <font style='color:red'>inverting</font> <font style='color:blue'>visual prompts</font> into <font style="color:green">editing instructions</font> for text-to-image diffusion models.
</p>
<!-- <h5>ELI5:</h5> -->
<!-- p><b>ELI5:</b>
You show the machine how to perform a task (by images), and then it replicates your actions. For example, it can learn your drawing style 🖍️ and use it to create a new drawing 🎨.
</p> -->
</div>
</div>
</div>
<hr class="divider" />
<div class="container" style="max-width: 768px;">
<div class="row">
<div class="col-md-12">
<h2>Abstract</h2>
<p>
<!-- <strong> -->
Text-conditioned image editing has emerged as a powerful tool for editing images.
However, in many situations, language can be ambiguous and ineffective in describing specific image edits.
When faced with such challenges, visual prompts can be a more informative and intuitive way to convey ideas.</p>
<p>
We present <b>a method for image editing via visual prompting</b>.
Given pairs of example that represent the "before" and "after" images of an edit, our goal is to learn a text-based editing direction that can be used to perform the same edit on new images.
We leverage the rich, pretrained editing capabilities of text-to-image diffusion models by inverting visual prompts into editing instructions.<br></p>
<p>
Our results show that with just one example pair, we can achieve competitive results compared to state-of-the-art text-conditioned image editing frameworks.
</p>
</div>
<hr style="width:70%;">
<center>
<video width="90%" controls autoplay>
<source src="./assets/images/hybrid_instruction.mp4" type="video/mp4" >
</video>
</center>
</div>
</div>
<!-- <br> -->
<hr style="width:70%;">
<div class="container" style="max-width: 900px;">
<table style="width:100%;text-align: center;">
<tr>
<td colspan="3" style="width: 40%; background-color:#f5f5f5"> <b>Prior Work: Text-conditioned image editing </b></td>
<td colspan="4" style="width: 60%; background-color:#FFFFCC"> <b>📍 Ours: Visual Prompting Image Editing</b></td>
</tr>
<tr>
<td>Text Prompt</td>
<td>Test Image</td>
<td>Output</td>
<td><font color="blue">Visual Prompt:</font> Before → After </td>
<td>Test Image</td>
<td>Output</td>
</tr>
<tr>
<td style="width:12%;"><font style="font-family:fantasy;">"Make it a drawing"</font></td>
<td><img src="./assets/images/prior-vs-ours/mam_test.png" width="120px"></td>
<!-- <td style="width:12%;"><font style="font-family:fantasy;">"Make it a drawing"</font></td> -->
<td><img src="./assets/images/prior-vs-ours/mam_ip2p.png" width="120px"></td>
<td style="width: 35%"><img src="./assets/images/prior-vs-ours/mam_0.png" width="120px">→<img src="./assets/images/prior-vs-ours/mam_1.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/mam_test.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/mam_output.png" width="120px"></td>
</tr>
<tr>
<td style="width:12%;"><font style="font-family:fantasy;">"Turn it into an aerial photo"</font></td>
<td><img src="./assets/images/prior-vs-ours/map_test.png" width="120px"></td>
<!-- <td style="width:12%;"><font style="font-family:fantasy;">"Turn it into an aerial photo"</font></td> -->
<td><img src="./assets/images/prior-vs-ours/map_ip2p.png" width="120px"></td>
<td style="width: 35%"><img src="./assets/images/prior-vs-ours/map_0.png" width="120px">→<img src="./assets/images/prior-vs-ours/map_1.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/map_test.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/map_output.png" width="120px"></td>
</tr>
<!-- <tr>
<td style="width:12%;"><font style="font-family:fantasy;">"Make it 3D animated character"</font></td>
<td><img src="./assets/images/prior-vs-ours/starbucks_1_0.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/starbuck_ip2p.png" width="120px"></td>
<td style="width: 35%"><img src="./assets/images/prior-vs-ours/starbuck_0_0.png" width="120px">→<img src="./assets/images/prior-vs-ours/starbuck_0_1.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/starbucks_1_0.png" width="120px"></td>
<td><img src="./assets/images/prior-vs-ours/starbuck_ours.png" width="120px"></td>
</tr> -->
<tr style="text-align:left">
<td colspan='3'><i>Text-conditioned scheme (Prior work):<br>
Model takes an input image and a <b>text prompt</b> to perform the desired edit.</i></td>
<td colspan="3"><i>Visual prompting scheme (Ours):<br>
Given a pair of <b>before-after images</b> of an edit, our goal is to learn an implicit text-based editing instruction, and then apply it to new images.</i></td></tr>
</table>
</div>
<hr style="width:70%;">
<div class="container" style="max-width: 910px;">
<!-- Interesting case! -->
<b>💡 Use Case:</b> What if the desired edit is difficult to describe in words?<br>
E.g., describing how to transform the Starbucks logo into a "3D version". In this case, a <font style="color:red">visual prompt</font> is more efficient than a text prompt.<br>
<table style="font-family: fantasy;font-size: 75%;">
<tr>
<td><br><b>Before:</b><br><img src="./assets/images/prior-vs-ours/starbuck_0_0.png" alt="before" width='130'/></td>
<!-- <td>⇨<font style="color:red"> <instruction>🔥 </font>⇨</instruction> -->
<td><br><b>After:</b><br><img src="./assets/images/prior-vs-ours/starbuck_0_1.png" alt="after" width='130'/></td>
<td colspan=5 style="font-family: serif; font-size: 130%;text-align: center;">🧚 Inspired by <a href="https://www.reddit.com/r/StableDiffusion/comments/11avhpn/starbucks_logo_exploration_with_controlnet/">this reddit</a>, we tested <a href="https://github.com/thaoshibe/visii#starbucks-logo">Visii + InstructPix2Pix</a> with Starbucks and Gandour logos.</td>
</tr>
<tr>
<td><br><b>Test:</b><br><img src="./assets/images/prior-vs-ours/starbucks_1_0.png" alt="test" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "Wonder Woman"<br><img src="./assets/images/prior-vs-ours/starbucks_wonder_woman.png" alt="ours" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "Scarlet Witch"<br><img src="./assets/images/prior-vs-ours/starbucks_scarlet_witch.png" alt="ours" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "Daenerys Targaryen"<br><img src="./assets/images/prior-vs-ours/starbucks_dragon.png" alt="ours" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "Neytiri in Avatar"</font><br><img src="./assets/images/prior-vs-ours/starbucks_avatar.png" alt="ours" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "She-Hulk"<br><img src="./assets/images/prior-vs-ours/starbucks_shehulk.png" alt="ours" width='130'/></td>
<td><b><font style="color:red"> <ins> <br></font></b>+ "Maleficent"<br><img src="./assets/images/prior-vs-ours/starbucks_maleficent.png" alt="ours" width='130'/></td>
</tr>
</table>
<hr class="divider" />
<div class="container" style="max-width: 768px;">
<div class="row">
<div class="col-md-12">
<h2>How does it work?</h2>
<p>Given an example before-and-after image pair, we optimize the latent text instruction that converts the “before” image to the “after” image using a frozen image editing diffusion model, e.g., <a href="https://www.timothybrooks.com/instruct-pix2pix/">InstructPix2Pix</a>.</p>
<center><img src="./assets/images/framework.png" width="450px" alt="framework"></center>
</div>
</div>
</div>
<hr class="divider" />
<div class="container" style="max-width: 768px;">
<div class="row">
<div class="col-md-12">
<h2>Hybrid instruction</h2>
We only optimize a fixed number of tokens, so we have the flexibility to concatenate additional information to the learned instruction during inference. Users can input extra information to combine or guide the learned instruction according to their preferences.
<!-- This allows us to achieve more fine-grained control over the resulting images. -->
<!-- Figure~\ref{fig:concat} shows qualitative results of this approach. -->
</div>
</div>
</div>
<hr style="width:70%;">
<div class="container" style="max-width: 900px;">
<table style="width:100%;text-align: center;">
</tr>
<td colspan="2"><img src="./assets/images/ins-concat.png" width="100%" alt="ins-concat"></td>
</tr>
<tr style="text-align:left">
<td width="35%"><i><b>Instruction Optimization</b>: We optimize instruction embedding <font style="color:red">‹ins›</font></i>.</td>
<td><i><b>Instruction Concatenation</b>: During test time, we can add extra information into the learned instruction <font style="color:red">‹ins›</font> to further guide the edit.</i></td>
</table>
</div>
<hr style="width:70%;">
<!-- More examples. -->
<!-- More examples on hybrid instructions. -->
<div class="container" style="max-width: 900px;">
<img src="./assets/images/concat.png" width="100%" alt="ins-concat-2">
<i>We can concatenate extra information into the learned instruction <font style="color:red">‹ins›</font> to navigate the edit. This allows us to achieve more fine-grained control over the resulting images.</i>
</div>
<hr class="divider" />
<div class="container" style="max-width: 768px;">
<div class="row">
<div class="col-md-12">
<h2>Citation</h2>
<div id='citation' class="citation" style="font-family:monospace;font-size: 14px;">
<!-- @misc{VisualInstructionInversion,<br>
title={Visual Instruction Inversion: Image Editing via Visual Prompting,<br>
author={Thao Nguyen and Yuheng Li and Utkarsh Ojha and Yong Jae Lee},<br>
year={2023},<br>
eprint={2307.14331},<br>
archivePrefix={arXiv},<br>
primaryClass={cs.CV}<br>
} -->
@inproceedings{nguyen2023visual,<br>
title={Visual Instruction Inversion: Image Editing via Visual Prompting},<br>
author={Nguyen, Thao and Li, Yuheng and Ojha, Utkarsh and Lee, Yong Jae},<br>
booktitle={Thirty-seventh Conference on Neural Information Processing Systems},<br>
year={2023},<br>
url={https://openreview.net/forum?id=l9BsCh8ikK}<br>
}
</div>
<button class="copy-button" onclick="copyToClipboard()">
<i style="font-size:24px;color: gray;" class="fa"></i>
</button>
</div>
</div>
</div>
<!-- Import the component -->
<hr class="divider" />
<div class="container" style="max-width: 768px; padding-bottom:30px;">
<div class="row">
<div class="col-md-12">
<!-- <h2>Citation</h2> -->
This website template is adopted from <a href="https://dreamfusion3d.github.io/">DreamFusion</a> and <a href='https://imagic-editing.github.io/#'>Imagic</a>, source code can be found <a href="https://github.com/dreamfusion3d/dreamfusion3d.github.io">here</a> and <a href='https://github.com/imagic-editing/imagic-editing.github.io'>here</a>. Photo credit: <a href="https://www.instagram.com/avoshibe/">Bo the Shiba</a>. Thank you!
<a href="javascript:toggleblock('notice')" style="text-align:left;font-size:100%;color:#D3D3D3"> (.❛ ᴗ ❛.).</a>
<div id="notice" style="display:none; color:#dedede; font-size:.5em;">
<!-- <p> -->
<script type='text/javascript' id='clustrmaps' src='//cdn.clustrmaps.com/map_v2.js?cl=ffffff&w=a&t=tt&d=AEr40ow1CCzGJFakg0K7dO50kMYl14Fw5_t7_yaMmWs'></script>
<!-- </p> -->
</div>
</div>
</div>
</div>
</body>
</html>