Skip to content

LightCyan01/JoyCaption-Batch-Image-Captioner

Repository files navigation

JoyCaption Batch Image Captioner

Created an image processing tool focused on batch captioning, since JoyCaption’s demo only captions one image at a time.

Installation

  1. Clone this repository
git clone https://github.com/LightCyan01/JoyCaption-Batch-Image-Captioner.git
cd JoyCaption-Batch-Image-Captioner
  1. Clone the JoyCaption model
git clone https://huggingface.co/fancyfeast/llama-joycaption-beta-one-hf-llava
  1. Create venv and activate
python -m venv venv

venv\Scripts\activate
  1. Install requirements

For GPU:

pip install -r requirements-cuda.txt

For CPU:

pip install -r requirements.txt
  1. Run GUI
python image_captioner.py
  1. CLI Alternative
python batch_caption.py <image_folder> [options]

Examples:

python batch_caption.py "C:\MyImages"

# Overwrite existing captions
python batch_caption.py "C:\MyImages" --overwrite

# Use descriptive style
python batch_caption.py "C:\MyImages" --style descriptive

# Custom model path
python batch_caption.py "C:\MyImages" --model "path/to/custom/model"

Options:

  • --style : Caption style (training, descriptive, straightforward) - Default: training
  • --overwrite : Overwrite existing caption files
  • --model : Custom model path - Default: llama-joycaption-beta-one-hf-llava

Caption Styles:

  • training (default): Short, factual descriptions perfect for LoRA training
  • descriptive: Long, detailed descriptions
  • straightforward: Concise, objective captions

Creates .txt files alongside each image.

Credits:

About

Batch image captioning tool for generating captions for multiple images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages