Giter Club home page Giter Club logo

styleclip's Introduction

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.

styleclip's People

Contributors

vipermu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

styleclip's Issues

What's up with the colors?

Putting anything will give a pretty good output, but in some situations the colors will become all mixed.

80

Is there any reason behind this?

How to use --ref_img_path argument?

I use the following command,
python clip_generate.py --prompt "blonde hair and purple eyes and very angry"

it seems to work perfectly, but when I change the reference image path
python clip_generate.py --ref_img_path .\input --prompt "blonde hair and purple eyes and very angry"

it comes out as:
Traceback (most recent call last):
File "clip_generate.py", line 125, in
ref_img = clip_preprocess(Image.open(ref_img_path)).unsqueeze(0).to(device)
File "C:\Work\PythonEnv\PytorchTool\lib\site-packages\PIL\Image.py", line 3227, in open
fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: '.\input'

then I add the filename and run again
python clip_generate.py --ref_img_path .\input\target.jpg --prompt "blonde hair and purple eyes and very angry"

it works but does not start from my reference photo.

Please help! sorry for my poor English.

License

Hi,

Can you please add license to this repo.

Thanks,
Krishna

Error related to prompt

Hi, I'm trying to run the clip_generate.py, but I'm facing this error message every time I try to run the command:
line 223, in makedirs mkdir(name, mode) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: './generations\\"The image of a woman with blonde hair and purple eyes"'

how can I fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.