jabberjabberjabber / LLavaImageTagger

Creates an index of images, queries a local LLM and adds tags to the image metadata
Other
55 stars 5 forks source link

LLMImageIndexer

License: MIT

LLMImageIndexer is an intelligent image processing and indexing tool that leverages local AI to generate comprehensive metadata for your image collection. This tool uses advanced language models to analyze images and generate captions and keyword metadata.

Screenshot

Features

Installation

Prerequisites

Windows Installation

  1. Clone the repository or download the ZIP file and extract it.

  2. Install Python for Windows.

  3. Download KoboldCPP.exe and place it in the LlavaImageTagger folder. If it is not named KoboldCPP.exe, rename it to KoboldCPP.exe

  4. Run llmii-run.bat and wait exiftool to install. When it is complete you must start the file again. If you called it from a terminal window you will need to close the windows and reopen it. It will then create a python environment and download the model weights. The download is quite large (6GB) and there is no progress bar, but it only needs to do this once. Once it is done KoboldCPP will start and one of the terminal windows will say Please connect to custom endpoint at http://localhost:5001 and then it is ready.

macOS Installation (including ARM)

  1. Clone the repository or download the ZIP file and extract it.

  2. Install Python 3.7 or higher if not already installed. You can use Homebrew:

    brew install python
  3. Install ExifTool:

    brew install exiftool
  4. Download KoboldCPP for macOS and place it in the LLMImageIndexer folder.

  5. Open a terminal in the LLMImageIndexer folder and run:

    chmod +x koboldcpp-mac-arm64
    ./llmii-run.sh

Linux Installation

  1. Clone the repository or download and extract the ZIP file.

  2. Install Python 3.7 or higher if not already installed. Use your distribution's package manager, for example on Ubuntu:

    sudo apt-get update
    sudo apt-get install python3 python3-pip
  3. Install ExifTool. On Ubuntu:

    sudo apt-get install libimage-exiftool-perl
  4. Download the appropriate KoboldCPP binary for your Linux distribution from KoboldCPP releases and place it in the LLMImageIndexer folder.

  5. Open a terminal in the LLMImageIndexer folder and run:

    chmod +x koboldcpp-linux-x64
    ./llmii-run.sh

For all platforms, the script will set up the Python environment, install dependencies, and download necessary model weights (6GB total). This initial setup is performed only once and will take a few minutes depending on your download speed.

Usage

  1. Launch the LLMImageIndexer GUI:

    • On Windows: Run llmii-run.bat
    • On macOS/Linux: Run python3 llmii-gui.py
  2. Ensure KoboldCPP is running. Wait until you see the following message in the KoboldCPP window:

    Please connect to custom endpoint at http://localhost:5001
  3. Configure the indexing settings in the GUI:

    • Select the target image directory
    • Set the API URL (default: http://localhost:5001)
    • Choose metadata tags to generate (keywords, descriptions)
    • Set additional options (crawl subdirectories, backup files, etc.)
  4. Click "Run Image Indexer" to start the process.

  5. Monitor the progress in the output area of the GUI.

Configuration Options

More Information and Troubleshooting

Consult the wiki for more information and troubleshooting steps.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements