Just a quick update, today. Amy and I were toying with the Gallery the other night and created something fun. It all started when we noticed a picture of Baby Einstein on the wall. No, not that one, the old German guy with the speeding problem. Anyways, we thought the picture was adorable, and it seemed a simple thing to write up, so I added a new mode to the gallery.

The code isn't terribly interesting, it just pulls randomly from several of the arrays I had made for other modes.


        
        {% if is_state('input_boolean.gallery_mode_babby_form', 'on') %}
            {{ ( state_attr('input_select.gallery_modifier_famous_person', 'options') | 
                 reject('eq', states('input_select.gallery_mode_babby_form_adj') ) | list | random ) }} photograph of {{kodi}} 
                 
            {{ ( [ ( state_attr('input_select.gallery_modifier_famous_person', 'options') | 
                 reject('eq', states('input_select.gallery_modifier_famous_person') ) | list | random ), 
                 
                   ( state_attr('input_select.gallery_modifier_fictional_character', 'options') | 
                 reject('eq', states('input_select.gallery_modifier_fictional_character') ) | list | random ), 
                 
                   ( state_attr('input_select.gallery_modifier_historical_figure', 'options') | 
                 reject('eq', states('input_select.gallery_modifier_historical_figure') ) | list | random ), 
                 
                   ( state_attr('input_select.gallery_modifier_superhero', 'options') | 
                 reject('eq', states('input_select.gallery_modifier_superhero')) | list | random ), 
                 
                   ( state_attr('input_select.gallery_mode_out_of_place_characters_characters', 'options') | 
                 reject('eq', states('input_select.gallery_mode_out_of_place_characters_characters') ) | list | random ) ] | random ) }}
                 
                  {{ ( state_attr('input_select.gallery_modifier_famous_person', 'options') | 
                 reject('eq', states('input_select.gallery_mode_babby_form_actions')) | list | random ) }}
                 
                 {{  ( state_attr('input_select.gallery_modifier_famous_person', 'options') | 
                 reject('eq', states('input_select.gallery_mode_babby_form_pants')) | list | random ) ]
            }}, as a baby, 
        {% endif %} 

It looks worse than it is.

So each of these blocks:

{{ ( state_attr('input_select.gallery_modifier_famous_person', 'options') | 
     reject('eq', states('input_select.gallery_mode_babby_form_adj') ) | 
     list | random ) 
}}

is basically doing the same thing. It pulls a random element from an input_select (which I am just using as an array). These input_selects are all full of the sorts of things you would expect, based on their names:

gallery_modifier_famous_person: 
  name: "Gallery_modifier_famous_person"
  options:
    - "andre the giant"
    - "bill nye"
    - "rick astley"
    - "sinaid oconner"
    - "peter jackson"
    - "george lucas"
    - "brandon sanderson"
    - "gene roddenbery"
    - "connan obrian"
    - "snoop dogg"
    - "steve buscemi"
    - "Rowan Atkinson"
    - "Stephen Hawking"
    - "Christopher Walken"
    - "Marty Feldman"
    - "Ernest P. Worrell"
    - "Macho Man Randy Savage"
    - "scarlett johnanson"
    - "rodney dangerfield"
    - "elvis"
    - "jimmy hoffa"
    - "johnny carson"
    - "steve carrell"
    - "stephen colbert"
    - "jon stewart"
    - "patrick stewart"
    - "bernie sanders"
    - "obama"
    - "harrison ford"
    - "bill murray"
    - "martin short"
    - "steve martin"
    - "leslie nielson"
    - "john candy"
    - "motley crue"
    - "alice cooper"
    - "david tennant"
    - "vince mcmahon"
    - "Hulk Hogan"
    - "the rock"
    - "shaq"
    - "samuel l jackson"
    - "Albert Einstein"
    - "Marilyn Monroe"
    - "Martin Luther King Jr."
    - "Queen Elizabeth II"
    - "Nelson Mandela"
    - "Mahatma Gandhi"
    - "Elvis Presley"
    - "John F. Kennedy"
    - "Mother Teresa"
    - "Steve Jobs"
    - "Michael Jackson"
    - "Winston Churchill"
    - "Muhammad Ali"
    - "Bill Gates"
    - "John Lennon"
    - "Paul McCartney"
    - "George Washington"
    - "Abraham Lincoln"
    - "Frida Kahlo"
    - "Marie Curie"
    - "Bob Marley"
    - "Bruce Lee"
    - "Neil Armstrong"
    - "Rosa Parks"
    - "Dalai Lama"
    - "Elton John"
    - "Jimi Hendrix"
    - "Mark Zuckerberg"
    - "Barack Obama"
    - "Queen Victoria"
    - "Stephen Hawking"
    - "Prince"
    - "David Bowie"
    - "Audrey Hepburn"
    - "Tom Hanks"
    - "Angelina Jolie"
    - "Johnny Depp"
    - "bozo the clown"
    - "mr. rogers"
    - "sting"
    - "david bowie"

A short list of famous people the models know how to draw.

gallery_modifier_fictional_character:
  name: "Gallery_modifier_fictional_character"
  options:
    - "homer simpson"
    - "marge simpson"
    - "bart simpson"
    - "maggie simpson"
    - "lisa simpson"
    - "abe simpson"
    - "flanders"
    - "princess jasmine"
    - "princess peach"
    - "Mario"
    - "bowser"
    - "Han solo"
    - "terminator"
    - "pac-man"
    - "luke Skywalker"
    - "princess leia"
    - "obi wan kenobi"
    - "dora the explorer"
    - "darth vader"
    - "megatron"
    - "optimus prime"
    - "snakeyes"
    - "cobra commander"
    - "mr.ed"
    - "chainsaw man"
    - "starscream"
    - "hannibal lecter"
    - "darth vader"
    - "mr rogers"
    - "the unibomber"
    - "james bond"
    - "indiana jones"
    - "ellen ripley"
    - "the terminator"
    - "hal 9000"
    - "hans gruber"
    - "my little pony"
    - "strawberry shortcake"
    - "pizza the hut"
    - "jabba the hut"
    - "the blue meanies"
    - "Mickey Mouse"
    - "James Bond"
    - "Sherlock Holmes"
    - "Harry Potter"
    - "Luke Skywalker"
    - "Darth Vader"
    - "Homer Simpson"
    - "Bugs Bunny"
    - "SpongeBob SquarePants"
    - "Elsa (Frozen)"
    - "Simba (The Lion King)"
    - "Dora the Explorer"
    - "Marge Simpson"
    - "Shrek"
    - "Gandalf"
    - "Frodo Baggins"
    - "Jack Sparrow"
    - "The Joker"
    - "Darth Vader"
    - "Hannibal Lecter"
    - "Freddy Krueger"
    - "Jason Voorhees"
    - "Darth Maul"
    - "Voldemort"
    - "The Wicked Witch of the West"
    - "Gollum"
    - "Sauron"
    - "Cruella de Vil"
    - "Maleficent"
    - "Darth Sidious"
    - "Jabba the Hutt"
    - "The Terminator"
    - "Hannibal Lecter"
    - "Norman Bates"
    - "Freddy Krueger"
    - "Jigsaw"
    - "Dracula"
    - "The Evil Queen (Snow White)"
    - "Cinderella's Wicked Stepmother"
    - "Ursula (The Little Mermaid)"

A list of fictional characters


gallery_modifier_historical_figure:
  name: "Gallery_modifier_historical_figure"
  options:
    - "Jesus"
    - "Napoleon"
    - "Budha"
    - "Muhammad"
    - "William Shakespeare"
    - "Abraham Lincoln"
    - "George Washington"
    - "Aristotle"
    - "Alexander the Great"
    - "Thomas Jefferson"
    - "Henry VIII"
    - "Charles Darwin"
    - "Queen Elizabeth"
    - "Karl Marx"
    - "Julius Caesar"
    - "Queen Victoria"
    - "Martin Luther King Jr."
    - "Joseph Stalin"
    - "Albert Einstein"
    - "Christopher Columbus"
    - "Isaac Newton"
    - "Theodore Roosevelt"
    - "Wolfgang Amadeus Mozart"
    - "Plato"
    - "Louis XIV of France"
    - "Ludwig van Beethoven"
    - "Ulysses S. Grant"
    - "Leonardo da Vinci"
    - "Augustus"
    - "Carl Linnaeus"
    - "Ronald Reagan"
    - "Charles Dickens"
    - "Paul the Apostle"
    - "Benjamin Franklin"
    - "George W. Bush"
    - "Winston Churchill"
    - "Genghis Khan"
    - "Charles I of England"
    - "Thomas Edison"
    - "James I of England"
    - "Friedrich Nietzsche"
    - "Franklin D. Roosevelt"
    - "Sigmund Freud"
    - "Alexander Hamilton"
    - "Mohandas Karamchand Gandhi"
    - "Woodrow Wilson"
    - "Johann Sebastian Bach"
    - "Galileo Galilei"
    - "Oliver Cromwell"
    - "James Madison"
    - "Mona Lisa"
    - "William Shakespeare"
    - "Cleopatra"
    - "Joan of Arc"
    - "George Washington"
    - "Abraham Lincoln"
    - "Napoleon Bonaparte"
    - "Queen Victoria"
    - "Vincent van Gogh"
    - "Winston Churchill"
    - "Albert Einstein"
    - "Amelia Earhart"
    - "Charlie Chaplin"
    - "Walt Disney"
    - "Pablo Picasso"
    - "Marilyn Monroe"
    - "Elvis Presley"
    - "Mahatma Gandhi"
    - "John F. Kennedy"
    - "Martin Luther King Jr."
    - "Neil Armstrong"
    - "Bruce Lee"
    - "Marie Curie"
    - "Charlie Brown"
    - "Che Guevara"
    - "Mao Zedong"
    - "Queen Elizabeth II"
    - "Elton John"
    - "Michael Jackson"
    - "Princess Diana"
    - "Pope John Paul II"
    - "Mother Teresa"
    - "Dalai Lama"
    - "Andy Warhol"
    - "Nelson Mandela"
    - "Gautama Buddha"
    - "Mark Twain"
    - "Edgar Allan Poe"
    - "Joseph Smith, Jr."
    - "Adam Smith"
    - "David, King of Israel"
    - "George III of the United Kingdom"
    - "Immanuel Kant"
    - "James Cook"
    - "John Adams"
    - "Richard Wagner"
    - "Pyotr Ilyich Tchaikovsky"
    - "Voltaire"
    - "Saint Peter"
    - "Andrew Jackson"
    - "Constantine the Great"
    - "Socrates"
    - "Elvis Presley"
    - "William the Conqueror"
    - "John F. Kennedy"
    - "Augustine of Hippo"
    - "Vincent van Gogh"
    - "Nicolaus Copernicus"
    - "Vladimir Lenin"
    - "Robert E. Lee"
    - "Oscar Wilde"
    - "Charles II of England"
    - "Cicero"
    - "Jean-Jacques Rousseau"
    - "Francis Bacon"
    - "Richard Nixon"
    - "Louis XVI of France"
    - "Charles V, Holy Roman Emperor"
    - "King Arthur"
    - "Michelangelo"
    - "Philip II of Spain"
    - "Johann Wolfgang von Goethe"
    - "Ali, founder of Sufism"
    - "Thomas Aquinas"
    - "Pope John Paul II"
    - "René Descartes"
    - "Nikola Tesla"
    - "Harry S. Truman"
    - "Joan of Arc"
    - "Dante Alighieri"
    - "Otto von Bismarck"
    - "Grover Cleveland"
    - "John Calvin"
    - "John Locke"

These go on for awhile.

You get the idea. Anyways, it couples these groups of people into a large sort of hodge podge hash, and picks one. It couples that with the selectors I made just for this project.
So our prompt ends up looking like:

adj photograph of subj, action, pants, as a baby.

Now what is in each of these doesn't really matter that much. They are just to give some flavor and variety to the images, so they don't end up all looking alike. I will add and remove things from these lists regularly, as I come up with new ideas or see results indicating older ideas that didn't work out.

This is what adj looks like:

gallery_mode_babby_form_adj:
  name: gallery_mode_babby_form_adj
  options:
       - "adorable"
       - "cute"
       - "embarrassing"
       - "fussy"
       - "newspaper"
       - "dslr"
       - "candid"
       - "polaroid"
       - "security camera footage"
       - "baby monitor shot"
       - "nursery"
       - "playground"
       - "jungle gym"
       - "swingset"
       - "black and white"
       - "full color"
       - "digital"

What sort of photograph is it?

So at random, we'll choose 'embarrassing', and from the lists above we'll choose Genghis Khan.
embarrassing photograph of Genghis Khan, action, pants, as a baby.
Good, getting there. Now baby photos are cute and all, but they should probably be doing something, yes? That is where the action array comes in.

gallery_mode_babby_form_actions:
  name: gallery_mode_babby_form_actions
  options:
       - "drooling on their bib"
       - "dressed for halloween"
       - "first day of preschool"
       - "first steps"
       - "finger painting"
       - "having a tantrum"
       - "with their blanket"
       - "eating pudding"

What is the tyke up to?

embarrassing photograph of Genghis Khan, having a tantrum, pants, as a baby.

Wait, pants?

Yes, after the first day of testing, it was unanimously decided that this was needed. I don't know why pictures of babies running around naked are so common, but that fed into the stable diffusion training data. I definitely don't need to see that, so we hard coded pants.

gallery_mode_babby_form_pants:
  name: gallery_mode_babby_form_pants
  options:
       - "wearing a sailor suit"
       - "in a cute jumper"
       - "with pants"
       - "wearing a diaper"
       - "wearing overalls"
       - "in a one-piece"
       - "in pajamas"
       - "wrapped up tight"

You'll thank me for this when you're older, kid.

Picking one at random, we now have a complete sentence:

embarrassing photograph of Genghis Khan, having a tantrum, wrapped up tight, as a baby.

Let's send this to Bob and see what he comes up with -

Isn't he just precious?

Now AI baby pictures are nothing new, but it was a fun way to spend a couple hours. Here are some of our favorites so far: