A modern web application that generates captions for images using AI.
- Instant Image Captioning: Upload images and get AI-generated descriptions in seconds
- Multiple Image Format Support: Handles JPEG, PNG, WebP, and GIF formats
- File Validation: Automated checks for file size and type
- History Management: Keeps track of your recent image captions
- Keyboard Shortcuts:
Ctrl + O
: Open file upload dialogCtrl + G
: Generate captionCtrl + R
: Reset/clear imageCtrl + C
: Copy caption to clipboardCtrl + I
: Toggle info popupCtrl + M
: Toggle themeCtrl + H
: Toggle history sidebarCtrl + K
: Show keyboard shortcuts
- Responsive Design: Works seamlessly on desktop and mobile devices
- Dark/Light Mode: Supports system theme preferences
-
Frontend:
- Next.js (React Framework)
- TypeScript
- Tailwind CSS
- Radix UI Components (Shadcn/ui)
- Lucide React Icons
-
Backend:
- Next.js API Routes
- Hugging Face Inference API
- BLIP Image Captioning Model
This project uses the BLIP Image Captioning Large Model by Salesforce, hosted on Hugging Face. The model is capable of generating detailed and accurate captions for a wide variety of images.
1- Clone the repository
git clone https://github.com/KhaledSaeed18/image-captioning.git
2- Install dependencies
npm install
3- Set up environment variables
HUGGINGFACE_API_KEY=your_api_key_here
4- Run the development server
npm run dev
5- Open http://localhost:3000 in your browser
- Maximum file size: 10MB
- Supported image formats: JPEG, PNG, WebP, GIF
- All processing is done server-side
- No images are stored permanently
MIT License - feel free to use this project for personal or commercial purposes.
Contributions are welcome! Please feel free to submit a Pull Request.