GithubHelp home page GithubHelp logo

ssasd's Introduction

SSaSD - Shrinked Self-attention for Stable Diffusion

Installation

for diffusers

$ git clone https://github.com/hnmr293/ssasd.git
from diffusers import StableDiffusionPipeline
import ssasd

pipe = StableDiffusionPipeline.from_single_file(...)
ssasd.apply_patch(pipe)

for A111 WebUI

$ cd "your extension directory"
$ git clone https://github.com/hnmr293/ssasd.git

WebUI image

What is this?

This is the script to reduce the size of the latent input to the self-attention layer. Then computation time of the self-attention layer will be reduced and generation speed will be improved.

Examples

  • horizontal - tomesd off/on
  • vertical - ssasd(this) off/on

tomesd and ssasd

  • horizontal - ssasd off/on
[setting]
  WebUI
  DPM++ 3M SDE / 30 steps / 640x1024 / cfg scale 3.0
  ssasd: max_downsample=2, scale=2, end_step=0.5(15)

[performance]
  off: 7.4s
  on: 6.3s

ssasd

  • horizontal - ssasd off/on
[setting]
  WebUI
  7th_anime_v3_A
  DPM++ 2M Karras / 20 steps / 640x1024 / cfg scale 7.0
  ssasd: max_downsample=1, scale=2, end_step=0.5(10)

[performance]
  off: 7.1s
  on: 6.1s

ssasd

Performance

[setting]
  diffusers
  DPM++ 3M SDE / 30 steps / 640x1024 / cfg scale 3.0
  ssasd: max_downsample=2, scale=2, end_step=0.5(15)
setting n avg (s) max (s) min (s) std. dev. (s)
normal 10 27.10 27.64 26.54 0.41
tomesd 10 20.01 20.41 19.36 0.37
ssasd (this) 10 22.07 22.66 21.49 0.45
tomesd + ssasd 10 19.44 20.13 18.93 0.48

Yes, tomesd is nice ^^;

ssasd's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

wbclark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.