yuval-alaluf / hyperstyle

Official Implementation for "HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing" (CVPR 2022) https://arxiv.org/abs/2111.15666
https://yuval-alaluf.github.io/hyperstyle/
MIT License
1.01k stars 115 forks source link

Image creation from latent code #50

Closed leeisack closed 2 years ago

leeisack commented 2 years ago

Good paper, thanks for the code.

I want to try a few things in latent code editing, and I'm looking for a way to create an image directly from the latent code. Any help in this regard would be of great help. Thank you.

yuval-alaluf commented 2 years ago

You have a loaded generator you can generate the image using something like the following:

images, _ = self.generator([latents],
        weights_deltas=weight_deltas,
        randomize_noise=False,
        input_is_latent=True)

where weight_deltas is the output of the hypernetwork. If you don't have any weight offsets, you can simply set this argument to None.

leeisack commented 2 years ago

Thank you. 'weights_deltas=None ' was the difficulty I had. thank you it was a great help