Giter Club home page Giter Club logo

sd-webui-lcm's Introduction

Latent Consistency Model for Stable Diffusion WebUI

Extension Preview

This extension aims to integrate Latent Consistency Model (LCM) into AUTOMATIC1111 Stable Diffusion WebUI.

Note that LCMs are a completely different class of models than Stable Diffusion, and the only available checkpoint currently is LCM_Dreamshaper_v7.

This is a very barebone implementation written in an hour, so any PRs are welcome.

Table of Contents

Installation:

Simply clone this repo to your extensions/ directory:

git clone https://github.com/0xbitches/sd-webui-lcm

Or go to "Extensions->Install from URL".

Then reload your WebUI.

Generated images will be saved to outputs/txt2img-images/LCM. You can use PNG Info to examine generation data.

Img2Img / Vid2Vid

vid2vid

Img2Img/Vid2Vid with LCM is now supported in A1111. Simply update your extension and you should see the extra tabs.

Note that for these features, output height and width will be the same as input, and currently not changeable.

Generated videos will be saved to outputs/LCM-vid2vid.

Known Issues

1. Can't Find 'LCM' tab or ImportError: cannot import name 'xxx' from 'diffusers.xxx'

This is usually due to the installed version of diffusers in your venv is not up-to-date.

To check the version you have, go to stable-diffusion-webui/venv/Scripts and run the activate script (Activate.ps1 on Windows).

Then, run pip show diffusers to see the version installed.

To upgrade diffusers to the latest version, run pip3 install --upgrade diffusers.

If the problem still persists, then you likely have an extension that force installs an old version of diffusers.

EasyPhoto, for example, force installs diffusers=0.18.2.

2. ValueError: Non-consecutive added token '<|startoftext|>' found. Should have index 49408 but has index 49406 in saved vocabulary.

To resolve this, locate your huggingface hub cache directory.

It will be something like ~/.cache/huggingface/hub/path_to_lcm_dreamshaper_v7/tokenizer/. On Windows, it will roughly be C:\Users\YourUserName\.cache\huggingface\hub\models--SimianLuo--LCM_Dreamshaper_v7\snapshots\c7f9b672c65a664af57d1de926819fd79cb26eb8\tokenizer\.

Find the file added_tokens.json and change the contents to:

{
  "<|endoftext|>": 49409,
  "<|startoftext|>": 49408
}

or simply remove it.

3. torch.cuda.OutOfMemoryError...

This is because Automatic1111 loads an SD checkpoint on top of LCM.

Try Settings -> Actions -> Unload SD checkpoint to free VRAM

sd-webui-lcm's People

Contributors

0xbitches avatar

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.