Commit Graph

350 Commits (master)

Author SHA1 Message Date
Bryce Drennan eb54b9ca7f
Merge pull request #22 from brycedrennan/pylama_lint_updates
refactor: implements changes to comply with pylama
2 years ago
Bryce a3a0de08e9 autoformat 2 years ago
Christian Käser 9fdd38fc11
Fix loading mask image from command line 2 years ago
Jay Drennan df28bf8805 refactor: implements changes to comply with pylama 2 years ago
Bryce cc014685bd fix: leave sample in float32 for all final processing 2 years ago
Bryce 9614a82f12 fix: use float32 at image render time for wider cpu compatibility
If the x_sample was a bfloat on the gpu but the cpu doesn't support bfloat, that can cause a TypeError
```
  File "/home/stdiff/.local/lib/python3.10/site-packages/imaginairy/api.py", line 292, in imagine
    x_sample.cpu().numpy(), "c h w -> h w c"

TypeError: Got unsupported ScalarType BFloat16`
```
2 years ago
Bryce cdfeaa4c6f tests: add docker image for testing environment. minor test improvements 2 years ago
Bryce 09bc1c70e6 fix: try to address #13 BFloat16 issue
Seems to be caused by incompatible types in group_norm when we use autocast.

Patch group_norm to cast the weights to the same type as the inputs

From what I can understand all the other repos just switch to full precision instead
of addressing this.  I think this would make things slower but I'm not sure. So maybe
the patching solution I'm doing is better?

https://github.com/pytorch/pytorch/pull/81852
2 years ago
Bryce e23e363bf5 lint 2 years ago
Bryce ff7fc0dab7 feature: tile mode can now be specified per-prompt 2 years ago
Bryce 6f77c23c1d version 1.5.4
minor changes to help with google colab compat
2 years ago
Bryce a46424c673 feature: img2img now supported with PLMS (instead of just DDIM)
Kinda hacky copy/pasting from ddim.  Need to cleanup
2 years ago
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
2 years ago
Bryce f040e3bffe feature: allow multiple additive targets for text masking targets 2 years ago
Bryce 930295d840 feature: txt2mask - automated text replacement
from https://github.com/timojl/clipseg
2 years ago
Bryce 7087c4a680 feature: automatic mask generation
mask generation working but not integrated
2 years ago
Bryce 8238e59067 tests: add more tests 2 years ago
Bryce d7cbf6e416 refactor: cleanup ddim
- delete more unused code
- fix some lints
2 years ago
Bryce 6307a0daf5 refactor: cleanup ddim 2 years ago
Bryce 89908603cf fix: don't repeatedly download the same url 2 years ago
Bryce 59648dbe61 test: add some tests/logging
add some experiments
2 years ago
Bryce 19d0b563ac style: lint fixes. remove unused code 2 years ago
Bryce c7a822d701 feature: urls as init images
- --init-image accepts urls
- cleanup command line code
2 years ago
Bryce 23f0e2be12 fix: select ddim for img2img 2 years ago
wseagar 56fc414724 fix: is_nsfw_img is None rather than false 2 years ago
Bryce fa3673ef56 fix: use context manager syntax compatible with python 3.8
parentheses supported in python 3.10
2 years ago
Bryce 51a8b1b8d8 fix: filter logic was wrong 2 years ago
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
2 years ago
Bryce bb665b9eb6 fix: make k-diffusion samplers deterministic
- add test for hashes on mps.  images look same on CUDA but are slightly different.
2 years ago
Bryce b4a3b8c2b3 feature: k-diffusion samplers
- improved image logging functionality. can just stick log_latent wherever you want
- improved some variable naming
- moved all the samplers together
- vendored k-diffusion library
2 years ago
Bryce bb7eaa47f6 docs: small doc updates 2 years ago
Bryce ff7455034d docs and lint 2 years ago
Bryce 541ecb9701 feature: face enhancement and upscaling!! 2 years ago
Bryce 14a06e160d build: vendor clip
it's not on pypi
https://github.com/openai/CLIP/issues/141
2 years ago
Bryce 6ac3d40009 docs: update readme. add docs to package
Clean up logging some more
2 years ago
Bryce 292d1bcab5 perf: get "half" mode working when running on cuda 2 years ago
Bryce b9c00dd8de fix: util functions in wrong place
add tile example in readme
2 years ago
Bryce 84a73cb5a2 feature: (wip) better image to image
I tried it with the DDIM sampler and it didn't work.

Probably need to use the k-diffusion sampler with it
from a846393251/find_noise.py

needs https://github.com/crowsonkb/k-diffusion
2 years ago
Bryce 438c2868ad refactor: run import sorter 2 years ago
Bryce 3bdf2dc3ec feature: tile mode
from https://github.com/replicate/cog-stable-diffusion/compare/main...TomMoore515:material_stable_diffusion:main
2 years ago
Bryce 0bb5b6b345 perf: performance optimizations from Doggettx
https://github.com/CompVis/stable-diffusion/compare/main...Doggettx:stable-diffusion:autocast-improvements#
https://www.reddit.com/r/StableDiffusion/comments/xalaws/test_update_for_less_memory_usage_and_higher/
2 years ago
Bryce 910b7b4180 refactor: simplify structure 2 years ago
Bryce f1b1e1c1c8 feature: add nsfw image filter 2 years ago
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
2 years ago
Bryce 6d1d0622eb feature: Mac M1 Support out of box
- auto-downloads checkpoints
- fixes bug in torch
- autoset environment variable
2 years ago
Bryce 66c640ce7b feature: add ImageResult. step output option
remove verbose args
2 years ago
Bryce 47c6bcee59 refactor: move commands to entrypoints 2 years ago
Bryce a26e002a86 refactor: use logging instead of prints 2 years ago
Bryce f782fac570 feature: image prompts 2 years ago
Bryce 0835b2db16 first commit 2 years ago