lucidrains / deep-daze

Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network). Technique was originally created by https://twitter.com/advadnoun
MIT License
4.37k stars 326 forks source link

Penalizing certain phrases #146

Open zfletch opened 3 years ago

zfletch commented 3 years ago

This is a really great project and thank you to everyone involved. One feature I find myself wanting is the ability to penalize certain strings, like big-sleep does. As far as I can tell, there is currently no way to do this.

In my own clone of the project, I've added a command line flag that I think does that (link). (Caveat: I am not familiar with the code base and this could be completely wrong.)

Example:

Using deep-daze to draw an animal ./imagine 'animal' --image_width 200 --num_layers 10 --epochs 1 --seed 1234567890: animal

Do the same thing, but with nothing that looks like a deer ./imagine 'animal' --image_width 200 --num_layers 10 --epochs 1 --seed 1234567890 --text_penalize 'deer': animal-deer

Is this a feature that would be appreciated by other users? If it is, and if nobody else is working on it, I can work on a pull request. My code is a mess, so I would also be happy if someone else wanted to use it as a starting point and make a PR instead.