A command-line tool for generating high-quality images from text prompts using Stable Diffusion v1.5. Built for speed, simplicity, and portfolio-ready presentation. Images are saved locally with timestamped filenames for easy tracking.
- 🎨 Text-to-image generation via Stable Diffusion v1.5
- 🖥️ CLI-based interface for fast experimentation
- 🧠 Uses Hugging Face
diffusersandsafetensors - 🧊 Local model caching to avoid repeated downloads
- 🕓 Outputs are timestamped and saved in
outputs/
$ python generate.py
Enter your prompt: a futuristic city skyline at sunset
Image saved to outputs/generated_20250520_142301.png
. ├── generate.py # Main script to run image generation ├── model_cache/ # Local model cache (automatically created) ├── outputs/ # Folder for generated images ├── models/ # Folder for safetensor model files ├── requirements.txt # Dependencies └── README.md # Project documentation
- Clone the Repository
git clone https://github.com/M26I/image-generation-system
cd image-generation-system
- Set Up Virtual Environment (Recommended)
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
- Install Requirements
pip install -r requirements.txt
- Run the CLI
python generate.py
If you have an NVIDIA GPU and want faster image generation:
-
Install PyTorch with CUDA support: https://pytorch.org/get-started/locally/
-
Install accelerate:
pip install accelerate
- You can then modify .to("cpu") → .to("cuda") in generate.py
-
Python 3.8+
-
torch, diffusers, safetensors
-
Optional: accelerate (for improved performance)
-
Model weights are cached in ./model_cache to reduce startup time.
-
Generated images are saved with filenames like generated_20250520_142301.png in the outputs/ folder.
-
No image is overwritten thanks to unique timestamping.
© 2025 M26I – For educational/portfolio use only.
Unauthorized use or redistribution without credit is prohibited.