A Python-based text-to-image generation tool leveraging stable diffusion models. This application provides enhanced control over image generation through optimized parameters, improved prompting, and an efficient interface.
Features include weighted negative prompts, dynamic thresholding, optimized VAE processing, and memory-efficient operations. Available both as a local application and Google Colab notebook for flexible deployment options.
- Weighted emphasis (1.4x, 1.5x) on critical issues
- Comprehensive categories with better organization
- Stronger focus on preventing duplications and deformities
- Increased default steps to 50 for better quality
- Adjusted guidance range (7-30, default: 15)
- Added dynamic thresholding
- Enhanced scheduler configuration
- Main subject emphasis: 1.4x
- Secondary elements: 1.2x
- Better distribution of emphasis
- Sequential CPU offload
- Automatic attention slicing
- Enhanced VAE optimization
- Improved memory management
- Extended quality steps range (30-150)
- Better step increments
- Added information tooltips
- Improved layout and descriptions
- Higher quality images with fewer artifacts
- No duplications or deformed bodies
- More accurate prompt following
- Better overall consistency
- Open
Text-to-img.ipynb
in Google Colab - Select 'Runtime' > 'Change runtime type' > Choose 'T4 GPU'
- Run all cells in sequence
- Obtain your Hugging Face token from Hugging Face.
- Add the token to the Colab notebook by running the following code in a cell:
from huggingface_hub import login login("your_huggingface_token_here")
- Obtain your Hugging Face token from Hugging Face.
- Create a file named
token
inside thehuggingface
directory:echo "your_huggingface_token_here" > huggingface/token
Alternatively, you can securely add your Hugging Face token directly in Google Colab by setting it as a secret. Use the following code snippet in a cell:
HF_TOKEN=YOUR_HUGGINGFACE_TOKEN
git clone https://github.com/SauRavRwT/text-to-img.git
cd text-to-img
Windows:
python -m venv venv
venv\scripts\activate
Linux/Mac:
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
python app.py