Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
avdravid authored Jun 13, 2024
1 parent 44b07ce commit 7ec8594
Showing 1 changed file with 78 additions and 30 deletions.
108 changes: 78 additions & 30 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
content="Interpreting the Weight Space of Customized Diffusion Models.">
<meta name="keywords" content="Nerfies, D-NeRF, NeRF">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>weights2weights</title>

<!-- Global site tag (gtag.js) - Google Analytics -->
Expand Down Expand Up @@ -147,6 +147,7 @@ <h2 class="subtitle has-text-centered">
<div class="column is-four-fifths">
<h2 class="title is-3">Abstract</h2>
<div class="content has-text-justified">
<p style="font-size: 18px;">
We investigate the space of weights spanned by a large collection of customized diffusion models. We populate this space by creating a dataset of over 60,000 models, each of which is fine-tuned to insert a different person’s visual identity. Next, we model the underlying manifold of these weights as a subspace, which we term <em>weights2weights</em>. We demonstrate three immediate applications of this space -- sampling, editing, and inversion. First, as each point in the space corresponds to an identity, sampling a set of weights from it results in a model encoding a novel identity. Next, we find linear directions in this space corresponding to semantic edits of the identity (e.g., adding a beard). These edits persist in appearance across generated samples. Finally, we show that inverting a single image into this space reconstructs a realistic identity, even if the input image is out of distribution (e.g., a painting). Our results indicate that the weight space of fine-tuned diffusion models behaves as an interpretable latent space of identities.
</p>
</div>
Expand Down Expand Up @@ -181,15 +182,16 @@ <h2 class="title is-3">Video</h2>
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</style>
<div class="columns is-centered has-text-centered">
<h2 class="title is-3">Creating <em>weights2weights</em> Space</h2>
</div>
<div class="content has-text-justified" >
<!-- <h3 class="title is-3">Key idea</h3> -->
<img src="./images/w2w_scheme.jpg" alt="scheme" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px;">
We create a dataset of model weights where each model is finetuned to encode a specific identity using low-rank updates (LoRA). These model weights lie on a weights manifold that we further project into a lower-dimensional subspace spanned by its principal components. We term the resulting space <em>weighst2weights</em> (<em>w2w</em>), in which operations transform one set of valid identity-encoding weights into another. We train linear classifiers to find separating hyperplanes in this space for semantic attributes. These define disentangled edit directions for an identity-encoding model in weight space.

<br>
<p style="font-size: 18px;"><br>We create a dataset of model weights where each model is finetuned to encode a specific identity using low-rank updates (LoRA). These model weights lie on a weights manifold that we further project into a lower-dimensional subspace spanned by its principal components. We term the resulting space <em>weighst2weights</em> (<em>w2w</em>), in which operations transform one set of valid identity-encoding weights into another. We train linear classifiers to find separating hyperplanes in this space for semantic attributes. These define disentangled edit directions for an identity-encoding model in weight space.</p>

</div>
</div>
</div>
Expand Down Expand Up @@ -221,14 +223,14 @@ <h2 class="title is-3">Creating <em>weights2weights</em> Space</h2>
text-align: center;
}
</style>

<div class="columns is-centered has-text-centered">
<h2 class="title is-3">Identity Editing</h2>
</div >
<div class="content has-text-justified" >
Given an identity parameterized by weights, we can manipulate attributes by traversing semantic directions in the <em>w2w</em> weight subspace. The edited weights result in a new model, where the subject has different attributes while still maintaining as much of the prior identity. These edits are <b>not</b> image-specific, and persist in appearance across different generation seeds and prompts. Additionally, as we operate on an identity weight manifold, minimal changes are made to other concepts, such as scene layout or other people. Try out the sliders below to demonstrate edits in <em>w2w</em> space.
<p style="font-size: 18px;"> Given an identity parameterized by weights, we can manipulate attributes by traversing semantic directions in the <em>w2w</em> weight subspace. The edited weights result in a new model, where the subject has different attributes while still maintaining as much of the prior identity. These edits are <b>not</b> image-specific, and persist in appearance across different generation seeds and prompts. Additionally, as we operate on an identity weight manifold, minimal changes are made to other concepts, such as scene layout or other people. Try out the sliders below to demonstrate edits in <em>w2w</em> space. </p>
</div>

<h3 class="title is-4">Slide the bars to edit the identity.</h2>
<div class="content" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 20px;">
<div id="imageContainer">
Expand All @@ -237,7 +239,7 @@ <h3 class="title is-4">Slide the bars to edit the identity.</h2>


<label for="sliderA">Curly Hair:</label>
<input type="range" id="sliderA" class="slider is-large is-info" name="sliderA" min="0" max="4" value="0" oninput="updateImage()">
<input type="range" id="sliderA" class="slider" name="sliderA" min="0" max="4" value="0" oninput="updateImage()">

<!-- <input type="range" id="sliderA" name="sliderA" min="0" max="4" value="0"> -->
<span id="valueA">0</span>
Expand All @@ -246,15 +248,15 @@ <h3 class="title is-4">Slide the bars to edit the identity.</h2>

<label for="sliderB">Pointy Nose:</label>
<!-- <input type="range" id="sliderB" name="sliderB" min="0" max="4" value="0"> -->
<input type="range" id="sliderB" class="slider is-large is-info" name="sliderB" min="0" max="4" value="0" oninput="updateImage()">
<input type="range" id="sliderB" class="slider" name="sliderB" min="0" max="4" value="0" oninput="updateImage()">

<span id="valueB">0</span>

<br>

<label for="sliderC">Narrow Eyes:</label>
<!-- <input type="range" id="sliderC" name="sliderC" min="0" max="4" value="0"> -->
<input type="range" id="sliderC" class="slider is-large is-info" name="sliderC" min="0" max="4" value="0" oninput="updateImage()">
<input type="range" id="sliderC" class="slider" name="sliderC" min="0" max="4" value="0" oninput="updateImage()">

<span id="valueC">0</span>

Expand Down Expand Up @@ -299,34 +301,34 @@ <h3 class="title is-4">Slide the bars to edit the identity.</h2>
.clickable-area {
cursor: pointer;
}
</style>
</style>
<div class="columns is-centered has-text-centered">
<h2 class="title is-3">Sampling</h2>
</div>
<div class="content has-text-justified" >
Modeling the underlying manifold of identity-encoding weights allows sampling a new model that lies on it. This results in a new model that generates a novel identity that is consistent across generations. We provide examples of sampling models from <em>w2w</em> space below, demonstrating a variety of facial attributes, hairstyles, and contexts.
<p style="font-size: 18px;">Modeling the underlying manifold of identity-encoding weights allows sampling a new model that lies on it. This results in a new model that generates a novel identity that is consistent across generations. We provide examples of sampling models from <em>w2w</em> space below, demonstrating a variety of facial attributes, hairstyles, and contexts. </p>
</div>

<h3 class="title is-4">Click to sample an identity-encoding model.</h2>
<!-- <h3 class="title is-3">Key idea</h3> -->
<img src="./images/sampling/sample_animation.gif" alt="sampling" usemap="#workmap" id="mainImage" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 0px;" >

<map name="workmap" id="workmap">
<area id="rect1" shape="rect" coords="1866,754,2225,871" alt="rect1" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part19.jpg')">
<area id="rect2" shape="rect" coords="2282,731,2643,847" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part20.jpg')">
<area id="rect3" shape="rect" coords="1523,571,1884,687" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part21.jpg')">
<area id="rect4" shape="rect" coords="1287,790,1648,905" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part22.jpg')">
<area id="rect4" shape="rect" coords="888,687,1250,802" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part23.jpg')">
<area id="rect1" shape="rect" coords="1866,754,2225,871" alt="rect1" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part19.jpg')">
<area id="rect2" shape="rect" coords="2282,731,2643,847" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part20.jpg')">
<area id="rect3" shape="rect" coords="1523,571,1884,687" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part21.jpg')">
<area id="rect4" shape="rect" coords="1287,790,1648,905" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part22.jpg')">
<area id="rect4" shape="rect" coords="888,687,1250,802" alt="rect2" title="click" class="clickable-area" onclick="changeImage('./images/sampling/sampling_Part23.jpg')">
</map>

<script>

function changeImage(im_name) {
document.getElementById('mainImage').src = im_name;

document.getElementById('mainImage').src = im_name;
}
</script>

</div>
</div>
</div>
Expand All @@ -351,10 +353,10 @@ <h2 class="title is-3">Inversion</h2>
<div class="content has-text-justified" >
By constraining a diffusion model's weights to lie in <em>w2w</em> space while following the standard diffusion loss, we can invert the identity from a single image into the model without overfitting. Typical inversion into a generative latent space projects the input onto the data (e.g., image) manifold. Similarly, we project onto the manifold of identity-encoding model weights. Projection into <em>w2w</em> space generalizes to unrealistic or non-human identities, distilling a realistic subject from an out-of-distribution identity. We provide examples of inversion below with a variety of input types.
</div>
<h3 class="title is-4">Click on an image to invert it into a model.</h2>
<h3 class="title is-4">Click on an image to invert its subject into a model.</h2>
<div class="content">
<!-- <h3 class="title is-3">Key idea</h3> -->
<img src="./images/inversion/inversion_animation.gif" alt="inversion" usemap="#workmapb" id="mainImageb" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999;">
<img src="./images/inversion/inversion_animation.gif" alt="inversion" usemap="#workmapb" id="mainImageb" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999;">
<!-- style="transform: translate(45px,0px);" -->
<map name="workmapb">
<area id="rect1b" shape="rect" coords="32, 51, 603, 607" alt="rect1b" class="clickable-area" onclick="changeImage2('./images/inversion/inversion_Part21.jpg')">
Expand All @@ -364,11 +366,11 @@ <h3 class="title is-4">Click on an image to invert it into a model.</h2>

<script>
function changeImage2(im_name) {
document.getElementById('mainImageb').src = im_name;

document.getElementById('mainImageb').src = im_name;
}
</script>

</div>
</div>
</div>
Expand All @@ -387,17 +389,63 @@ <h3 class="title is-4">Click on an image to invert it into a model.</h2>
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</style>
<div class="columns is-centered has-text-centered">
<h2 class="title is-3">Connection to Generative Latent Spaces</h2>
</div>
<div class="content has-text-justified">
<img src="./images/w2w_vs_GAN.jpg" alt="w2w_vs_gan">
As seen from the interactive examples above, <em>weights2weights</em> space enables applications analogous to those of a traditional generative latent space–-inversion, editing, and sampling–-but producing model weights rather than images. With generative models such as GANs, the instance is a latent mapping to an image, whereas the instance with <em>weights2weights</em> is a set of identity-encoding weights.
<p style="font-size: 18px;">As seen from the interactive examples above, <em>weights2weights</em> space enables applications analogous to those of a traditional generative latent space–-inversion, editing, and sampling–-but producing model weights rather than images. With generative models such as GANs, the instance is a latent mapping to an image, whereas the instance with <em>weights2weights</em> is a set of identity-encoding weights. </p>
</section>



<section class="section">
<div class="container is-max-desktop">
<style>
img {
-drag: none;
user-select: none;
-moz-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.image-container img {
width: 50%; /* Adjust the width as needed */
max-width: 500px; /* Maximum width */
height: auto; /* Maintain aspect ratio */
}
</style>
<div class="columns is-centered has-text-centered">
<h2 class="title is-3">More Results</h2>
</div>
<br>
<h3 class="title is-4">Composing Edits in Weight Space</h2>
<img src="./images/compose_all.jpeg" alt="compose" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px;">
<br>
<br>
<br>
<h3 class="title is-4">Continuous Control over Identity Edits</h2>
<img src="./images/continuous.jpeg" alt="continuous" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px;">
<br>
<br>
<br>
<h3 class="title is-4">Identity Inversion + Editing</h2>
<img src="./images/inversion_web.jpg" alt="inversion_edit" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px;">
<br>
<br>
<br>
<h3 class="title is-4">Out-of-Distribution Identity Projection</h2>
<img src="./images/ood_project_web.jpeg" alt="ood_project" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px;">
<br>
<br>
<br>
<h3 class="title is-4"><em>w2w</em> Sampling and Nearest Neighbor Identities</h2>
<img src="./images/sampling_web.jpeg" alt="sampling" style="border: 2px solid gray; border-radius: 15px; box-shadow: 0px 0px 10px #999; padding: 5px; width: 750px;">
</section>





Expand Down Expand Up @@ -470,10 +518,10 @@ <h2 class="title">BibTeX</h2>
</div>
</footer>

<script src="./static/resize/imageMapResizer.min.js"></script>
<script src="./static/resize/imageMapResizer.min.js"></script>
<script>
imageMapResize();
</script>
</script>

</body>
</html>

0 comments on commit 7ec8594

Please sign in to comment.