Genraytor is a lightweight command-line tool that generates images from text prompts using Stable Diffusion.
- Generate images from text prompts
- Random prompt generation
- Customizable image resolution
- Simple, dependency-minimal interface
- Python 3.8 or higher
- CUDA-capable GPU (recommended) or CPU
- 8GB+ disk space for model weights (automatically downloaded on first run)
- Internet connection (required for first-time setup to download the model)
-
Clone this repository:
git clone https://github.com/abildma/genraytor.git cd genraytor -
Set up a virtual environment (recommended):
# Create the virtual environment python -m venv venv # Activate it # On Linux/macOS: source venv/bin/activate #or source venv/bin/activate.fish # On Windows: # venv\Scripts\activate
-
Install the required Python packages:
pip install -r requirements.txt
Note: The first run will download the Stable Diffusion model (4-5GB) automatically to
~/.cache/huggingface/hub/
Generate an image from a text prompt:
python genraytor.py "a majestic lion in the savanna"--random: Generate an image using a random prompt--res N: Set image resolution (default: 768, must be multiple of 8)
Generate a random image:
python genraytor.py --randomGenerate a high-resolution image (1024x1024):
python genraytor.py --res 1024 "a futuristic cityscape at night"If you encounter CUDA out of memory errors:
- Try reducing the resolution using
--res(e.g.,--res 512) - Close other GPU-intensive applications
- If using a CPU, be patient as generation will be slower
This project is licensed under the MIT License - see the LICENSE file for details.