hila-chefer / Conceptor

Official implementation of the paper The Hidden Language of Diffusion Models
https://hila-chefer.github.io/Conceptor/
69 stars 0 forks source link

Concept Manipulation #3

Open lindapu-1 opened 1 year ago

lindapu-1 commented 1 year ago

Hi Hila! Thanks for your fantastic work.

I found the concept manipulation example to be incredibly intriguing, especially when it comes to dual-meaning concepts like "crane."

I'm curious about how you adjust the weight of "stork" in the showcased example to illustrate different degrees of the concept. Is it simply a matter of manipulating the weight of "stork" in the embedding? Additionally, I'm wondering if there is any code available that allows us to experiment with this concept manipulation.

Thank you!

hila-chefer commented 11 months ago

Hi @lindapu-1, thanks for your interest and your kind words!

Our code is available under the Google research repo so you should be able to reproduce our results by following the instructions there :) As for the manipulation- after obtaining the decomposition, you can see an example of performing inference with the learned decomposition in this notebook. The Visualize top coefficients and top tokens cell allows you to print the top 10 decomposition elements and their learned coefficients. You can then manipulate the coefficients (in sorted_alphas). For the "stork" example, I recommend trying to zero out the coefficient to see its impact, and trying to multiply it by a factor of 2 to see the stork element in the original image.

I hope this helps!