Skip to content

LostOne1000/lightroom-llama

 
 

Repository files navigation


Lightroom Llama

Generate metadata for your photos with ollama, directly in Lightroom

Key FeaturesHow To UseDevelopingCreditsLicense

Key Features

  • AI-Powered Metadata Generation: Generate titles, captions, and keywords for your photos using local AI models
  • Batch Processing: Process multiple photos at once with progress tracking
  • Visual Interface: Preview photos and edit generated content before saving
  • Smart Keyword Organization: Automatically organizes generated keywords under an "llm" parent keyword
  • Reset Functionality: Easily remove generated metadata when needed
  • Local Processing: No internet required - your photos stay on your computer
  • Custom Prompts: Use your own prompts or leverage the built-in system prompts

Features

Single Photo Processing

  • Generate metadata for individual photos with a visual interface
  • Preview the photo thumbnail while editing
  • Customize prompts to get specific results
  • Option to use existing title/caption as a starting point
  • Real-time status updates during generation

Batch Processing

  • Process multiple selected photos simultaneously
  • Progress tracking with detailed status updates
  • Configurable settings for batch operations
  • Error handling with retry mechanisms
  • Efficient processing with optimized API calls

Reset Metadata

  • Remove generated titles and captions
  • Clean up LLM-generated keywords (removes only keywords under "llm" parent)
  • Selective reset options - choose what to remove
  • Safe operation with confirmation dialogs

Advanced Options

  • System Prompts: Use sophisticated AI prompts for better results
  • Current Data Integration: Build upon existing metadata
  • Keyword Management: Automatic organization under "llm" keyword hierarchy
  • Custom Prompts: Write your own prompts for specific use cases
  • Generate metadata for your photos with ollama, directly in Lightroom
  • Pulls list of installed models from Ollama, allowing user to switch between them
  • Great for generating titles and captions for your stock photos
  • Local generation, no internet required and your photos aren't uploaded anywhere

How To Use

Installation

  1. Clone or download the latest version of Lightroom Llama from here.
  2. Open Adobe Lightroom Classic
  3. Go to File > Plug-in Manager
  4. Click the "Add" button in the bottom left
  5. Navigate to the downloaded plugin folder and select the lightroom-llama.lrplugin file
  6. Click "Done" to close the Plug-in Manager

Prerequisites

  • Adobe Lightroom Classic
  • Ollama installed and running on your computer
  • An LLM model downloaded in Ollama (e.g., minicpm-v, gemma4, etc)

Ollama Setup

  1. Open a terminal
  2. Install Homebrew if you don't have it already
    1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. brew install ollama
  4. ollama run minicpm-v

For latest instructions on how to install and run Ollama, see here.

Using the Plugin

Single Photo Processing

  1. Select a photo in Lightroom
  2. Go to Library > Plug-in Extras > Lightroom Llama...
  3. The plugin will show a dialog with the photo thumbnail and metadata fields
  4. Customize your prompt or use the default
  5. Click "Generate" to create metadata
  6. Review and edit the generated content
  7. Click "Save" to apply the metadata to your photo

Batch Processing

  1. Select multiple photos in Lightroom
  2. Go to Library > Plug-in Extras > Batch Process with Llama...
  3. Configure your batch settings
  4. Click "Start Processing" to begin batch generation
  5. Monitor progress in the status window
  6. Review results and save changes

Reset Metadata

  1. Select photos with generated metadata
  2. Go to Library > Plug-in Extras > Reset Metadata...
  3. Choose which metadata to reset (titles, captions, keywords)
  4. Confirm the operation
  5. The selected metadata will be removed

Menu Locations

The plugin adds three menu items under Library > Plug-in Extras and File > Plug-in Extras:

  • Lightroom Llama... - Process individual photos
  • Batch Process with Llama... - Process multiple photos
  • Reset Metadata... - Remove generated metadata

Developing

Running Tests

The plugin includes a Busted test suite with 12 specs covering the manifest, API clients, metadata services, prompt building, and more.

Prerequisites:

  • Lua 5.1 (5.1.5)
  • LuaRocks — package manager for Lua
  • Busted testing framework: luarocks install busted 2.3.0-1

Run all tests:

make test
# or
./tests/run_tests.sh

Run a single spec:

./tests/run_tests.sh tests/spec/info_spec.lua

Tests mock the Lightroom SDK, so no Lightroom installation is needed. See tests/helpers/mock_sdk.lua for the stubs.

TODO

  • Add support for more LLM models - queries Ollama to populate a list of models.
  • Add support for remote LLM models via server address entry
  • Implement batch processing for multiple photos
  • Add customizable prompt templates
  • Create settings panel for model configuration
  • Implement keyword import/export functionality
  • Add support for different image formats
  • Create batch processing presets

Credits

License

This project is licensed under the MIT License.

Releases

Packages

Contributors

Languages