LLM using API tokens
Blog.AI is a Streamlit-based AI blog generator that utilizes Google Gemini AI for text generation and Stable Diffusion for AI-generated images. It allows users to create unique, creative, and structured blog posts with AI-generated images based on their inputs.
- 📝 AI-Powered Blog Writing using Google Gemini AI
- 🎨 AI-Generated Images using Stable Diffusion
- 📥 Download Generated Blog as a text file
- 🖥️ Simple & Interactive UI using Streamlit
.
├── .venv/ # Virtual environment (ignored in Git)
├── generated_images/ # Folder where generated images are stored (creates when the application script is run and images generated for the blogs are saved here)
├── app.py # Main Streamlit application script
├── diffusion_pytorch_model.safetensors # Stable Diffusion model file
├── README.md # Project documentation (this file)
└── requirements.txt # Python dependencies
git clone https://github.com/Opikadash/blog-ai.git
cd blog-aipython -m venv .venv
source .venv/bin/activate # On macOS/Linux
.venv\Scripts\activate # On Windowspip install -r requirements.txtBefore running the application, set the required API keys as environment variables:
export GOOGLE_GEMINI_API_KEY="your_google_gemini_api_key"
export HUGGINGFACE_API_KEY="your_huggingface_api_key"On Windows (PowerShell):
$env:GOOGLE_GEMINI_API_KEY="your_google_gemini_api_key"
$env:HUGGINGFACE_API_KEY="your_huggingface_api_key"Run the Streamlit app:
streamlit run app.pyAfter running the command, open http://localhost:8501/ in your browser.
If you want to run Blog.AI on a Cloud GPU (Google Colab, RunPod, Paperspace, Lambda Labs):
- Upload
app.pyto your cloud instance. - Install dependencies using
pip install -r requirements.txt - Make sure CUDA is available (
torch.cuda.is_available()should returnTrue). - Run the app using
streamlit run app.py --server.port 8501
Feel free to open issues and pull requests to improve this project!
This project is licensed under the MIT License.