2 releases
Uses new Rust 2024
| 0.1.1 | Sep 28, 2025 |
|---|---|
| 0.1.0 | Sep 14, 2025 |
#538 in Machine learning
84 downloads per month
25KB
114 lines
memer.rs
A Rust CLI tool for generating memes using OpenAI's DALL-E 3 API.
Description
memer.rs is a command-line interface that allows you to generate meme images by simply providing a text query. The tool uses OpenAI's DALL-E 3 model to create internet-style memes with bold, impact font text and high-contrast visuals.
Features
- Fast meme generation using DALL-E 3
- Automatic UUID-based file organization
- Optimized for classic meme format (top/bottom text, bold styling)
- Async/await for efficient API calls
- Configurable output directories
Installation
Prerequisites
- Rust (latest stable version)
- OpenAI API key
From Source
git clone https://github.com/Programmer-RD-AI/memer.rs.git
cd memer.rs
cargo build --release
From Crates.io
cargo install memer-rs
Setup
- Get an OpenAI API key from OpenAI Platform
- Create a
.envfile in the project root:
OPENAI_API_KEY=your_api_key_here
Usage
Basic Usage
memer --query "when you finally understand Rust ownership"
Custom Output Directory
memer --query "debugging at 3am" --folder my_memes
Help
memer --help
Options
-q, --query <QUERY>: The meme description/topic (required)-f, --folder <FOLDER>: Output directory (default: random UUID)
Examples
# Generate a programming meme
memer -q "when your code works on the first try"
# Generate a relatable meme with custom folder
memer -q "me explaining why I need another monitor" -f work_memes
# Generate a Rust-specific meme
memer -q "borrowing in Rust vs other languages"
Output
Generated images are saved as 1024x1024 PNG files in the specified directory. The tool automatically creates the directory if it doesn't exist.
Technical Details
- Language: Rust 2024 edition
- Image Model: DALL-E 3
- Image Format: Base64 JSON → PNG
- Image Size: 1024x1024 pixels
- Async Runtime: Tokio
Dependencies
async-openai: OpenAI API clientclap: Command-line argument parsingtokio: Async runtimedotenv: Environment variable loadingminijinja: Template renderinguuid: Unique identifier generation
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
Apache License 2.0
Acknowledgments
- OpenAI for the DALL-E 3 API
- The Rust community for excellent crates
Note: This tool requires an active OpenAI API subscription. Image generation costs apply according to OpenAI's pricing.
Dependencies
~20–37MB
~432K SLoC