Skip to content

Commit

Permalink
Feature code linters: black, flake8, isort with github actions (Haidr…
Browse files Browse the repository at this point in the history
…a-Org#30)

* Add /bin to .gitignore

* Add dev dependencies in requirements.dev.txt

* Add style.sh script

* Add setup.cfg file

* Add github lint workflow

* fix typo

* Set the current folder in style.sh

* set the correct script location in the github workflow

* Running ./style.sh --fix

* Running isort

* Manually fixing flake8 errors

* Trying to fix incompatibilities

* Fix line length

* Fix deleted __init__.py imports

* Trying to fix creds.py not present in GitHub action

* Trying to fix creds.py not present in GitHub action - try 2

* Fix style.sh shebang

* Import some files after the disable_voodo and disable_xformers flags have been set

* gitignore: ignore ./models if it's a soft link instead of a folder
  • Loading branch information
leszekhanusz authored Nov 3, 2022
1 parent 3382d72 commit 3ec372b
Show file tree
Hide file tree
Showing 33 changed files with 1,628 additions and 905 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
pull_request:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dev dependencies
run: python -m pip install -r requirements.dev.txt

- name: Run lint and static type checks
run: bash ${GITHUB_WORKSPACE}/style.sh
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ cython_debug/

# repo specific
/models/
models
/outputs/
/temp/
/gfpgan/
Expand All @@ -170,4 +171,5 @@ custom-conda-path.txt
bridgeData.py
src/taming-transformers

/xformers-*
/xformers-*
/bin/
581 changes: 417 additions & 164 deletions bridge.py

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions bridgeData_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Visit https://stablehorde.net/register to create one before you can join
api_key = "0000000000"
# Put other users whose prompts you want to prioritize.
# The owner's username is always included so you don't need to add it here, unless you want it to have lower priority than another user
# The owner's username is always included so you don't need to add it here,
# unless you want it to have lower priority than another user
priority_usernames = []
# The amount of power your system can handle
# 8 means 512*512. Each increase increases the possible resoluion by 64 pixes
Expand All @@ -28,23 +29,25 @@
# If set to False, this worker will no longer pick img2img jobs from unsafe IPs
allow_unsafe_ip = True
# The models to use. You can select a different main model, or select more than one.
# With you can easily load 5 of these models with 32Gb RAM and 6G VRAM. Adjust how many models you load based on how much RAM (not VRAM) you have available
# With you can easily load 5 of these models with 32Gb RAM and 6G VRAM.
# Adjust how many models you load based on how much RAM (not VRAM) you have available.
# The last model in this list takes priority when the client accepts more than 1
# if you do not know which models you can add here, use the below command
# python show_available_models.py
models_to_load = [
"stable_diffusion", # This is the standard compvis model. It is not using Diffusers (yet)
## Specialized Style models
"stable_diffusion", # This is the standard compvis model. It is not using Diffusers (yet)
# Specialized Style models:
# "trinart",
# "Furry Epoch",
# "Yiffy",
# "waifu_diffusion",
## Dreambooth Models
# Dreambooth Models:
# "Arcane Diffusion",
# "Spier-Verse Diffusion",
# "Elden Ring Diffusion",
# "Robo-Diffusion",
# "mo-di-diffusion",

# "stable_diffusion_inpainting", # Enable this to allow inpainting/outpainting. Careful of trying to enable this in tandem with other models if you have 8G or less VRAM!
]
# "stable_diffusion_inpainting",
# Enable this to allow inpainting/outpainting.
# Careful of trying to enable this in tandem with other models if you have 8G or less VRAM!
]
2 changes: 1 addition & 1 deletion creds_template.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hf_username = "username"
hf_password = "**********"
hf_password = "**********"
1 change: 1 addition & 0 deletions nataili/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .util.switch import Switch

disable_xformers = Switch()
disable_voodoo = Switch()
583 changes: 372 additions & 211 deletions nataili/inference/compvis/img2img.py

Large diffs are not rendered by default.

Loading

0 comments on commit 3ec372b

Please sign in to comment.