Skip to main content

Rename images based on AI-generated descriptions.

Project description

AI Image Renamer

PyPI - Version PyPI - Downloads PyPI - License

AI Image Renamer CLI is a command-line tool that uses generative AI to rename image files based on their content, giving your photo collection more descriptive and searchable filenames. A free Groq API key is required. For full documentation, visit the official docs.

Features

  • 🤖 AI: Leverage the latest AI technology to quickly rename your images
  • ⚡️Speed: Groq's fast infrastructure processes your files in milliseconds
  • 🔎 SEO: Generated file names are SEO-friendly
  • 📚 Batch: Use up to 3 image files within a single command (processed sequentially)
  • 👨‍💻 Easy: Renaming files requires only a single command line

Table of Contents

Installation

AI Image Renamer is available through multiple installation methods:

1. Using pipx (recommended)

# Install globally in an isolated environment (requires pipx installed)
pipx install ai-image-renamer

2. Using pip

# Install into the current Python environment
pip install ai-image-renamer

3. From the Git repository

# Clone the repository
git clone https://gitlab.com/thaikolja/ai-image-renamer.git
# Navigate into the project directory
cd ai-image-renamer
# Install the package from source
pip install .

4. From a ZIP archive

  1. Download the ZIP from the repository.
  2. Extract it and run:
# Navigate into the extracted directory
cd ai-image-renamer-main
# Install the package from source
pip install .

5. Run directly from source

# Run via the module entry point without installation
python -m ai_image_renamer.cli path/to/image.jpg

After installation, obtain a free Groq API key and set it as an environment variable:

# Set your Groq API key as an environment variable
export GROQ_API_KEY="your-key-here"

Usage

The rename-images command is your entry point to the tool. However, since it's using Groq and Meta's Llama 4 Scout model, some limitations apply:

Basic Usage

To rename a single image:

# Rename a single image file
rename-images path/to/your/image.jpg

To rename multiple images (up to 3 at once):

# Provide up to 3 image paths; append flags after paths
rename-images image1.png image2.jpg path/to/another/image.webp

Use shell glob patterns to select files:

# The shell expands the glob before passing paths to the tool
rename-images ~/Desktop/my-photos/*.png
# Match files containing a keyword in the name
rename-images ~/Photos/bangkok-*.jpg

To rename an image with only 3 words:

# Limit the generated filename to N words
rename-images -w 3 DSC_123.jpg

See rename-images -h for more options, or read the documentation.

Limitations

This tool relies on Groq's hosted AI model, which has the following practical limits to keep in mind:

  • Image file size: Each image must be under 20 MB (files larger than that will be rejected by the API).
  • Image resolution: Very high-resolution photos (over 33 megapixels, e.g., some DSLR or smartphone camera shots) may need to be resized first.
  • Base64 limit: When sending images via API, the base64-encoded data must stay under 4 MB.
  • Images per request: The model accepts up to 5 images at once (the CLI caps this at 3 to stay well within bounds).
  • Preview model: The Llama 4 Scout is still in preview, so it may change or be updated over time.

Contributing

I welcome contributions to AI Image Renamer! Please see the CONTRIBUTING.md file for guidelines on how to contribute.

Author

Kolja Nolte (kolja.nolte@gmail.com)

License

This project is licensed under the MIT License. See the LICENSE file for details. A little self-promotion: If you're not sure which license to use for your project, check out https://whatlicense.org.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_image_renamer-1.2.0.tar.gz (552.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_image_renamer-1.2.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_image_renamer-1.2.0.tar.gz.

File metadata

  • Download URL: ai_image_renamer-1.2.0.tar.gz
  • Upload date:
  • Size: 552.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ai_image_renamer-1.2.0.tar.gz
Algorithm Hash digest
SHA256 25d555240780ce5b6822b4c8a5ef5a884d37362de2a4a7acbf2666d39aa26c56
MD5 ef7fadf59fa85d3041de5010d5e79654
BLAKE2b-256 c713185a788fad93384cf413c41f190862fdf633e29e77f9675a1bee4cb6aa3f

See more details on using hashes here.

File details

Details for the file ai_image_renamer-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_image_renamer-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 099f2d069d3d92b4e87ba17115094ba06f8a68776f722aa962599bbc527a1a69
MD5 f3347656665b8c6b25457d12bd5a1045
BLAKE2b-256 ca2399dceb14fe0b274ebfb003455e4befd0d443205277a410682988fc094803

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page