Skip to content

Commit

Permalink
Pull v0.1rc1 into main (#65)
Browse files Browse the repository at this point in the history
* Add more GitHub shields to Readme

* Add more GitHub shields to Readme

* Update docs to include Pull Request warning, update requirements installer with latest PyTorch

* Patch token limit warning, make tests fail after any error, update docs to include testing and update some pages with better wording and formatting

* Enable loading of Checkpoint files / Safetensors, update docs, fix failing test for main

* AIT Batch size patch, CKPT/Safetensors model loading, Stop PerfLoop from crashing, bump diffusers to latest ones on main (required for ckpt), better handle local models, requiremets installer now ignores git+http lines, suppress some UserWarnings from Torch 2.0 transfer

* Patch psutil linux import that breaks windows

* Deleted old diffusers, added settings page, new CI for testing yarn build, rebuilt frontend

* Update yarn build CI

* Update GitHub templates

* AIT Image to Image support

* New Config settings, Updated docs, xFormers for PT2.0

* Update feature flags in the docs

* (internal) Prep for MultiModel loading, Real-ESRGAN

* Add wsl install script

* Fix WSL install sciript

* Update WSL script, add docs for WSL setup

* Fix incorrect link in the docs

* Add new PyTorch tests

* Pytorch optimizations (#48)

* Pytorch VRAM optimizations

* Little cleanup & fixed OL==4

* Clean up the code, expose the optLevel option in the main script, link it into the config

* Fix AIT pipe optimization level

* Reformat with black

* Integration in the frontend, config saving, docs

* Update default value in main.py to load from a config

---------

Co-authored-by: Stax124 <[email protected]>

* Update docs for local installation

* Update default value for optLevel, xFormers fix, more opt logging

* Patch config pointer overwrite bug

* Raise error when trying to run ControlNet with opt=0

* (internal) AITControlnet

* AIT ControlNet working

* Updated dead link in readme, rebuild frontend

* Fix incorrect Unet switching

* New unit tests, cached AIT compile

* Add extension recommendations for VSCode

* Fix AIT Canny ControlNet, and new ControlNet options (depth, normal, segmentation, fix mlsd)

* Update feature docs, fix AIT compile frontend websockets, Update docs name and description

* Fix typo in docs

* Do not raise on failed ControlNet Unet compile, as some models are not capable of it

* Nuke cluster.py, UI for converting models, do not crash AIT on ControlNet Unet fail

* Config naming revamp, initial work on SD Upscale, cleanup old code, update ImageOutput Vue class for better compatibility

* Extract lwp into a new module, enable lwp in controlnet

* Purge cache_dir variable, fix AIT path error, initial support for LoRA (no UI)

* Pull Lora branch into experimental (#52)

* Initial lora support

* Autorefresh UI on model change, rebuilt frontend

* Split optLevel into multiple parameters, make Loading UI more reliable, add UI word counter

* LoRA UI working, Unit test for LoRA, more consistent model API responses

* Add format script to yarn

* set DPM M as the default scheduler, dynamic metadata write, version lock gpustat

* Enable use of CPU

* Update autoinstaller to support AMD cards

* Better support for CPU and AMD users, init work on Rust Based install CLI

* ONNX support (#49)

* update gitignore

* PyTorch -- Onnx conversion

Basics done, _encode_prompt() should work as well, and so should
aten::scaled_dot_product_attention conversion, but I'm not sure,
needs some more testing.

* Refactor a bit + comment

* Rewrite conversion

This should hopefully reduce model size and allow for unet quantization
BREAKS LOADING COMPLETELY!!!

* (Theoretically) Fix loading & txt2img

In theory, this should have zero problems generating images.
Didn't test it tho, so it's all theory

* Try to fix inference (load works, inference does not)

* Fix txt2img

* Improve performance

This was done in school so nothing is tested (probably broke everything)

* Txt2img completely done

This was tested on Windows with CUDAExecutionProvider, DmlExecutionProvider
and CPUExecutionProvider.

Cuda and DirectML provide (at least currently) about the same performance
on my RTX 3080, however this may just be due to my subpar implementation.

CPUExecutionProvider is faster on native Windows than on WSL. (by about 25%)
In practice, on my Ryzen 9 5900X, WSL is 20s/it and Windows is 15s/it
(may have been a fluke, who knows at this point)

* Move functions to helpers / Basic img2img

* FP16 fallback for failed quantization

* Img2img working :)

* Inpainting

* Fix conversion, refactor & inpainting does not work

* Reformat with Black

---------

Co-authored-by: Stax124 <[email protected]>
Co-authored-by: Stax124 <[email protected]>

* Clean onnx.py

* Rename file to fix import self errors

* Rust based installer prep

---------

Co-authored-by: Márton Kissik <[email protected]>

* Fix Cache-control, initial work on S3/R2 bucket support

* ONNX pipeline added to API

* Use webp image format wherever possible

* Fix Unit tests, generate random image

* Fix ROCm UI

* Move some scripts to package.json

* Update dockerignore

* Cloudflare R2 bucket support

* add boto3 as requirement

* Add Send To Compontent in the UI

* AIT working with .ckpt/.safetensors

* Update .env and docker-compose.yml, Installer renamed to Manager, CI for Manager

* Update the workflow to include experimental

* ToMeSD support (#53)

* ToMeSD

* requirements.txt

* Fix typo

* Frontend

* Format with Black

---------

Co-authored-by: Stax124 <[email protected]>

* AIT VRAM savings, better ImageOutput UI, better SendTo UI

* Affix diffusers and controlnet-aux as new versions were released

* New Image Upload UI

* UI show only Valid models

* Update docs, UI fixed duped image

* More Volta-Manager progress

* Manager: remove some points where it can panic, update workflow to leave artifacts on GitHub

* Fix typo in action

* Fix typo

* More work on Manager

* Slowly wrap up work on Manger, main.py handles dotenv

* HighRes Fix, AIT Frontend slider lock, Flags

* Fix AIT property lock

* Ignore AITemplate directory

* Interrogators (#56)

* try to quantize things

* Start work on interrogators

(Deepdanbooru is the only one tested, and it works)

* finish interrogation work

* Revert lwp_sd.py

* Refactor

* Partial Frontend for tagger

* Fix requirement installer

* Frontend functional

---------

Co-authored-by: Stax124 <[email protected]>

* Rebuild frontend

* Correct number of steps for Img2img and HiRes

* Add an option to install dependencies without running UI or checking for HF tokens (#59)

* Add option to install deps only

* Restructure

---------

Co-authored-by: Stax124 <[email protected]>

* Fix ControlNet Depth, Normal non functional due to breaking changes in controlnet-aux

* Automatic memory cleanups

* Rename Exit to Back in submenus for Manager

* ControlNet and ControlNet preprocessor caching

* Update Dockerfile with the latest changes

* Add OutputStats to UI (seed, time taken)

* Add Delete and Download buttons to Image Browser, enable SendTo functionality from Image Browser

* Fix AIT Dimlock

* ImageBrowser Delete Modal (+icons), more consistent UI spacing, Interrupt button will be disabled if not generating an image

* Fix AITemplate UNet swapping

* Fix UI Grid "jitter" when switching pages

* validation error notification to the UI when API refuses the body

* Disable TomeSD by default, update dockerignore

---------

Co-authored-by: Márton Kissik <[email protected]>
Co-authored-by: aaronsantiago <[email protected]>
  • Loading branch information
3 people authored Apr 29, 2023
1 parent 6c82d05 commit 6d9f6d0
Show file tree
Hide file tree
Showing 208 changed files with 27,134 additions and 10,031 deletions.
21 changes: 15 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pyproject.toml
/traced_unet

# Documentation
docs/
/docs
yarn.lock
node_modules/
/node_modules

# Frontend
!frontend/dist/
frontend/dist/

# Static files
static/
/static

# Python
/venv
Expand All @@ -35,5 +35,14 @@ docker-compose.yml
# Jupyter
*.ipynb

# TensorRT
/lib/trt/lib/*
# Installer
/installer

# Other
**/**.pyc
.pytest_cache
.coverage
/.ruff_cache

# Manager
/manager
9 changes: 8 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ FASTAPI_ANALYTICS_KEY=
DISCORD_BOT_TOKEN=

# [Optional] Extra arguments for the API
EXTRA_ARGS=
EXTRA_ARGS=

# R2 - Cloudflare bucket storage (also pass in --enable-r2 in the EXTRA_ARGS)
R2_ENDPOINT=
R2_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
R2_DEV_ADDRESS=
27 changes: 26 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: "\U0001F41E Bug report"
description: Create a report to help us improve
title: "[Bug]: "
labels:
- bug
assignees:
- Stax124
body:
- type: markdown
attributes:
value: |
"Thanks for taking the time to fill out this bug report!"
Thanks for taking the time to fill out this bug report!
In order to help us fix the bug as quickly as possible, please make sure to follow the template and include all the information requested.
- 1. Be precise and descriptive in your report.
- 2. Try to include reproducible example.
- 3. Be laser focused on the bug and the bug only. If there is more then one bug, please report them separately.
- type: textarea
id: bug-description
attributes:
Expand All @@ -29,6 +38,14 @@ body:
placeholder: Expected behavior
validations:
required: true
- type: dropdown
attributes:
label: Installation Method
description: How did you install this project and how you are running it.
multiple: false
options:
- "Local"
- "Docker"
- type: dropdown
attributes:
label: Branch
Expand All @@ -47,6 +64,12 @@ body:
description: Python Version, Operating System, Currently installed version of this project, etc.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: "Please include the Python logs if you can."
render: bash
- type: textarea
id: additional-context
attributes:
Expand All @@ -62,3 +85,5 @@ body:
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
required: true
- label: I am writing the issue in English.
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "\U0001F680 New feature proposal"
description: Suggest an idea for this project
title: "[Feature]: "
assignees:
- Stax124
labels:
- "Feature Request"
body:
- type: markdown
attributes:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/manager_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Manager

on:
push:
branches: ["main", "experimental"]
paths:
- "**.rs"
pull_request:
branches: ["main", "experimental"]
paths:
- "**.rs"

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cd manager && cargo build --verbose --release
- name: Output binary
uses: actions/upload-artifact@v3
with:
name: volta-manager
path: manager/target/release/voltaml-manager
retention-days: 3
33 changes: 33 additions & 0 deletions .github/workflows/yarn_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Frontend Build Test

on:
push:
branches: [main, experimental]
pull_request:
branches: [main, experimental]

jobs:
build:
name: Build frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
dir: "frontend" # will run `yarn install` in `frontend` sub folder
- name: Build production bundle
uses: borales/actions-yarn@v4
with:
cmd: build # will run `yarn build:prod` command
dir: "frontend" # will run `yarn build` in `frontend` sub folder
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
__pycache__/
*.py[cod]
*$py.class
.ruff_cache

# Distribution / packaging
.Python
onnx-script/
build/
develop-eggs/
/dist
Expand Down Expand Up @@ -78,6 +80,11 @@ docs/.vitepress/dist
external
/tmp
/data
/data/settings.json
/AITemplate

# Ignore for black
core/submodules
core/submodules

# Manager
manager/target
11 changes: 9 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ init-hook="import sys; sys.path.insert(0, '.')"
ignore=
core/submodules,
typings,
core/tensorrt
core/tensorrt,
AITemplate,
disable=
C0114, # Missing module docstring
W1203, # Use lazy % formatting in logging functions
Expand All @@ -13,7 +14,13 @@ disable=
consider-using-dict-items,
import-outside-toplevel,
invalid-name,
relative-beyond-top-level
relative-beyond-top-level,
no-name-in-module,
too-many-instance-attributes,
too-few-public-methods,
too-many-branches,
too-many-arguments,
too-many-locals

[TYPECHECK]
generated-members=
Expand Down
15 changes: 15 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"recommendations": [
"ms-python.python",
"dbaeumer.vscode-eslint",
"github.copilot",
"ecmel.vscode-html-css",
"ms-python.isort",
"ms-vscode.vscode-typescript-next",
"esbenp.prettier-vscode",
"ms-python.vscode-pylance",
"vue.volar",
"christian-kohler.path-intellisense",
"rust-lang.rust-analyzer"
]
}
18 changes: 5 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"grammarly.selectors": [
{
"language": "markdown",
"scheme": "file",
"pattern": "docs/index.md"
},
{
"language": "markdown",
"scheme": "file",
"pattern": "docs/developers/documentation.md"
}
],
"python.testing.pytestArgs": ["."],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "basic",
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"rust-analyzer.linkedProjects": ["./manager/Cargo.toml"]
}
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@


<p>
<a href="https://github.com/VoltaML/voltaML-fast-stable-diffusion/actions/workflows/docker_build_main.yml">
<img src="https://github.com/VoltaML/voltaML-fast-stable-diffusion/actions/workflows/docker_build_main.yml/badge.svg" alt="docker build" />
</a>
<a href="https://github.com/VoltaML/voltaML-fast-stable-diffusion/actions/workflows/docs.yml">
<img src="https://github.com/VoltaML/voltaML-fast-stable-diffusion/actions/workflows/docs.yml/badge.svg" alt="docs" />
</a>
<a href="https://github.com/VoltaML/voltaML-fast-stable-diffusion/graphs/contributors">
<img src="https://img.shields.io/github/contributors/VoltaML/voltaML-fast-stable-diffusion" alt="contributors" />
</a>
Expand Down Expand Up @@ -37,7 +43,7 @@
<a href="https://discord.gg/pY5SVyHmWm"> <img src="https://dcbadge.vercel.app/api/server/pY5SVyHmWm" /> </a>

<h4>
<a href="https://stax124.github.io/voltaML-fast-stable-diffusion/">Documentation</a>
<a href="https://voltaml.github.io/voltaML-fast-stable-diffusion/">Documentation</a>
<span> · </span>
<a href="https://github.com/VoltaML/voltaML-fast-stable-diffusion/issues/new/choose">Report Bug</a>
<span> · </span>
Expand All @@ -46,6 +52,10 @@

</div>

<hr>
<h3 align="center">Made with ❤️ by <a href="https://github.com/Stax124/">Stax124</a></h3>
<hr>

<br />

<h1> Table of Contents</h1>
Expand Down Expand Up @@ -128,11 +138,11 @@

The below benchmarks have been done for generating a 512x512 image, batch size 1 for 50 iterations.

| GPU (it/s) | T4 | A10 | A100 | 4090 | 3090 | 2080Ti | 3050 |
| ---------- | --- | ---- | ---- | ---- | ---- | ------ | ---- |
| PyTorch | 4.3 | 8.8 | 15.1 | 19 | 11 | 8 | 4.1 |
| xFormers | 5.5 | 15.6 | 27.5 | 28 | 15.7 | N/A | 5.1 |
| AITemplate | N/A | 23 | N/A | N/A | N/A | N/A | 10.2 |
| GPU (it/s) | T4 | A10 | A100 | 4090 | 4080 | 3090 | 2080Ti | 3050 |
| ---------- | --- | ---- | ---- | ---- | ---- | ---- | ------ | ---- |
| PyTorch | 4.3 | 8.8 | 15.1 | 19 | 15.5 | 11 | 8 | 4.1 |
| xFormers | 5.5 | 15.6 | 27.5 | 28 | 20.2 | 15.7 | N/A | 5.1 |
| AITemplate | N/A | 23 | N/A | N/A | 40.5 | N/A | N/A | 10.2 |

## Installation

Expand Down Expand Up @@ -161,8 +171,3 @@ Distributed under the <b>GPL v3</b>. See [License](https://github.com/VoltaML/vo
Feel free to contact us on discord: https://discord.gg/pY5SVyHmWm

Project Link: [https://github.com/VoltaML/voltaML-fast-stable-diffusion](https://github.com/VoltaML/voltaML-fast-stable-diffusion)

<hr>
<p align="center">
Made with ❤️ by <a href="https://github.com/Stax124/">Stax124</a>
</p>
Loading

0 comments on commit 6d9f6d0

Please sign in to comment.