2025-01-25 23:31:56 +08:00
2025-01-25 23:31:56 +08:00
2025-01-25 23:22:49 +08:00
2025-01-24 14:29:04 +08:00
2025-01-15 10:26:17 +08:00
2025-01-24 10:28:18 +08:00
2025-01-24 10:33:28 +08:00
2025-01-15 10:21:46 +08:00
2025-01-24 10:28:18 +08:00
2025-01-25 23:22:49 +08:00
2025-01-25 23:31:56 +08:00
2025-01-25 23:22:49 +08:00
2025-01-17 14:48:56 +08:00

⚡ComfyUI-Lightning

Introduction

This repository integrates all the tricks I know to speed up Flux inference:

  1. Use TeaCache or FBCache or MBCache;
  2. Skip some unnessasery blocks;
  3. Compile and quantize model;
  4. Use fast CuDNN attention kernels;
  5. Use SageAttention;
  6. Fix AttributeError: 'SymInt' object has no attribute 'size' to speed up recompilation after resolution changing.

MBCache extends FBCache and is applied to cache multiple blocks. The codes are modified from SageAttention, ComfyUI-TeaCache, comfyui-flux-accelerator and Comfy-WaveSpeed. More details see above given repositories.

Updates

  • [2025/1/24] Now support Sana. Get your 1024*1024 images within 2s. All the codes are modified from Sana.

Usage

For Flux

Flux Generation Results

You can use XXCache, SageAttention, and torch.compile with the following examples:

FBCache TeaCache MBCache

More specific:

  1. Download Flux diffusion model and VAE image decoder from FLUX.1-dev or FLUX.1-schnell. Put the flux1-dev.safetensors or flux1-schnell.safetensors file into models/diffusion_models and the ae.safetensors file into models/vae;

  2. Download Flux text encoder from flux_text_encoders and put all the .safetensors files into models/clip;

  3. Run the example workflow.

For Sana

Sana Generation Results
  1. Download Sana diffusion model from Model Zoo and put the .pth file into models/diffusion_models;

  2. Download Gemma text encoder from google/gemma-2-2b-it, unsloth/gemma-2b-it-bnb-4bit or Efficient-Large-Model/gemma-2-2b-it and put the whole folder into models/text_encoders;

  3. Download DCAE image decoder from mit-han-lab/dc-ae-f32c32-sana-1.0 and put the .safetensors file into models/vae;

  4. Run the example workflow.

S
Description
No description provided
Readme MIT
4.3 MiB
Languages
Python 99.9%