/joy-caption-batch

A batch captioning tool for joy_caption

Primary LanguagePythonMIT LicenseMIT

Joytag Caption - Batch

This tool utilizes the Joytag Caption tool (still in Pre-Alpha), to caption image files in a batch.

Place all images you wish to caption in the /input directory and run py batch.py.

Setup

  1. Git clone this repository git clone https://github.com/MNeMoNiCuZ/joy-caption-batch/
  2. Download the image_adapter.pt and place it in the wpkklhc6 directory.
  3. (Optional) Create a virtual environment for your setup. Feel free to use the venv_create.bat for a simple windows setup. Activate your venv.
  4. Run pip install -r requirements.txt
  5. Install PyTorch with CUDA support
  6. Go to the Meta-Llama-3.1-8B huggingface page and request access to this gated model.
  7. Wait for the access to be granted (usually within an hour).
  8. Go to the Github Settings > Tokens page, and click "Create new token".
  9. Give it Read access, and give it a name. Joy-caption-token or any name you want.
  10. Save the token code you are given in a file or email somewhere safe. You cannot retrieve it later, but you can disable it and create a new one at any time.
  11. Run the following command huggingface-cli login, in your (venv). Paste your password when asked (password text won't be visible).

You should now be set up and able to run the tool.

Requirements

  • Tested on Python 3.10 and 3.12.
  • Tested on Pytorch w. CUDA 12.1.
  • Should also work on other versions.

Example

put_images_here

This image is a vibrant, detailed digital painting depicting a majestic golden dragon standing on a rocky outcrop in a lush, enchanted garden. The dragon, with its wings spread wide, has a regal, confident posture. Its scales are a shimmering gold, and its wings are a gradient of pink and purple hues, giving them a delicate, almost translucent appearance. The dragon's eyes are red and piercing, and its mouth is open, revealing sharp teeth.

In the background, a castle with tall, blue turrets emerges from the mist, adding an air of mystery and fantasy. The castle is partially obscured by trees and foliage, enhancing the sense of a magical, hidden realm. Surrounding the dragon are vibrant flowers in various stages of bloom, including pink and white lilies, blue hydrangeas, and yellow daisies, all adding to the enchanting atmosphere. The garden is lush and verdant, with green leaves and grasses, and the ground is a winding stone pathway that leads towards the castle.

The sky is a brilliant blue, dotted with fluffy white clouds, and the light is soft and diffused, creating a dreamlike quality to the entire scene. The overall style is highly detailed and realistic, with a touch of fantasy and whimsy.

Man Woman

Run the original online

Original app and source on huggingface: https://huggingface.co/spaces/fancyfeast/joy-caption-pre-alpha