Kaizilla is a small utility that enhances image metadata by adding descriptions and keywords using OpenAI's LLM. The image itself remains unchanged; only EXIF, IPTC, and XMP metadata are modified.
- Automatically generates and inserts meaningful descriptions and keywords into image metadata.
- Supports EXIF, IPTC, and XMP metadata formats.
- Optional critique mode to analyze the provided image
- Simple command-line usage.
Kaizilla does not generate descriptions purely from the image itself. You must provide an initial description in the EXIF metadata, which the LLM then refines and enhances with keywords. Providing meaningful input helps the model generate better results.
To use Kaizilla, you need an OpenAI API key. Set it in your terminal:
export OPENAI_API_KEY="your_api_key_here"
You can also specify the OpenAI model to use by setting the OPENAI_MODEL
environment variable. By default, Kaizilla uses gpt-4o-mini
:
export OPENAI_MODEL="your_preferred_model"
Create a virtual environment (optional but recommended) and install required packages:
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
Run the script to insert metadata into an image:
python3 kaizilla path_to_your_image.jpg
You can run the script with description in command line instead of EXIF to insert metadata into an image:
python3 kaizilla --description "Portrait of cat looking at tuna fish in Kuala-Lumpur aquarium" path_to_your_image.jpg
Enable critique mode to get feedback on the description:
python3 kaizilla.py --criticism path_to_your_image.jpg
You will receive a critique of the description, including suggestions for improvement. For example (output may vary):
Improvements: To enhance the photo's appeal, consider adjusting the contrast and vibrance to make the colors pop more. Including more foreground elements could also enhance depth.
Strengths: The serene composition and effective use of the winding path create a captivating visual journey. The lighting, emblematic of the golden hour, beautifully complements the natural environment.
Kaizilla supports JPEG image format and may be other formats that support EXIF, IPTC, and XMP metadata. However, metadata support may vary depending on the format and editing tools used.
-d
,--description
– Provide image description to be used to help generating metadata.-c
,--criticism
– Enables critique mode for analyzing the provided description.-h
,--help
– Displays usage instructions.
Kaizilla is released under the GPL-3.0 license. See the LICENSE file for more information.