Giter Site home page Giter Site logo

robiningelbrecht / pokemon-card-generator Goto Github PK

View Code? Open in Web Editor NEW
88.0 4.0 2.0 105.05 MB

A PHP app that generates Pokemon cards by using GPT and Stable Diffusion.

Home Page: https://pokemon-card-generator.robiningelbrecht.be/

License: MIT License

PHP 58.74% Dockerfile 0.11% Twig 6.38% HTML 10.25% CSS 24.53%
ai stable-diffusion website gpt

pokemon-card-generator's Introduction

AI Pokemon card generator

Banner


This PHP script uses AI to generate new, random Pokemon cards by using

  • GPT to generate a name and description
  • Stable Diffusion to create a visual
  • Pokémon TCG for accurate moves sets
  • PokeApi for accurate element types

First of all, thanks to Jack for the amazing work on the Python equivalent of this repository. I was inspired by his creativity to generate Pokémon cards out of thin air, although I came up with a slightly different approach.

Comparison

This repo Jack's repo
AI to generate name and description OpenAI - GPT3, GPT4 OpenAI - GPT3
AI to generate visual Stable Difussion Midjourney
Generate multiple cards at once
Generate cards of a specific element
Generate cards of a specific creature
Generate a series that evolve from one another
Fully generate a card with one command
Gallery with overview of generated cards

Installation

> git clone [email protected]:robiningelbrecht/pokemon-card-generator.git
# Build docker containers
> docker-compose up -d --build
# Install dependencies
> docker-compose run --rm php-cli composer install

Configuration

For this script to work you'll need two different API keys

OpenAI

Replicate.com

The model used for generating visuals is OpenJourney. It's a Stable Diffusion model fine-tuned on Midjourney v4 images.

Both accounts have free tiers at first, but after a while you will need to enter credit card details. It'll cost you around 1-2 cents to generate a card.

.env

Copy .env.dist and rename to .env, it should at least contain following info:

OPEN_AI_API_KEY=your-open-ai-api-key
REPLICATE_API_KEY=your-replicate-api-key

Generate your first card

At this point, you should be locked and loaded to generate your first Pokémon card by running

> docker-compose run --rm php-cli bin/console app:card:generate

Your CLI should output something along the lines of

CLI output

You'll be able to view your card and all information used to generate it, by navigating to the card gallery page: http://localhost:8080/.

Example

CLI command options

-t, --cardType        The card type you want to generate, omit to use a random one. Valid options are dark, electric, fighting, fire, grass, normal, psychic, steel, water
-r, --rarity          The rarity of the Pokémon you want to generate, omit to use a random one. Valid options are common, uncommon, rare
-s, --size            The size of the Pokémon you want to generate, omit to use a random one. Valid options are xl, l, m, s, xs
-c, --creature        The creature the Pokémon needs to look like (e.g. monkey, dragon, etc.). Omit to to use a random one
-e, --evolutionSeries Indicates if you want to generate a series that evolve from one another. Options "size", "rarity" and "numberOfCards" will be ignored
-x, --numberOfCards   The number of cards to generate. A number between 1 and 10 [default: 1]
-f, --fileType        The image file type you want to use. Valid options are svg, png [default: "png"]
-g, --gptVersion      GPT version to use. Valid options are 3, 4 [default: 4]
-h, --help            Display help for the given command. When no command is given display help for the list command

The PNG slightly differs from the SVG because the latter allows for more flexibility while generating the image

Examples

There's an example gallery available on https://pokemon-card-generator.robiningelbrecht.be/

Gallery

Gotta generate 'em all

Be sure to also check https://gotta-generate-em-all.com. It generates and publishes a new card every day 🥳. Cards are also publised to https://www.reddit.com/r/GottaGenerateEmAll/

Gotta generate 'em all

Acknowledgements

Thanks to TheDuckTamerBlanks for the blank card templates.

pokemon-card-generator's People

Contributors

robiningelbrecht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chunjee 607ch00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.