Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lightdiffusion/lightdiffusion-next
LightDiffusion SD and Flux refactored. Reassembled to support and be the fastest SD and Flux natively
https://github.com/lightdiffusion/lightdiffusion-next
ai artificial-intelligence deep-learning diffusion generative-ai gui image-generation img2img inpainting pytorch stable-diffusion text2image torch txt2img
Last synced: 5 days ago
JSON representation
LightDiffusion SD and Flux refactored. Reassembled to support and be the fastest SD and Flux natively
- Host: GitHub
- URL: https://github.com/lightdiffusion/lightdiffusion-next
- Owner: LightDiffusion
- License: gpl-3.0
- Created: 2024-12-13T08:06:38.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-03T07:29:43.000Z (9 days ago)
- Last Synced: 2025-02-03T08:25:59.242Z (9 days ago)
- Topics: ai, artificial-intelligence, deep-learning, diffusion, generative-ai, gui, image-generation, img2img, inpainting, pytorch, stable-diffusion, text2image, torch, txt2img
- Language: Python
- Homepage: https://aatrick.github.io/LightDiffusion/
- Size: 35.5 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Say hi to LightDiffusion-Next π
[![demo platform](https://img.shields.io/badge/Play%20with%20LightDiffusion%21-LightDiffusion%20demo%20platform-lightblue)](https://huggingface.co/spaces/Aatricks/LightDiffusion-Next)Β
**LightDiffusion-Next** is the fastest AI-powered image generation GUI/CLI, combining speed, precision, and flexibility in one cohesive tool.
As a refactored and improved version of the original [LightDiffusion repository](https://github.com/Aatrick/LightDiffusion), this project enhances usability, maintainability, and functionality while introducing a host of new features to streamline your creative workflows.
## Motivation:
**LightDiffusion** was originally meant to be made in Rust, but due to the lack of support for the Rust language in the AI community, it was made in Python with the goal of being the simplest and fastest AI image generation tool.
That's when the first version of LightDiffusion was born which only counted [3000 lines of code](https://github.com/LightDiffusion/LightDiffusion-original), only using Pytorch. With time, the [project](https://github.com/Aatrick/LightDiffusion) grew and became more complex, and the need for a refactor was evident. This is where **LightDiffusion-Next** comes in, with a more modular and maintainable codebase, and a plethora of new features and optimizations.
π Learn more in the [official documentation](https://aatrick.github.io/LightDiffusion/).
---
## π Highlights
![image](https://github.com/user-attachments/assets/b994fe0d-3a2e-44ff-93a4-46919cf865e3)
**LightDiffusion-Next** offers a powerful suite of tools to cater to creators at every level. At its core, it supports **Text-to-Image** (Txt2Img) and **Image-to-Image** (Img2Img) generation, offering a variety of upscale methods and samplers, to make it easier to create stunning images with minimal effort.
Advanced users can take advantage of features like **attention syntax**, **Hires-Fix** or **ADetailer**. These tools provide better quality and flexibility for generating complex and high-resolution outputs.
**LightDiffusion-Next** is fine-tuned for **performance**. Features such as **Xformers** acceleration, **BFloat16** precision support, **WaveSpeed** dynamic caching, and **Stable-Fast** model compilation (which offers up to a 70% speed boost) ensure smooth and efficient operation, even on demanding workloads.
---
## β¨ Feature Showcase
Hereβs what makes LightDiffusion-Next stand out:
- **Speed and Efficiency**:
Enjoy industry-leading performance with built-in Xformers, Pytorch, Wavespeed and Stable-Fast optimizations, achieving up to 30% faster speeds compared to the rest of the AI image generation backends in SD1.5 and up to 2x for Flux.- **Automatic Detailing**:
Effortlessly enhance faces and body details with AI-driven tools based on the [Impact Pack](https://github.com/ltdrdata/ComfyUI-Impact-Pack).- **State Preservation**:
Save and resume your progress with saved states, ensuring seamless transitions between sessions.- **Advanced GUI, WebUI and CLI**:
Work through a user-friendly graphical interface as GUI or in the browser using Gradio or leverage the streamlined pipeline for CLI-based workflows.- **Integration-Ready**:
Collaborate and create directly in Discord with [Boubou](https://github.com/Aatrick/Boubou), or preview images dynamically with the optional **TAESD preview mode**.- **Image Previewing**:
Get a real-time preview of your generated images with TAESD, allowing for user-friendly and interactive workflows.- **Image Upscaling**:
Enhance your images with advanced upscaling options like UltimateSDUpscaling, ensuring high-quality results every time.- **Prompt Refinement**:
Use the Ollama-powered automatic prompt enhancer to refine your prompts and generate more accurate and detailed outputs.- **LoRa and Textual Inversion Embeddings**:
Leverage LoRa and textual inversion embeddings for highly customized and nuanced results, adding a new dimension to your creative process.- **Low-End Device Support**:
Run LightDiffusion-Next on low-end devices with as little as 2GB of VRAM or even no GPU, ensuring accessibility for all users.---
## β‘ Performance Benchmarks
**LightDiffusion-Next** dominates in performance:
| **Tool** | **Speed (it/s)** |
|------------------------------------|------------------|
| **LightDiffusion with Stable-Fast** | 2.8 |
| **LightDiffusion** | 1.8 |
| **ComfyUI** | 1.4 |
| **SDForge** | 1.3 |
| **SDWebUI** | 0.9 |(All benchmarks are based on a 1024x1024 resolution with a batch size of 1 using BFloat16 precision without tweaking installations. Made with a 3060 mobile GPU using SD1.5.)
With its unmatched speed and efficiency, LightDiffusion-Next sets the benchmark for AI image generation tools.
---
## π Installation
### Quick Start
1. Download a release or clone this repository.
2. Run `run.bat` in a terminal.
3. Start creating!### Command-Line Pipeline
For a GUI-free experience, use the pipeline:
```bash
pipeline.bat
```
Use `pipeline.bat -h` for more options.---
### Advanced Setup
- **Install from Source**:
Install dependencies via:
```bash
pip install -r requirements.txt
```
Add your SD1/1.5 safetensors model to the `checkpoints` directory, then launch the application.- **β‘Stable-Fast Optimization**:
Follow [this guide](https://github.com/chengzeyi/stable-fast?tab=readme-ov-file#installation) to enable Stable-Fast mode for optimal performance.- **π¦ Prompt Enhancer**:
Refine your prompts with Ollama:
```bash
pip install ollama
ollama run deepseek-r1
```
See the [Ollama guide](https://github.com/ollama/ollama?tab=readme-ov-file) for details.- **π€ Discord Integration**:
Set up the Discord bot by following the [Boubou installation guide](https://github.com/Aatrick/Boubou).---
π¨ Enjoy exploring the powerful features of LightDiffusion-Next!