Commit Graph

345 Commits

Author SHA1 Message Date
jaydrennan
3bd3dfdeaf
feature: adds --composition-strength parameter to cli (#416) 2023-12-16 14:40:06 -08:00
jaydrennan
e1e6f8037c
refactor: removes unused code and configurations (#405)
Co-authored-by: jaydrennan
2023-12-15 15:27:00 -08:00
Bryce
6d39d791b1 refactor: move safety to utils 2023-12-15 14:32:01 -08:00
Bryce
168a843f29 refactor: move colorize to api 2023-12-15 14:32:01 -08:00
Bryce
96f4268d44 refactor: move video_sample to api 2023-12-15 14:32:01 -08:00
Bryce
e72e8992ab refactor: create api module 2023-12-15 14:32:01 -08:00
Bryce
ad561e8833 refactor: move model_manager to utils 2023-12-15 14:32:01 -08:00
Bryce
d478771cc0 refactor: move a bunch of stuff to utils 2023-12-15 14:32:01 -08:00
Bryce
987af23abe refactor: move train.py 2023-12-15 14:32:01 -08:00
Bryce
0c456cd52a refactor: remove lr_scheduler.py 2023-12-15 14:32:01 -08:00
Bryce
01e32ff3f6 refactor: move bin files 2023-12-15 14:32:01 -08:00
Bryce
316114e660 docs: add docstrings
Wrote an openai script and custom prompt to generate them.
2023-12-15 14:32:01 -08:00
jaydrennan
3f3e080d39 feature: adds ability to use qrcode
feature: adds controlnet qrcode image generation.
feature: adds control net for qrcode image generation.
2023-12-14 21:12:25 -08:00
Bryce
62de446a92 ci: add mypy github action 2023-12-12 20:54:39 -08:00
Bryce
012cc648d3 style: fix all the mypy typing issues
...or ignore them.
2023-12-12 20:54:39 -08:00
Bryce
5a636e45c5 feature: skip composition at sizes slightly larger than model is expecting 2023-12-12 20:54:39 -08:00
Bryce
203747b14f refactor: simplify model_weights/architecture 2023-12-12 20:54:39 -08:00
Bryce
37ecd1e5e0 fix: videogen. track gpu tests 2023-12-12 20:54:39 -08:00
Bryce
eae4f20ae2 ci: add type checker
fix some typehint issues
2023-12-12 20:54:39 -08:00
Bryce
e898e3a799 fix: several cli commands, edit demo, negative prompt
- fix colorize cmd. add test
- fix describe cmd. add test
- fix model-list cmd. add test
- fix stable studio
- hide stack grace for ValueErrors in cli
- set controlnet scale
- fix negative prompt to allow emptystring instead of replacing it with default
- adjust edit-demo parameters
- arg scheduler that works at click level (but disable it). works but not ideal experience.
2023-12-12 20:54:39 -08:00
Bryce
c299cfffd9 fix: cache the controlnet models 2023-12-12 20:54:39 -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
2bd6cb264b feature: large refactor
- add type hints
- size parameter
- ControlNetInput => ControlInput
- simplify imagineresult
2023-12-12 20:54:39 -08:00
Bryce
db85f0898a feature: remove training feature 2023-12-06 22:04:06 -08:00
jaydrennan
ef0f44646e feature: adds --control-strength as parameter for cli 2023-12-05 22:14:19 -08:00
Bryce
24f4af3482 feature: better torch installation experience 2023-12-05 21:46:55 -08:00
Bryce
71d4992dca feature: added --size parameter to allow using named sizes 2023-12-05 21:46:55 -08:00
Bryce
14ecf93c6a feature: add sliced self-attention for future use with video generation 2023-12-05 21:46:55 -08:00
Bryce
0fe3733933 fix: memory management issue
the dtype being used as a cache key wasn't consistent. this caused the model to be loaded twice
2023-12-03 09:13:01 -08:00
Bryce
82c30024c9 feature: DDIM now default sampler
better output quality
2023-12-03 09:13:01 -08:00
Bryce
ba57393022 feature: patch refiners ScaledDotProductAttention for sliced attention 2023-12-03 09:13:01 -08:00
Bryce
1b15d6dcd4 feature: sliced image encoding for SD1Autoencoder 2023-12-03 09:13:01 -08:00
Bryce
b61d06651c tests: fix tests
- disable details mode. needs more work done to support
2023-12-03 09:13:01 -08:00
jaydrennan
cff17ef6f4
feature: adds text to video generation flag (#404)
Co-authored-by: jaydrennan
2023-11-27 18:00:56 -08:00
Bryce
8267482aad fix: remove padding approach
- padding didnt make animations better
- some changes to better support CPU generation (not yet working)
- better log output coloring
- better log messages when cuda not found
2023-11-25 16:18:44 -08:00
Bryce
b9e245eb7d fix: remove cuda memory tracking 2023-11-24 12:39:49 -08:00
Bryce
3b2265f82d feature: add video progress bar 2023-11-24 12:33:36 -08:00
Bryce
b5a0e65f35 fix: edit mode and some controlnet tests 2023-11-24 09:10:12 -08:00
Bryce
b7fad562d0 feature: improved logging
- clean up some error messages
- add color
- indent tqdm bar
2023-11-24 08:27:36 -08:00
Bryce
a126e1c1d7 feature: better error message when file not found 2023-11-23 12:24:48 -08:00
Bryce
aa91d0a9c9 feature: autoresize and crop videos.
This means you can just stick any image into the video generator without worrying about the size.

- better generated video filenames
- output h264 video as well
2023-11-23 10:16:12 -08:00
Bryce
c24ed1f33d feature: videogen improvements
- better filenames
- allow urls as image inputs
- better memory efficiency
- add timing information
2023-11-22 20:43:32 -08:00
Bryce
1da7043081 docs: update documentation 2023-11-22 18:26:50 -08:00
Bryce
e8fe8d7d6c feature: stable diffusion video (SVD) 2023-11-22 17:20:08 -08:00
jaydrennan
80ff006604 fix: updates weights_url's for controlnet 2023-11-22 17:18:22 -08:00
jaydrennan
e91a041a78 refactor: removes unused model configs 2023-11-22 17:14:44 -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
6cd519cdb2 refactor: move code to avoid conflicts with "http" namespace 2023-10-10 23:03:01 -07:00
Bryce
558d3388e5 style: speed up linting and autoformatting. fix lints 2023-09-29 23:01:50 -07:00
Bryce
8243ed616d fix: pydantic models for http server working now. Fixes #380 2023-09-29 00:40:46 -07:00
Bryce
7c2004bfcc feature/fix: migrate to pydantic 2.3
- test: add schema tests/fuzzer and fixes
 - fix default prompt. add tests
 - fix outpaint and controlnet defaults
 - fix init image strength defaults
2023-09-16 23:09:18 -07:00
Bryce
8e956f5360 feature: add some helper functions 2023-09-16 23:09:18 -07:00
Bryce
f243006236 fix: allow tile_mode to be set to True or False for backward compatibility 2023-09-09 17:37:43 -07:00
Bryce
477d161c91 build: better communicate lack of support for Python 3.11 2023-09-09 15:25:57 -07:00
Bryce
82d74c6b49 feature: switch to pydantic models
- allow prompt re-use by deferring random seed
2023-05-31 20:02:09 -07:00
Bryce
3fb0dcd891 fix: hide log warning 2023-05-31 20:02:09 -07:00
Bryce
c5c90df337 feature: fix debug level logging 2023-05-31 20:02:09 -07:00
Bryce
8ffb0fac0e fix: add routes to match stablestudio routes 2023-05-26 22:28:43 -07:00
Bryce
edafcc5529 feature: show full stack trace on server error 2023-05-26 22:28:43 -07:00
Bryce
671aa86ad7 version: 13.0.0 2023-05-22 02:50:59 -07:00
Bryce
7b032c8e9a feature: StableStudio web interface
run `aimg server` and visit http://127.0.0.1:8000/
2023-05-22 02:24:05 -07:00
Bryce
8e28a2ed02 feature: API support for StableStudio 2023-05-22 02:24:05 -07:00
Bryce
e53459a50a build: check for torch version at runtime (fixes #329) 2023-05-20 17:29:06 -07:00
Bryce
2a26495653 fix: package will not try to install xformers on aarch64 machines.
While this will allow the dockerfile to build on MacOS M1, [torch will not be able to use the M1 when generating images.](https://github.com/pytorch/pytorch/issues/81224#issuecomment-1499741152)
2023-05-20 17:29:06 -07:00
Bryce
14739bc90b feature: api server (alpha)
`aimg run-api-server`

Proof of concept for now
2023-05-20 17:29:06 -07:00
Bryce
38ac0b7f54 tests: fix tests 2023-05-20 13:09:00 -07:00
Bryce
39dffa9166 style: lintfix 2023-05-20 13:09:00 -07:00
Bryce
dc8f8d5a3d feature: add colorization controlnet. improve aimg colorize command 2023-05-20 13:09:00 -07:00
Bryce
df25936d6f feature: automatic use of inpainting
feature disabled since controlnet inpainting doesn't work great. Was disabled by setting `inpaint_method="finetune",`
2023-05-20 13:09:00 -07:00
Bryce
d32e1060cd feature: multi-controlnet support at the command line
add controlnet option for edit demo
2023-05-20 13:09:00 -07:00
Bryce
bcaa000d35 fix: model logging 2023-05-20 13:09:00 -07:00
Bryce
926692ad03 tests: "prime" the controlnets
Trying to get things working on m1. doesn't fix everything
2023-05-20 13:09:00 -07:00
Bryce
fb19e34acc fix: allow use of upscaler on mps device 2023-05-20 13:09:00 -07:00
Bryce
3b066f8e29 fix: don't hide error messages during upscale 2023-05-20 13:09:00 -07:00
Bryce
eca97a25a0 tests: adjust tests to pass 2023-05-20 13:09:00 -07:00
Bryce
4c77fd376b feature: improvements to memory management
not thoroughly tested on low-memory devices
2023-05-20 13:09:00 -07:00
Bryce
d5a276584b fix: move normal map code inline
Fixes conda package. Fixes #317
2023-05-06 13:01:50 -07:00
Bryce
3258af7e02 fix: use correct device for depth images on mps 2023-05-05 08:29:52 -07:00
Bryce
17f3541d57 version: 12.0.0 2023-05-05 03:03:47 -07:00
Bryce
c9fccc1757 feature: add openjourney-v4 2023-05-05 02:53:43 -07:00
Bryce
db8d3b74ea feature: add "detail" control mode.
Add details to an image. Great for upscaling an image.
2023-05-05 02:53:43 -07:00
Bryce
b5356b143f feature: partial add of inpainting controlnet
todo: figure out how to input "mask" for this mode
2023-05-05 02:53:43 -07:00
Bryce
9526a85a71 feature: add "edit" control mode
Edit images using text instructions with any SD 1.5 based model. Similar to instructPix2Pix.
2023-05-05 02:53:43 -07:00
Bryce
476a81a967 feature: add "shuffle" control mode
Image is generated from elements of control image. similar to style transfer
2023-05-05 02:53:43 -07:00
Bryce
750d4f7ea8 docs: cleanup 2023-05-05 02:53:43 -07:00
Bryce
832adf27bc feature: update controlnets to 1.1
- smaller filesizes for the controlnet weights
- fix: works with other 1.5 based models
- enables more control modes getting added
2023-05-04 19:48:27 -07:00
Bryce
9a82dc5e4c fix: raw control images are now properly loaded. fixes #296 2023-04-28 20:52:32 -07:00
Bryce
765e607c2c fix: file numbers start after latest image, even if some previous images were deleted 2023-04-28 20:52:32 -07:00
Luke Pearson
94728d978e fix: changed sample to True to generate caption using blip model 2023-04-18 08:03:37 -07:00
Bryce
95d3d08d27 fix: better input image path handling
throw exception for non-existent images
2023-04-14 00:22:43 -07:00
Bryce
37d6642c83 fix: fix model downloads that were broken
by [library change in transformers 4.27.0](8f3b4a1d5b)
2023-03-18 13:49:11 -07:00
Bryce
eb26d5a7c5 feature: add art-scene, desktop-background, interior-style, painting-style phraselists
fix: file globbing works in the interactive shell
feature: make compilation animations simple slide shows
2023-03-11 15:40:52 -08:00
Bryce
52044c1073 fix: use model appropriate composition size 2023-02-28 23:14:22 -08:00
Bryce
3b777b98d8 fix: improved large images using composition 2023-02-28 21:04:00 -08:00
Bryce
a449fbd5e2 feature: remove tiling message for upscaler 2023-02-28 21:04:00 -08:00
Bryce
40da2b0357 tests: fix tests 2023-02-28 21:04:00 -08:00
Bryce
dbc6a249a6 fix: k-diff samplers made more stable by skipping second to last step
https://github.com/crowsonkb/k-diffusion/issues/43#issuecomment-1305195666

See discussion here as well: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3483
2023-02-28 21:04:00 -08:00
Bryce
70c58467c0 fix: img2img was broken for all samplers except ddim,plms
img2img was broken for all samplers except plms and ddim when init image strength was >~0.25.  Been this way for a while. whoops
2023-02-28 21:04:00 -08:00
Bryce
28c294554b fix: specify name of imagine command 2023-02-26 17:13:47 -08:00
Bryce
8273ab2c26 feature: add --fix-faces options to aimg upscale command 2023-02-25 14:29:55 -08:00