Commit Graph

145 Commits (master)

Author SHA1 Message Date
Bryce d32e1060cd feature: multi-controlnet support at the command line
add controlnet option for edit demo
1 year ago
Bryce bcaa000d35 fix: model logging 1 year ago
Bryce 926692ad03 tests: "prime" the controlnets
Trying to get things working on m1. doesn't fix everything
1 year ago
Bryce eca97a25a0 tests: adjust tests to pass 1 year ago
Bryce 4c77fd376b feature: improvements to memory management
not thoroughly tested on low-memory devices
1 year ago
Bryce 6db296aa37 tests: faster tests 1 year ago
Bryce c082ea523f tests: update tests
- controlnet version changes + graphics card change
1 year ago
Bryce db8d3b74ea feature: add "detail" control mode.
Add details to an image. Great for upscaling an image.
1 year ago
Bryce 476a81a967 feature: add "shuffle" control mode
Image is generated from elements of control image. similar to style transfer
1 year ago
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
1 year ago
Bryce 95d3d08d27 fix: better input image path handling
throw exception for non-existent images
1 year ago
Bryce 37d6642c83 fix: fix model downloads that were broken
by [library change in transformers 4.27.0](8f3b4a1d5b)
1 year ago
Bryce 3b777b98d8 fix: improved large images using composition 1 year ago
Bryce 40da2b0357 tests: fix tests 1 year ago
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
1 year ago
Bryce e3b23584ed refactor: split up command line tool 1 year ago
Bryce b261c62d4e docs: update docs 1 year ago
Bryce 54c3ad51d6 feature: controlnet 1 year ago
Bryce bcd761b8a6 tests: better coverage of cli commands
add "empty" model that just uses empty state for models
1 year ago
Bryce 7b684b6e5c test: add smoke test for edit command 1 year ago
Bryce 1563e0b871 test: add some autoencoder tests
the fold-unfold encoding/decoding looks like it's slower and has worse seams than the sliced feathering approach
1 year ago
Bryce b93b6a4d7c perf: use silu instead of nonlinearity for speedup 1 year ago
Bryce 003a512dc8 perf: mps perf improvement
attention slicing wasn't working
1 year ago
Bryce ea1d4baafe refactor: cleanup image generation code 1 year ago
Bryce 8a97213622 feature: sliced latent decoding
allows generation of bigger images. tile seams can be noticeable occasionally despite the feathering
1 year ago
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.
1 year ago
Bryce Drennan 9ee09ac842
feature: add compilation animations (#224)
- add generation/compare gifs
1 year ago
Bryce Drennan 542e4fbd55
fix: tile mode was broken since latest perf improvements (#220) 1 year ago
Bryce Drennan 7deabaae62
tests: update expected images for tests (#215) 1 year ago
Bryce 8855823293 fix: rename files for windows compat 1 year ago
Bryce 5b56f05da7 feature: print version
- fix: default config wasn't being selected for custom models
1 year ago
Bryce 81f294216b feature: 🎉 outpainting 1 year ago
Bryce 24e10f9e5f fix: don't report a safety issue when a black image is generated 1 year ago
Bryce 5cc73f6087 feature: finetuning
- feature: finetuning your own image models
- feature: image prep command. crops to face or other interesting parts of photo
- fix: back-compat for hf_hub_download
- feature: add prune-ckpt command
- feature: allow specification of model config file
1 year ago
Bryce 9e0a9e2c29 tests: update 1 year ago
Bryce eb40842078 test: more flexible embedding test 1 year ago
Bryce 1381c7fed4 lint: new ruff linter 1 year ago
Bryce da0f1e1ee6 fix: make sure randomness is generated on cpu for consistency 1 year ago
Bryce 1f7403155e fix: more thorough cleaning of memory when switching models
also cleanup up some test failures
1 year ago
Bryce f30823e0b5 feature: Stable Diffusion 2.1 2 years ago
Bryce 2f8edc1530 feature: negative prompting
- feature: negative prompting.  `--negative-prompt` or `ImaginePrompt(..., negative_prompt="ugly, deformed, extra arms, etc")`
- feature: a default negative prompt is added to all generations. Images in SD-2.0 don't look bad anymore. Images in 1.5 look improved as well.
2 years ago
Bryce 554fc1d0ec tests: update images
- probably the k-diffusin update fixed some bugs
- add missing images
2 years ago
Bryce 257752887d perf: add back memory efficiency improvements
Removed these in a rush to get SD-2.0 out.
2 years ago
Bryce 9c153a8d2d feature: support k-sampler methods for SD-2.0-v (768) 2 years ago
Bryce 015088507f feature/refactor/fix: better defaults. correct version in metadata
- feature: use different default steps and image sizes depending on sampler and model selceted
- fix: #110 use proper version in image metadata
- refactor: samplers all have their own class that inherits from ImageSampler
2 years ago
Kian-Meng Ang 3d04df4dee Fix typos
Found via `codespell -S ./imaginairy/vendored`
2 years ago
Bryce e67341223b feature: Stable Diffusion 2.0
working: CUDA and MacOS
working: 512p model with all samplers
working: inpainting with all samplers
working: 768p model with ddim sampler
2 years ago
Bryce 893b041a8f feature: progress image callback 2 years ago
Bryce 7af1ab66ca fix: add workaround for bug in k_diffusion on mps
As documented here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4558#issuecomment-1310387114

- make image logs more consistent
- note which step the progress images belong to in the filename
2 years ago
Bryce 7fba2972e8 feature: added `DPM++ 2S a` and `DPM++ 2M` samplers
-fix: fix bug with `--show-work`
2 years ago
Bryce 021a0c540d feature: inpainting model support; improved model manager 2 years ago
Bryce 94c0aeab12 feature: switch between models without restarting python instance 2 years ago
Bryce 4d802a043e feature: stable diffusion 1.5 2 years ago
Bryce 8332593fed feature: dilation and erosion of masks
Previously the `+` and `-` characters in a mask (example: `face{+0.1}`) added to the grayscale value of any masked areas. This wasn't very useful. The new behavior is that the mask will expand or contract by the number of pixel specified. The technical terms for this are dilation and erosion.  This allows much greater control over the masked area.
2 years ago
Bryce 741a433c56 feature: update k_diffusion. add dpm_fast and dpm_addaptive samplers 2 years ago
Bryce 1aa17f8020 tests: disable slow tests when running on github 2 years ago
Bryce dcf953383e tests: support distributed test runs
- switch to expected images instead of hashes. allow fuzzy matches
feature: more consistent seeds
2 years ago
Bryce 4ba1965db8 feature: k-diff sampler img2img and masking 2 years ago
jsdman1313@gmail.com 740870ad8e fix: updates cats to dogs test to check between two different hashes 2 years ago
Bryce 281d23adf2 refactor: prep for supporting img2img in k-samplers 2 years ago
Bryce 299687645b refactor: remove unused parameter 2 years ago
Bryce db5ebe9095 tests: tests can run without any network calls 2 years ago
Bryce a9bde7386c tests: disable test if running on github actions 2 years ago
Bryce df3c752eb8 refactor: consolidate logging utils 2 years ago
Bryce 6a80759016 feature: improved safety filter
- provides more informative logs
- provides a detailed safety score object
- adds non-bypassable filter for extreme content
2 years ago
Bryce Drennan 31c2160e21
feature: prompt expansion (#51)
You can use `{}` to randomly pull values from lists.  A list of values separated by `|` and enclosed in `{ }` will be randomly drawn from in a non-repeating fashion. Values that are surrounded by `_ _` will pull from a phrase list of the same name.   Folders containing .txt phraselist files may be specified via
`--prompt_library_path`. The option may be specified multiple times.  Built-in categories:

      3d-term, adj-architecture, adj-beauty, adj-detailed, adj-emotion, adj-general, adj-horror, animal, art-movement,
      art-site, artist, artist-botanical, artist-surreal, aspect-ratio, bird, body-of-water, body-pose, camera-brand,
      camera-model, color, cosmic-galaxy, cosmic-nebula, cosmic-star, cosmic-term, dinosaur, eyecolor, f-stop,
      fantasy-creature, fantasy-setting, fish, flower, focal-length, food, fruit, games, gen-modifier, hair, hd,
      iso-stop, landscape-type, national-park, nationality, neg-weight, noun-beauty, noun-fantasy, noun-general,
      noun-horror, occupation, photo-term, pop-culture, pop-location, punk-style, quantity, rpg-item, scenario-desc,
      skin-color, spaceship, style, tree-species, trippy, world-heritage-site

   Examples:

   `imagine "a {red|black} dog" -r 2 --seed 0` will generate both "a red dog" and "a black dog"

   `imagine "a {_color_} dog" -r 4 --seed 0` will generate four, different colored dogs. The colors will eb pulled from an included
   phraselist of colors.

   `imagine "a {_spaceship_|_fruit_|hot air balloon}. low-poly" -r 4 --seed 0` will generate images of spaceships or fruits or a hot air balloon

   Credit to [noodle-soup-prompts](https://github.com/WASasquatch/noodle-soup-prompts/) where most, but not all, of the wordlists originate.
2 years ago
Bryce 9ba302a5f4 refactor: begin to standardize samplers 2 years ago
Bryce e5c5df6b3d tests: add some utils tests 2 years ago
Bryce f21c979f08 feature: better masking segmentation from clipseg 2 years ago
Bryce bc135724a3 fix: fix memory leak in face enhancer
thanks to @h4rk8s for discovering and finding a remedy

root cause was a model being instantiated inside
FaceRestoreHelper
2 years ago
Bryce 95a8fa31a9 fix: inpainting producing blurry images
while the previous version did produce much better blending it also makes images that lack detail for some reason.

tests: Added more tests to help catch this sort of thing earlies

fix: found that median blur is really slow, so I made sure we only do it on downsampled masks.  Was taking like 3 minutes to run on the large pearl girl picture on M1

- docs: update examples
2 years ago
Bryce 6cae290038 fix: inpainting now matches photo at high generation strength
- 🎉 fix: inpainted areas correlate with surrounding image, even at 100% generation strength.  Previously if the generation strength was high enough the generated image
would be uncorrelated to the rest of the surrounding image.  It created terrible looking images.
 - fix: mask boundaries are more accurate
2 years ago
Bryce eaad0a15e4 ci: add automated testing/linting
- fix bugs
- disable some tests from running in CPU only mode since github actions can't handle it
2 years ago
Bryce d832f15297 fix: masking now works properly at strengths 0 and 1 2 years ago
Bryce 38c7f88950 feature: boolean logic masks
Specify advanced text based masks using boolean logic and strength modifiers. Mask descriptions must be lowercase. Keywords uppercase.
Valid symbols: `AND`, `OR`, `NOT`, `()`, and mask strength modifier `{*1.5}` where `+` can be any of `+ - * /`. Single-character boolean
operators also work.  When writing strength modifies know that pixel values are between 0 and 1.

 - feature: apply mask edits to original files
 - feature: auto-rotate images if exif data specifies to do so
 - fix: accept mask images in command line
2 years ago
Jay Drennan df28bf8805 refactor: implements changes to comply with pylama 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 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 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 59648dbe61 test: add some tests/logging
add some experiments
2 years ago
Bryce c7a822d701 feature: urls as init images
- --init-image accepts urls
- cleanup command line code
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 541ecb9701 feature: face enhancement and upscaling!! 2 years ago
Bryce 438c2868ad refactor: run import sorter 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