AI-powered image preparation tool for LoRA training datasets. Automatically analyzes and crops images to optimal dimensions while preserving important subjects like faces and bodies.
- Analyzes images to identify main subjects (faces, people, objects, animals)
- Prioritizes important elements (faces > bodies > objects > backgrounds)
- Suggests optimal crop regions automatically
- 1024Γ1024 - Square (ideal for most training)
- 768Γ1024 - Portrait
- 1024Γ768 - Landscape
| Provider | Default Model | Description |
|---|---|---|
| Claude | claude-opus-4-5-20251101 |
Anthropic's most intelligent model (Nov 2025) |
| OpenAI | gpt-4.1 |
1M token context, excellent vision (Apr 2025) |
| Gemini | gemini-2.5-flash |
Fast and reliable stable release |
| Ollama | Auto-detected | Local vision models |
| Demo | N/A | Simulated responses for testing |
All model fields are editable - you can use any compatible model version.
- Batch or Sequential Processing - Process all at once or review one-by-one
- Manual Adjustments - Drag to adjust crop region with live preview
- Multiple Output Formats - PNG, JPG (with quality control), or keep original
- Batch Renaming - Rename all exported files with a consistent base name
- Dark Mode UI - Easy on the eyes during long editing sessions
- Node.js 18+ - Download
- npm (comes with Node.js)
# 1. Extract the project
unzip lora-project.zip
cd lora-project
# 2. Install dependencies
npm install
# 3. Start the development server
npm run devThe app will open at http://localhost:3000
- Get an API key from console.anthropic.com
- Open Settings (gear icon) in the app
- Select Claude (Anthropic)
- Paste your API key
- Model defaults to
claude-opus-4-5-20251101(editable)
Alternative models: claude-sonnet-4-5-20250929, claude-haiku-4-5-20251001
- Get an API key from platform.openai.com
- Open Settings in the app
- Select OpenAI
- Paste your API key
- Model defaults to
gpt-4.1(editable)
Alternative models: gpt-4.1-mini, gpt-4.1-nano, gpt-4o
- Get an API key from Google AI Studio
- Open Settings in the app
- Select Google Gemini
- Paste your API key
- Model defaults to
gemini-2.5-flash(editable)
Alternative models: gemini-2.5-pro, gemini-2.0-flash
Run AI models locally on your computer.
-
Install Ollama: ollama.ai
-
Pull a vision model:
# Recommended - good balance of speed and quality ollama pull llava # Better quality, slower ollama pull llava:13b # Alternative vision model ollama pull bakllava
-
Start Ollama (if not already running):
ollama serve
-
Open Settings in the app
-
Select Ollama (Local)
-
Your installed models will be auto-detected in the dropdown
No setup required! Uses simulated AI responses for testing the interface. Great for:
- Learning how the app works
- Testing without API costs
- Offline development
- Prepare: Drop images or click to browse
- Configure: Choose processing mode and output format
- Process: Click "Start Processing"
- Review: Check results, adjust crops if needed
- Export: Download all processed images
| Mode | Description | Best For |
|---|---|---|
| Batch | Process all images, review after | Large batches, confident in AI |
| One-by-one | Approve each before continuing | Critical images, learning the tool |
In the Editor view:
- Drag inside the crop box to move it
- Drag corners to resize (maintains aspect ratio)
- Use Target Shape buttons to switch between square/portrait/landscape
- Click Reset to AI to restore the AI's suggestion
| Format | Quality | File Size | Best For |
|---|---|---|---|
| PNG | Lossless | Larger | Maximum quality |
| JPG | Adjustable (50-100%) | Smaller | Storage efficiency |
| Original | Keeps source format | Varies | Mixed batches |
In Settings, you can enable "Rename all files" to give all exported images a consistent name:
- Check "Rename all files"
- Enter a base name (e.g.,
Anime) - Files will be exported as:
- Single image:
Anime_lora.png - Multiple images:
Anime_lora_1.png,Anime_lora_2.png, etc.
- Single image:
This is perfect for organizing training datasets with consistent naming conventions.
| Color | Status | Meaning |
|---|---|---|
| π’ Green | Success | AI confident, ready to export |
| π‘ Orange | Review | AI uncertain, manual check recommended |
| π΄ Red | Failed | AI couldn't identify subject |
# Create optimized build
npm run build
# Preview production build
npm run previewOutput will be in the dist folder. You can deploy this to any static hosting.
This project is configured to deploy to GitHub Pages at:
Deployment is handled automatically by GitHub Actions whenever you push to the main branch.
- Make sure the repo is created on GitHub:
https://github.com/BuggyButLearning/LoRA-Image-Prep
- In Settings β Pages on GitHub, make sure the source is set to GitHub Actions.
-
Make your changes locally
-
Build and test (optional but recommended):
npm run build npm run preview
-
Commit and push to
main:git add . git commit -m "Update LoRA Image Prep" git push origin main
GitHub Actions will:
- Install dependencies
- Build the Vite app
- Publish the
distfolder to GitHub Pages
The live site will update after the workflow finishes.
- Ensure Ollama is running:
ollama serve - Check the endpoint (default:
http://localhost:11434) - Click the refresh button to rescan models
- Make sure you have at least one vision model installed
- Make sure images have been processed first (click "Start Processing")
- Check that you have successful (green) images
- Some browsers block rapid downloads - try fewer images
- Check your browser's download folder
- Try a different AI provider
- Use the manual crop adjustment
- Some abstract/artistic images may not have clear subjects
- Consider using a more powerful model
- Verify your API key is correct
- Check you have credits/quota remaining
- Ensure the model name is valid
- Check your internet connection
lora-project/
βββ index.html # Entry HTML
βββ package.json # Dependencies
βββ vite.config.js # Vite configuration
βββ README.md # This file
βββ src/
βββ main.jsx # React entry point
βββ App.jsx # Main application
- React 18 - UI framework
- Vite - Build tool
- Canvas API - Image manipulation
- Fetch API - AI provider communication
MIT License - feel free to use for personal or commercial projects.