Skip to content

d-senyaka/pix-scribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖼️PixScribe- AI Image-to-Story Generator

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.


✨ Features

  • 📸 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, and formal.
  • ⚡ Runs on GPU: Optimized for local machines with 6GB+ VRAM (e.g., RTX 4050).

🛠️ Tech Stack

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

🚀 How It Works

  1. Upload an Image
  2. BLIP generates a caption describing the image
  3. Select the desired Tone and Type (story, poem, caption)
  4. TinyLLaMA creates the output using your custom prompt
  5. Output is displayed with clear formatting

💻 Setup Instructions


  1. Clone this repo

git clone https://github.com/yourusername/image-to-story-generator.git cd image-to-story-generator

  1. Create virtual environment

python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows

  1. Install requirements

pip install -r requirements.txt

  1. Run the app

python app.py


🎨 Examples

Image Caption Story/Poem Example
🌸 Pink Lotus “a pink lotus flower with a blue background” “As the sun shimmers through morning dew...”

📸 Screenshots

Screenshot 2025-06-16 210618 Screenshot 2025-06-16 210411 Screenshot 2025-06-18 021208 Screenshot 2025-06-18 020946 Screenshot 2025-06-18 021237


📂 Project Structure

. ├── app.py # Gradio UI

├── blip_caption.py # BLIP captioning logic

├── story_generator.py # TinyLLaMA story/poem/caption generator

├── requirements.txt

└── README.md


🧠 Inspiration

This project was built to explore multimodal generative AI — combining computer vision and language models to create meaningful, artistic content from images.


📃 License

MIT License Feel free to fork, modify, and contribute!



Issues

Feel free to add any issues you find


🙋‍♂️ Author

Deshan Senanayake 📧 smddsenyake@gmail.com

🔗 LinkedIn : https://www.linkedin.com/in/deshan-senanayake-7a0695292/

🔗 GitHub : https://github.com/Deshan-Senanayake

About

AI Image-to-Story Generator. Upload an image → describe it using BLIP Then, generate a creative short story, poem, or social media caption {Choose tone (funny, emotional, dark)} using TinyLlama.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages