r/MachineLearning • u/Wiskkey • Feb 25 '21
Project [P] Text-to-image Google Colab notebook "Aleph-Image: CLIPxDAll-E" has been released. This notebook uses OpenAI's CLIP neural network to steer OpenAI's DALL-E image generator to try to match a given text description.
Google Colab notebook. Twitter reference.
Update: "DALL-E image generator" in the post title is a reference to the discrete VAE (variational autoencoder) used for DALL-E. OpenAI will not release DALL-E in its entirety.
Update: A tweet from the developer, in reference to the white blotches in output images that often happen with the current version of notebook:
Well, the white blotches have disappeared; more work to be done yet, but that's not bad!
Update: Thanks to the users in the comments who suggested a temporary developer-suggested fix to reduce white blotches. To make this fix, change the line in "Latent Coordinate" that reads
normu = torch.nn.functional.gumbel_softmax(self.normu.view(1, 8192, -1), dim=-1).view(1, 8192, 64, 64)to
normu = torch.nn.functional.gumbel_softmax(self.normu.view(1, 8192, -1), dim=-1, tau = 1.5).view(1, 8192, 64, 64)by adding ", tau = 1.5" (without quotes) after "dim=-1". The higher this parameter value is, apparently the lower the chance is of white blotches, but with the tradeoff of less sharpness. Some people have suggested trying 1.2, 1.7, or 2 instead of 1.5.
I am not affiliated with this notebook or its developer.
Example using text "The boundary between consciousness and unconsciousness":

11
u/Mefaso Feb 25 '21
It doesn't steer dall-e, it steers the discrete VAE used in dall-e.
Very cool nontheless
11
u/[deleted] Feb 25 '21
If you've wanted to use DALL-E for artistic purposes you'll still have to wait, as they only released the VAE and this notebook can't replicate the results shown in the paper.
6
u/varkarrus Feb 25 '21
I tried it out, but I'm getting white blotches?
It's a real shame they're not releasing DALL-E in its entirety. I'm imagining it'll be like GPT-3 and they'll do an API eventually but...
2
u/thomash Feb 27 '21
Here is an updated notebook with the white blotches fixed: https://colab.research.google.com/drive/1Fb7qTCumPvzSLp_2GMww4OV5BZdE-vKJ?usp=sharing
2
u/StruggleNo700 Apr 10 '21
This is super-cool. Thank you for posting!
1
u/axeheadreddit Feb 28 '21
Hi there! Iām an unskilled person that just found this sub. So Iām not sure what all the coding means but I was able to follow the directions.
I input text > restart and run all. As the instructions say, I have a pic that looks like dirt. Waited about 5 min and no change. Started the process over and the same thing happened. Is it supposed to take a long time or am I doing it wrong?
I did notice two error messages as well after the dirt image:
and
1
u/eminx_ Mar 15 '21
How long am I supposed to wait for the training image to start changing.
1
u/AvantGarde1917 Mar 07 '21
I tried that tau randomly from seeing it pop up in the autocompletion. I was under the impression it was integer only, so I've been using tau=4 or up to tau=16. It's 'less sharp' but the image is full, and if you let it learn it produces nice results.
2
u/AvantGarde1917 Mar 07 '21
"A culture of cells coagulated from a cesspool of stagnated water"
https://i.imgur.com/WnSxuVR.png
2
u/AvantGarde1917 Mar 07 '21
A futuristic city of the socialist future
<img>https://i.imgur.com/IY5oToV.jpg</img>
1
u/[deleted] Feb 25 '21
Ok!
1
u/metaphorz99 May 20 '21 edited May 20 '21
Great idea. I tried tau=1.8 and re-ran the default text "city scape in the style of Van Gogh", and got a sequence of fully colored images (no white spaces). Cannot figure out how to insert an image. Copy/paste on a .png didn't work.