create account

How to Paint a Mouth with AI by speakerjohnash

View this thread on: hive.blogpeakd.comecency.com
· @speakerjohnash · (edited)
$1.82
How to Paint a Mouth with AI
![mouthdraw.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/48VjhnJHpRff6eWhq5uVguFjwJQec7vQMgRiWHRiV7PXmikQU8fNVQU42do9GbBgf9.jpg)

I thought I'd share a bit about how I create AI art.

AI art uses generative representational learning trained on collections of images labeled by humans. It learns semantic relations between language and visual patterns.

You paint by priming it with a description of what you'd like to see. However language is infinitely interpretable. A single description can be painted infinite ways. 

So there is a level of randomness or stochasticity in the output. 

I wanted to draw St. Vincent. These models have some understanding of the structure of even mildly famous people's faces. Often it will at least understand key features, and if I can collect enough key features it will resemble the person.

When you start your canvas is layers of gaussian noise:


![download.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AJegqxNQDF5Pftsj88XrG3BUFi1XVBw83GraNPdYcARMh5fjXbCvT7BdnW32C1n.png)

Kind of looks likes clouds huh? Like how you can see patterns in the clouds?

Well the model looks for patterns in the clouds that look like the thing you want to see.

The model doesn't just look at the image as a whole to evaluate whether it looks like the description. It takes sub-cuts of the image and evaluates those too. When it takes smaller cuts, it can add more detail. When it takes larger cuts it can focus more on the larger picture.

For things like landscapes, it can paint straight from noise well. In nature there are a lot of repeating sub-patterns. So it has a lot of things to paint, and you don't need a lot of coherence.

![Matter - Silver Pools.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/23wWnWBsoKTgPGSVN1yjNj15S7mDQ1kapZvVcEjK8hoJLPqyKRNFiWrWU4ungKbg63SrQ.png)

[On auction now](https://opensea.io/assets/0x495f947276749ce646f68ac8c248420045cb7b5e/10256208898865363571229992701136440797138960351050235788086098267471519678465)

This series for example takes advantage of the fact that coral has a lot of subtleties to draw and if it's looking at every section of the image the same then it's going to do great.

But most images don't look as composed as this. 

Most look like this:

![Matter - Golden Cove.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/242Nexb5T6XDHz4A5CX2cVbGbcB55xayShpyV5xbpqRGMei6qSNkEUMfRCMQMx7wuyDuo.png)

[For purchase here](https://objkt.com/asset/KT1Up2EACknsbqa5mbMs3jHh72B4bbtkFpxL/20)

It's kind of just throwing random coral and clouds and shit everywhere. It looks beautiful but it's not composed as a full image.

I basically accepted this in my early art and just tried to paint vaguely beautiful patterns to see how well I could control color and lighting:


![2nd Heaven.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/23uQjuzhesQ6w1oSTuqCdeU2fZzF41xwzgndzbN9r1rDk4p2RVDbEr9XvDpDBS4fFVGDa.png)

[For purchase here](https://objkt.com/asset/KT1Up2EACknsbqa5mbMs3jHh72B4bbtkFpxL/13)


In order to get better composition, in early steps of mutation from the initial noise, the samples need to mostly focus on the whole picture so it can sketch something and not get lost in the details:


![download (1).png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AK6Y7MkQnCQxJwMNZcUqUxFJ4qgqzZcby1nqGiQ4BPFUcy5StF8Sypxneg1xXwx.png)

This was primed with "a monkey riding a tiger", you can kind of see mammalian features forming in the noise, and there seems to be one coherent figure. 

If I let this keep going it would fill in all the detail depending on how the cuts are made to evaluate against the description.


![TimeToDisco(337)_0000-99%.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AK578AzfTnTUR6K2sGo6bBAQesZh3aLFq2srmncfjjPbdciyT7djKco377jLBqS.png)

Okay weird, kind of bad. Kind of looks like it. But mostly it's shit. 

Most images output by the model are like this. Vaguely in line with the description but still not that coherent.

However, if you tune the parameters just right, and say exactly the right thing, and let the same prompt run many times, you have somewhere to start from.

SO! Back to St. Vincent. 

I primed a model with well tuned parameters for generating faces with the phrase "st. vincent" to see if it "knew" who she was. 

My first few outputs looked like this:

![d7f6ac06-07ae-4cfe-a256-b398e905709a_st._vincent.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKLu5GuZUtdkxrLiFqTJdV8poSpARYeGVTsAGnMMFqz3zY73eMoTKrNzraX51a8.png)

Wow! It can paint a lot of things out of nothing! Some things are coherent almost immediately! Plus I recognize her face here. So it's clear to me the pattern of her likeness is in there somewhere, I just need to suss it out. It's also interpreting the religious interpretation and I don't want that. But I feel confident I can paint her with these models with a little elbow grease and a few hours and a few hundred renders. I could still paint her if it didn't have images of her in the training set but it would be a lot harder. 

For example, I recently rendered an image of owocki who is not that well known.

In this case, he has a very particular color hair and beard. If I capture that I basically capture a lot of his essence.


![zpLPRpbS_400x400.jpeg](https://files.peakd.com/file/peakd-hive/speakerjohnash/AK3duyYeJV9wJTG18SNL5x6GFQC2AfJ1NTz5RJxQbr2cCgtYxDza24phtsR2o6b.jpeg)



He also is all about green pill and regenerative crypto-economics so the general vibe crafts his likeness. But it's definitely way easier if the model has seen images of the person you're trying to paint.


![peace owocki.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKKRGTpouDKCyWxDahHeaGdraSRgwJqwYhXacZm32AZ33hwfCz3MkMy5zr4XZqS.png)

After a few renders I find something that I feel is just embodying St. Vincent without the religious energy.

![09d99107-6498-445e-9084-13b8c0096933_st._vincent_with_guitar_illustration.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKAsg42sToxJe35MKnCXGMWJ1SM6Hhs167oStBZ4sKBLn6W7Z3U26fHWea3XmuH.png)

These are okay. It gets her hair and it's bringing in the music elements. I also was able to get rid of the religious elements. They're still fairly clumsy drawings. They don't look anywhere as complex as the cover photo.

I also really don't like the color. I'd love to just say what colors but every word added affects the interpretation of all other words. So I use other words associated with color patterns like "80's" or "90s". 


![b6f3e880-6b87-425d-9d4d-151f66a9f32a_st._vincent_with_guitar_illustration.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AJpkWgFuB2cj7nWZbHxuGjvGyFBFJLrYzGVySeqAMTeyiJu8KhEBpprbbZLPaxj.png)

Finally I hone in on what I'm looking for:


![5b83a947-289d-4c51-ace3-535ed24d6a11_st_vincent_illustration_magazine_cover.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKe8sMtRyRcRwu5JkJtGu97EKfLBWyPcEtBoHD6p8Y6dC3GEwMARXjfw7atieoE.png)

Something that I feel really embodies her energy and style. I feel like she has an 80's aesthetic but there's something classic there as well. Here I have found a local optima of what I perceive as quality that aligns with what "feels right"

I decide I really like the bottom right image but I'd like her to have a chin. How do I approach this?

![f65f06eb-a8f9-4a90-a23d-b8c0f4822dea_st_vincent_illustration_magazine_cover.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKNMHmdghb5vTGfSGMVLjznQxyLLQqLMunH6Tr1Lkvji3BgmW7xT1ZCBszAj7U4.png)

Well every change in word is going to dramatically change the output. I need to retain some features and change others. So I make variations on this image with different hyperparameters. Hyper-paramters are values that affect how the model will draw. 

But I can also just take a very small step in latent space. It will mutate the image randomly.

Latent space is where all the patterns are encoded. Your location in it along with the hyperparameters determines the output by the model.

A point in latent space will output similar but different images.

So I start mutating the image:


![9ccfed55-a1a6-4786-abe4-65d92f589b21_st_vincent_illustration_magazine_cover.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKNMcrRqPhTixDcP4396Vj9wCX4TNBG5fKtvoRm6i3PJ7heFvzUaBpsrXDhbWuy.png)

Okay cool... Definitely looking like a mutant.

Her face is now ... on at least. Her face is not off. It's roughly in the right place... Let's take this point in latent space and start looking in different directions to find semantically similar outputs.

![409653aa-393e-4fff-9165-177efff94634_st_vincent_illustration_magazine_cover.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKPnouxd3NbGZm5vqYQ1hEZeCisr9wkVV2fG6FHsY88Bqx5qGKCTfpwzp3SKxpc.png)

Well here's... a full nose... and a mouth! Let's go from here!


![stv.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKRE4stBfTbYMbg3mzQjHs6cCuqLzZjEyyUXBjeV5Y8RAZku6YXBRLzENiAXmCR.png)

Fuck. Fuck, this variant is stunning. But the mouth is gone. I know with the current access I have to the tools I have limited control over what direction I can move in latent space. 


![59d1d83c-c9d4-435b-9710-c661622a4ae3_st_vincent_illustration_magazine_cover.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKJ3aLDpacoZgeVZFsQkBzY1QJRRgDhUHjzRXJeyzK9k9riAERouCicdfRyVfWS.png)

I finally have a coherent face with lips, eyes, nose and hair. But it has lost something. 


![stv22edit.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKGcKJzhv5GY9zAT2FqvJo1XR6Mxb4HF4pnFjkXpwrSAQgSfmrcGVBarjCep9Vz.png)

I do many more nested iterations of mutation seeking to regain some of the earlier spark. And the final product is great. And it does have a similar energy and it definitely is well composed. But did I lose something along the way? Maybe.

Ultimately I still wish I could have simply added a chin to this image:


![stv.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKRE4stBfTbYMbg3mzQjHs6cCuqLzZjEyyUXBjeV5Y8RAZku6YXBRLzENiAXmCR.png)

Everything about it is stunning. But you aren't painting with pixels, you're painting with patterns. There are other neural tools you can try, or just photoshop which I did try but ultimately I was unsatisfied.

In the future the tools will evolve. Who knows how the interface will improve?

But I am sure that these models can construct any image with enough iterations and refinement. And that's an exciting and fascinating prospect.

EDIT:

![vincent2.png](https://files.peakd.com/file/peakd-hive/speakerjohnash/AKRE4tPFinW2Eo6BVcc6ziAhNEbAnBC1NcaG2ZgtoEz2EuUgzyyAzeHSqaEB1pL.png)


I decided I needed to know how she looked completed and completed her via more traditional means.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorspeakerjohnash
permlinkhow-to-paint-a-mouth-with-ai
categoryhive-158694
json_metadata{"app":"peakd/2022.03.7","format":"markdown","portfolio":true,"tags":["art","blog","aiart","ai","painting","digitalart","generativeart","experimental","illustration"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/speakerjohnash/48VjhnJHpRff6eWhq5uVguFjwJQec7vQMgRiWHRiV7PXmikQU8fNVQU42do9GbBgf9.jpg","https://files.peakd.com/file/peakd-hive/speakerjohnash/AJegqxNQDF5Pftsj88XrG3BUFi1XVBw83GraNPdYcARMh5fjXbCvT7BdnW32C1n.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/23wWnWBsoKTgPGSVN1yjNj15S7mDQ1kapZvVcEjK8hoJLPqyKRNFiWrWU4ungKbg63SrQ.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/242Nexb5T6XDHz4A5CX2cVbGbcB55xayShpyV5xbpqRGMei6qSNkEUMfRCMQMx7wuyDuo.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/23uQjuzhesQ6w1oSTuqCdeU2fZzF41xwzgndzbN9r1rDk4p2RVDbEr9XvDpDBS4fFVGDa.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AK6Y7MkQnCQxJwMNZcUqUxFJ4qgqzZcby1nqGiQ4BPFUcy5StF8Sypxneg1xXwx.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AK578AzfTnTUR6K2sGo6bBAQesZh3aLFq2srmncfjjPbdciyT7djKco377jLBqS.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKLu5GuZUtdkxrLiFqTJdV8poSpARYeGVTsAGnMMFqz3zY73eMoTKrNzraX51a8.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AK3duyYeJV9wJTG18SNL5x6GFQC2AfJ1NTz5RJxQbr2cCgtYxDza24phtsR2o6b.jpeg","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKKRGTpouDKCyWxDahHeaGdraSRgwJqwYhXacZm32AZ33hwfCz3MkMy5zr4XZqS.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKAsg42sToxJe35MKnCXGMWJ1SM6Hhs167oStBZ4sKBLn6W7Z3U26fHWea3XmuH.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AJpkWgFuB2cj7nWZbHxuGjvGyFBFJLrYzGVySeqAMTeyiJu8KhEBpprbbZLPaxj.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKe8sMtRyRcRwu5JkJtGu97EKfLBWyPcEtBoHD6p8Y6dC3GEwMARXjfw7atieoE.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKNMHmdghb5vTGfSGMVLjznQxyLLQqLMunH6Tr1Lkvji3BgmW7xT1ZCBszAj7U4.png","https://files.peakd.com/file/peakd-hive/speakerjohnash/AKNMcrRqPhTixDcP4396Vj9wCX4TNBG5fKtvoRm6i3PJ7heFvzUaBpsrXDhbWuy.png"]}
created2022-03-23 00:35:48
last_update2022-03-24 05:05:00
depth0
children3
last_payout2022-03-30 00:35:48
cashout_time1969-12-31 23:59:59
total_payout_value0.003 HBD
curator_payout_value1.815 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length10,777
author_reputation3,202,701,818,668
root_title"How to Paint a Mouth with AI"
beneficiaries
0.
accounthiveonboard
weight100
1.
accountocdb
weight100
2.
accountpeakd
weight300
3.
accountreward.app
weight9,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,600,145
net_rshares2,560,862,095,991
author_curate_reward""
vote details (35)
@akida ·
Amazing artwork you created. Super nice style.
👍  
properties (23)
authorakida
permlinkr97pzg
categoryhive-158694
json_metadata{"app":"hiveblog/0.1"}
created2022-03-23 19:26:09
last_update2022-03-23 19:26:09
depth1
children0
last_payout2022-03-30 19:26:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation87,804,788,749,927
root_title"How to Paint a Mouth with AI"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,623,822
net_rshares1,079,312,112
author_curate_reward""
vote details (1)
@eve66 ·
Hi, It's great all your art, the lights, the landscapes and the colours.

I'm learning and it's not easy the parameters and less when you don't have knowledge in programming, however learning every day. 

I don't have the slightest idea what hyperparameters are but I understand as if you change the words in the ad.

Love the picture with no chin, it's iconic, weird and great.

 #midjourney I haven't had the privilege of being admitted yet.
👍  
properties (23)
authoreve66
permlinkre-speakerjohnash-r96h2d
categoryhive-158694
json_metadata{"tags":["hive-158694"],"app":"peakd/2022.03.7"}
created2022-03-23 03:15:48
last_update2022-03-23 03:15:48
depth1
children0
last_payout2022-03-30 03:15:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length443
author_reputation198,734,937,118,249
root_title"How to Paint a Mouth with AI"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,603,013
net_rshares1,212,430,961
author_curate_reward""
vote details (1)
@hivebuzz ·
Congratulations @speakerjohnash! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@speakerjohnash/upvotes.png?202203230632"></td><td>You distributed more than 50 upvotes.<br>Your next target is to reach 100 upvotes.</td></tr>
<tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@speakerjohnash/upvoted.png?202203230632"></td><td>You received more than 300 upvotes.<br>Your next target is to reach 400 upvotes.</td></tr>
<tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@speakerjohnash/comments.png?202203230632"></td><td>You made more than 10 comments.<br>Your next target is to reach 50 comments.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@speakerjohnash) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/nftforpeace/@hivebuzz/nft-for-peace"><img src="https://images.hive.blog/64x128/https://i.imgur.com/tBCp4ps.png"></a></td><td><a href="/nftforpeace/@hivebuzz/nft-for-peace">Introducing NFT for Peace</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202203-15"><img src="https://images.hive.blog/64x128/https://i.imgur.com/xwzanZE.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202203-15">Hive Power Up Month - Feedback from February day 15</a></td></tr></table>

###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22199%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/199)!
properties (22)
authorhivebuzz
permlinknotify-speakerjohnash-20220323t063719
categoryhive-158694
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-03-23 06:37:21
last_update2022-03-23 06:37:21
depth1
children0
last_payout2022-03-30 06:37:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,851
author_reputation369,503,494,097,033
root_title"How to Paint a Mouth with AI"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,606,182
net_rshares0