This project implements an image generation pipeline using the Stable Diffusion XL model with TGATE (Text-Guided Attention for Efficient Text-to-Image Generation) and TCD (Temporal Coherence Diffusion) scheduling.
- Uses Stable Diffusion XL as the base model
- Implements TGATE for efficient text-to-image generation
- Utilizes TCD scheduling for improved temporal coherence
- Supports LoRA (Low-Rank Adaptation) for fine-tuning
- Configurable image resolution, prompts, and generation parameters
- Python 3.x
- PyTorch
- diffusers
- tgate (custom implementation)
- CUDA-capable GPU (for optimal performance)
- Clone this repository
- Install the required dependencies:
pip install torch diffusers - Place the following files in the same directory as the script:
aniversePonyXL_v10.safetensors(base model)TCD-SDXL-LoRA.safetensors(LoRA weights)
- Adjust the prompts, negative prompts, and generation parameters in the script as needed.
- Run the script:
python main.py - The generated image will be saved as
image.pngin the same directory.
You can modify the following parameters in the script:
prompt: The main text prompt for image generationprompt_2: Additional text prompt (combined with the main prompt)negative_prompt: Text prompt for features to avoid in the generated imagenum_inference_steps: Number of denoising stepsguidance_scaleandguidance_scale_2: Guidance scales for the promptseta: Eta value for DDIM samplingseed: Random seed for reproducibilitywidthandheight: Output image dimensions
- TGATE implementation with configurable gate step, intervals, and warm-up
- TCD Scheduler for improved temporal coherence
- LoRA integration for fine-tuned results
- The script currently uses CUDA for GPU acceleration. Ensure you have a compatible GPU and CUDA setup.
- Uncomment the upscaling code if you want to use the 4x upscaling feature (requires additional setup).
This project uses components from various open-source projects, including Stable Diffusion XL, diffusers, and custom implementations of TGATE and TCD.