Turn images into vivid stories, poems, or captions using cutting-edge AI models!
This application combines vision and language models to let users upload an image, generate a caption using BLIP, and transform it into creative text using TinyLLaMA.
- 📸 Image Captioning: Uses BLIP to describe uploaded images.
- 🧠 Text Generation: Uses TinyLLaMA to generate:
- 🎭 Short stories
- 📝 Poems
- 💬 Social media-style captions
- 🎨 Tone Customization: Choose from 5 tone styles:
funny,emotional,dark,creative, andformal. - ⚡ Runs on GPU: Optimized for local machines with 6GB+ VRAM (e.g., RTX 4050).
| Component | Model / Tool |
|---|---|
| Image Captioning | Salesforce/blip-image-captioning-base |
| Text Generation | TinyLlama/TinyLlama-1.1B-Chat-v1.0 |
| Interface | Gradio |
| Environment | Python, Torch, Transformers |
- Upload an Image
- BLIP generates a caption describing the image
- Select the desired Tone and Type (
story,poem,caption) - TinyLLaMA creates the output using your custom prompt
- Output is displayed with clear formatting
- Clone this repo
git clone https://github.com/yourusername/image-to-story-generator.git cd image-to-story-generator
- Create virtual environment
python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows
- Install requirements
pip install -r requirements.txt
- Run the app
python app.py
| Image | Caption | Story/Poem Example |
|---|---|---|
| 🌸 Pink Lotus | “a pink lotus flower with a blue background” | “As the sun shimmers through morning dew...” |
. ├── app.py # Gradio UI
├── blip_caption.py # BLIP captioning logic
├── story_generator.py # TinyLLaMA story/poem/caption generator
├── requirements.txt
└── README.md
This project was built to explore multimodal generative AI — combining computer vision and language models to create meaningful, artistic content from images.
MIT License Feel free to fork, modify, and contribute!
Feel free to add any issues you find
Deshan Senanayake 📧 smddsenyake@gmail.com
🔗 LinkedIn : https://www.linkedin.com/in/deshan-senanayake-7a0695292/
🔗 GitHub : https://github.com/Deshan-Senanayake




