Sunday, May 21, 2023

AI illustrates Jabberwocky

kw: ai experiments, artificial intelligence, generated art, poems, illustrations

Behold the Jabberwock! The first poem longer than a nursery rhyme that I learned to recite was "Jabberwocky" by Lewis Carroll, the author of Alice's Adventures in Wonderland and other books.

I've been experimenting a lot with DALL-E 2, and I decided to see how it might "illustrate" the poem. First I prompted it with the word Jabberwocky. This is an out-painting of one of the results.

DALL-E's initial response was this panel of four images:





It's interesting that two of the pictures have the creature holding a book or paper, indicating that DALL-E "knows" this is a piece of literature. I like the whimsical blue ones, so I out-painted the second one also. 

Note that each session of out-painting required five or six "generate" actions, each of which consumed a credit. For those new to DALL-E 2, when you sign up you receive 50 free credits, which is enough to help someone become familiar with the way it works. Thereafter, 15 free credits are added to your account each month, but must be used up in the month they are added. If your usage is light, and you have a modicum of patience, that is enough. At any time, credits can be bought in batches of 115 for $15, which comes to just over 13¢ per credit. Thus, generating each of these lovely creatures cost me about 75¢.

I wanted to have DALL-E illustrate the verses of the poem. I decided to get its response to couplet after couplet; each verse is two couplets. DALL-E doesn't keep track of what we do with it so I knew I couldn't get it to produce illustrations with any coherence from one to the next. Therefore, I just generated a single response for each couplet and extracted all the results.

Here they are; enjoy!

’Twas brillig, and the slithy toves
      Did gyre and gimble in the wabe;
All mimsy were the borogoves,
      And the mome raths outgrabe.
“Beware the Jabberwock, my son!
      The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
      The frumious Bandersnatch!”
He took his vorpal sword in hand;
      Long time the manxome foe he sought—
So rested he by the Tumtum tree
      And stood awhile in thought.
And, as in uffish thought he stood,
      The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
      And burbled as it came!
One, two! One, two! And through and through
      The vorpal blade went snicker-snack!
He left it dead, and with its head
      He went galumphing back.
“And hast thou slain the Jabberwock?
      Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!”
      He chortled in his joy.
’Twas brillig, and the slithy toves
      Did gyre and gimble in the wabe:
All mimsy were the borogoves,
      And the mome raths outgrabe.

I did not re-run the last verse. The source for the text of the poem is the Poetry Foundation. It differs slightly from my recitation memory.

No comments: