Commit Graph

19 Commits

Author SHA1 Message Date
Bryce
9cdacd454f style: use latest ruff 2024-03-15 11:32:24 -07:00
Bryce
316114e660 docs: add docstrings
Wrote an openai script and custom prompt to generate them.
2023-12-15 14:32:01 -08:00
Bryce
9b95e8b0b6 perf: improve cli startup time
- do not provide automatically imported api functions and objects in `imaginairy` root module
- horrible hack to overcome horrible design choices by easy_install/setuptools

The hack modifies the installed script to remove the __import__ pkg_resources line

If we don't do this then the scripts will be slow to start up because of
pkg_resources.require() which is called by setuptools to ensure the
"correct" version of the package is installed.

before modification example:
```
__requires__ = 'imaginAIry==14.0.0b5'
__import__('pkg_resources').require('imaginAIry==14.0.0b5')
__file__ = '/home/user/projects/imaginairy/imaginairy/bin/aimg'
with open(__file__) as f:
    exec(compile(f.read(), __file__, 'exec'))
```
2023-12-12 20:54:39 -08:00
Bryce
f97f6a3b4b feature: use refiners library for generation
BREAKING CHANGE

  - stable diffusion 1.5 + inpainting working
  - self-attention guidance working. improves image generation quality
  - tile-mode working
  - inpainting self-attention guidance working

disable/broken features:
  - sd 1.4, 2.0, 2.1
  - most of the samplers
  - pix2pix edit
  - most of the controlnets
  - memory management
  - python 3.8 support

wip
2023-11-22 13:22:00 -08:00
Bryce
477d161c91 build: better communicate lack of support for Python 3.11 2023-09-09 15:25:57 -07:00
Bryce Drennan
9eacf5e7ed
perf: improve startup time by doing some imports lazily (#233)
just running `aimg --help` or `aimg --version` was very slow due to all the imports being brought in eagerly

Before changes `aimg --help`
`2.24s user 4.05s system 184% cpu 3.416 total`

After changes:
`0.04s user 0.02s system 8% cpu 0.625 total`

Used `PYTHONPROFILEIMPORTTIME=1 aimg --help` to find time consuming imports.

Also switched to using `scripts` instead of `entrypoints` since the scripts are much faster.

Made duplicate SAMPLER_TYPE_OPTIONS that can be loaded without loading all the samplers themselves.

Likely a breaking change - not sure.
2023-02-02 21:43:04 -08:00
Bryce
5b56f05da7 feature: print version
- fix: default config wasn't being selected for custom models
2023-01-18 12:04:07 -08:00
Bryce
94c0aeab12 feature: switch between models without restarting python instance 2022-10-23 22:55:28 -07:00
Bryce
0fb03f2a1f fix/version: 2.0.1
quick fix for compatibility with Pillow < 9.1.0
https://stackoverflow.com/questions/71738218/module-pil-has-not-attribute-resampling
2022-09-25 23:27:03 -07:00
Bryce
4705d182d5 feature: generate captions for images
- add wip functionality for negative masks
- ci: add code linter that removes unused imports
- add instructions to install rust on osx
2022-09-19 21:19:22 -07:00
Bryce
7087c4a680 feature: automatic mask generation
mask generation working but not integrated
2022-09-17 17:08:48 -07:00
Bryce
c7a822d701 feature: urls as init images
- --init-image accepts urls
- cleanup command line code
2022-09-15 23:06:59 -07:00
Bryce
967eb76365 refactor/test: logging suppression + hashed image test
- simpler logging suppression for `transformers` library
- suppress logging noise for running tests
- get test running for all samplers on mps and cuda platforms
- refactor safety model env variable to allow classification
2022-09-14 19:40:50 -07:00
Bryce
541ecb9701 feature: face enhancement and upscaling!! 2022-09-13 00:27:53 -07:00
Bryce
438c2868ad refactor: run import sorter 2022-09-11 13:58:14 -07:00
Bryce
3bdf2dc3ec feature: tile mode
from https://github.com/replicate/cog-stable-diffusion/compare/main...TomMoore515:material_stable_diffusion:main
2022-09-11 13:56:41 -07:00
Bryce
f1b1e1c1c8 feature: add nsfw image filter 2022-09-11 00:35:57 -07:00
Bryce
7a33ee2480 feature: cleaned up logging
- cleans up all the logging. hide most of it
 - create better readme. show example images
 - save metadata into image
2022-09-10 23:27:22 -07:00
Bryce
0835b2db16 first commit 2022-09-07 20:59:30 -07:00