I wrote a python script to hit deepai's API and generated images for a tarot deck.
Thanks to Mike for recomending the API.
Without futher ado, the code:
import requests
import shutil
def get_ai_image(text):
r = requests.post(
"https://api.deepai.org/api/text2img",
data={
'text': text,
},
headers={'api-key': 'GET_YOUR_OWN'}
)
image = requests.get(r.json()['output_url'], stream = True)
with open(text,'wb') as outfile:
shutil.copyfileobj(image.raw, outfile)
print(f"Wrote {text}.png")
major_arcana = [
"The Fool",
"The Magician",
"The High Priestess",
"The Empress",
"The Emperor",
"The Hierophant",
"The Lovers",
"The Chariot",
"Justice",
"The Hermit",
"Wheel of Fortune",
"Strength",
"The Hanged Man",
"Death",
"Temperance",
"The Devil",
"The Tower",
"The Star",
"The Moon",
"The Sun",
"Judgement",
"The World"
]
suits = [
"Wands",
"Cups",
"Swords",
"Coins"
]
denominations = [
"Ace",
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
"Eight",
"Nine",
"Ten",
"Page",
"Knight",
"Queen",
"King"
]
for card in major_arcana:
get_ai_image(card)
for s in suits:
for d in denominations:
get_ai_image(f"{d} of {s}")
And the Art: