ThioJoe / Full-Stack-AI-Meme-Generator

Uses Various AI Service APIs to generate memes with text and images
GNU General Public License v3.0
265 stars 26 forks source link

Full Stack AI Meme Generator

Allows you to automatically generate meme images from start to finish using AI. It will generate the text for the meme (optionally based on a user-provided concept), create a related image, and combine the two into a final image file.


Features

Usage

  1. For Python Version Only: Clone the repository & Install the necessary packages.
  2. Obtain at least an OpenAI API key, but it is recommended to also use APIs from Clipdrop or Stability AI (DreamStudio) for the image generation stage.
  3. Edit the settings variables in the settings.ini file.
  4. Run the script and enter a meme subject or concept when prompted (optional).

Settings

Various settings for the meme generation process can be customized:

Example Image Output With Log

Meme File Name: meme_2023-07-13-15-34_ZYKCV.png
AI Basic Instructions: You will create funny memes.
AI Special Image Instructions: The images should be photographic.
User Prompt: 'cats'
Chat Bot Meme Text: "When you finally find the perfect napping spot... on the laptop."
Chat Bot Image Prompt: "A photograph of a cat laying down on an open laptop."
Image Generation Platform: clipdrop

Optional Arguments

You can also pass options into the program via command-line arguments whether using the python version or exe version.

• API Key Arguments: Not necessary if the keys are already in api_keys.ini

--openaikey: OpenAI API key.

--clipdropkey: ClipDrop API key.

--stabilitykey: Stability AI API key.

• Basic Meme Arguments

--userprompt: A meme subject or concept to send to the chat bot. If not specified, the user will be prompted to enter a subject or concept.

--memecount: The number of memes to create. If using arguments and not specified, the default is 1.

• Advanced Meme Settings Arguments

--imageplatform: The image platform to use. If using arguments and not specified, the default is 'clipdrop'. Possible options: 'openai', 'stability', 'clipdrop'.

--temperature: The temperature to use for the chat bot. If using arguments and not specified, the default is 1.0.

--basicinstructions: The basic instructions to use for the chat bot. If using arguments and not specified, the default is "You will create funny memes that are clever and original, and not cliche or lame.".

--imagespecialinstructions: The image special instructions to use for the chat bot. The default is "The images should be photographic.".

• Binary arguments: Just adding them activates them, no text needs to accompany them

--nouserinput: If specified, this will prevent any user input prompts, and will instead use default values or other arguments.

--nofilesave: If specified, the meme will not be saved to a file, and only returned as virtual file part of memeResultsDictsList.

How to Build Exe Yourself

Note: To build the exe you have to set up the python environment anyway, so by that point you can just run the python version of the script. But if you want the build the exe yourself anyway here is how:

  1. Ensure required packages are installed
  2. Additionally, install PyInstaller: pip install pyinstaller (If using a virtual environment, install it into that)
  3. Run this command in terminal from within the project directory: python -m PyInstaller main.spec