VinAIResearch / WaveDiff

Official Pytorch Implementation of the paper: Wavelet Diffusion Models are fast and scalable Image Generators (CVPR'23)
GNU Affero General Public License v3.0
366 stars 28 forks source link

Inverse a image to latent space and recover it #5

Closed Aravinda27 closed 1 year ago

Aravinda27 commented 1 year ago

How to

1) inverse a image to latent space and record the latent.

2) and then reconstruction latent vector to a same image.

anyone can help me, how can i do this.

Thanks.

Best wishes.

hao-pt commented 1 year ago

Hi, we have not tried this before but you could refer to CycleDiffusion paper that introduces an invertible DPM-Encoder to map an image into latent space using the formulas of reverse process (see 3.2 and A.4). This guarantees the perfect reconstruction.

Aravinda27 commented 1 year ago

Hi, thanks for the reply. I will look into the paper you referred... Can we interpolate the image after we sample from model like in DDIM??

hao-pt commented 1 year ago

I am not sure as the stochasticity of sampling process might alter the behavior of interpolation. Alternatively, we can allocate all random variables beforehand like (x_T, z_T, ..., z_0, epT, ..., ep0) (as listed in CycleDiffusion) and then use them when you perform interpolation.

Aravinda27 commented 1 year ago

Thanks a lot for the answer.. I am closing the issue...