/StyleGANLatent_CLIP_manipulation

Using CLIP and StyleGAN to generate faces from prompts.

Primary LanguagePythonMIT LicenseMIT

StyleCLIP

In this repo is the code used to generate face images from prompts in Generating Images from Prompts using CLIP and StyleGAN.

Envirionment setup

After cloning this repo, enter into the StyleCLIP folder and run the following command to create a new conda environment named "styleclip" with all the required packages.

conda env create -f environment.yml

StyleGAN Weights

Download the .pt file from here and store it inside the folder of this repo with the name karras2019stylegan-ffhq-1024x1024.for_g_all.pt.

Generate faces

Run the following command to generate a face with a custom prompt. In this case the prompt is "The image of a woman with blonde hair and purple eyes"

python clip_generate.py --prompt "The image of a woman with blonde hair and purple eyes"

The results will be stored under the folder generations with the name of the prompt that you have entered.