Commit graph

556 commits

Author SHA1 Message Date
Doryan Kaced 9f6733de8e Add concepts learning via textual inversion 2023-08-31 16:07:53 +02:00
Pierre Chapuis 0f476ea18b make high-level adapters Adapters
This generalizes the Adapter abstraction to higher-level
constructs such as high-level LoRA (targeting e.g. the
SD UNet), ControlNet and Reference-Only Control.

Some adapters now work by adapting child models with
"sub-adapters" that they inject / eject when needed.
2023-08-31 10:57:18 +02:00
Cédric Deltheil 7dc2e93cff tests: add test for clip image encoder
This covers a CLIPImageEncoderH model (Stable Diffusion v2-1-unclip)
specifically
2023-08-30 21:50:01 +02:00
Cédric Deltheil 3746d7f622 scripts: add converter for clip image encoder
Tested with:

    python scripts/conversion/convert_transformers_clip_image_model.py \
      \ --from /path/to/stabilityai/stable-diffusion-2-1-unclip
2023-08-30 21:50:01 +02:00
Cédric Deltheil d8004718c8 foundationals: add clip image encoder 2023-08-30 21:50:01 +02:00
Pierre Chapuis 32c1cfdbb1 add black to CI 2023-08-30 14:50:03 +02:00
Doryan Kaced 08a5341452 Make image resize configurable in training scripts 2023-08-30 14:05:29 +02:00
Doryan Kaced 437fa24368 Make horizontal flipping parametrable in training scripts 2023-08-30 12:41:03 +02:00
Pierre Chapuis 18c84c7b72 shorter import paths 2023-08-29 16:57:40 +02:00
limiteinductive 8615dbdbde Add inner_dim Parameter to Attention Layer in Fluxion 2023-08-28 16:34:25 +02:00
limiteinductive 7ca6bd0ccd implement the ConvertModule class and refactor conversion scripts 2023-08-28 14:39:14 +02:00
Doryan Kaced 3680f9d196 Add support for learned concepts e.g. via textual inversion 2023-08-28 10:37:39 +02:00
Benjamin Trom 8b1719b1f9 remove unused TextEncoder and UNet protocols 2023-08-25 17:34:26 +02:00
limiteinductive a5f70b6d22 add .env to .gitignore 2023-08-25 16:37:50 +02:00
limiteinductive 92a21bc21e refactor latent_diffusion module 2023-08-25 12:30:20 +02:00
Pierre Chapuis 3ee0ccccdc update poetry 2023-08-24 19:08:48 +02:00
Pierre Chapuis d311f779c0 test all chain manipulation methods 2023-08-23 17:49:59 +02:00
Pierre Chapuis 802970e79a simplify Chain#append 2023-08-23 17:49:59 +02:00
Pierre Chapuis beacfe816b reordering (match chain.py order) 2023-08-23 17:49:59 +02:00
Pierre Chapuis e05c410a86 split test in two 2023-08-23 17:49:59 +02:00
Pierre Chapuis 337d2aea58 cosmetics 2023-08-23 17:49:59 +02:00
Pierre Chapuis 16618d73de remove useless uses of type: ignore 2023-08-23 17:49:59 +02:00
Pierre Chapuis 1065dfe10b add empty __init__.py files to make pytest happy
(otherwise it wants unique file basenames)
2023-08-23 17:49:59 +02:00
Pierre Chapuis a0c70ba7aa add a test for StopIteration in walk 2023-08-23 12:15:56 +02:00
Pierre Chapuis dec0d64432 make walk and layers not recurse by default
There is now a parameter to get the old (recursive) behavior.
2023-08-23 12:15:56 +02:00
Pierre Chapuis 2ad26a06b0 fix LoRAs on Self target 2023-08-23 12:13:01 +02:00
limiteinductive 3565a4127f implement DoubleTextEncoder for SDXL 2023-08-23 11:05:38 +02:00
Cédric Deltheil 71ddb55a8e infer device and dtype in LoraAdapter 2023-08-22 11:55:39 +02:00
Benjamin Trom 8c7298f8cc fix chain slicing with structural copy 2023-08-22 11:44:11 +02:00
limiteinductive e7c1db50e0 turn CLIPTokenizer into a fl.Module 2023-08-22 00:09:01 +02:00
Cédric Deltheil 1ad4e1a35a converter: add missing structural_attrs 2023-08-21 16:04:12 +02:00
Cédric Deltheil b91a457495 use Converter layer for sinuosoidal embedding 2023-08-21 16:04:12 +02:00
limiteinductive 108fa8f26a add converter layer + tests 2023-08-21 12:09:58 +02:00
limiteinductive 4526d58cd5 update CTOR of CLIPTextEncoder with max_sequence_length 2023-08-21 11:21:12 +02:00
limiteinductive 6fd5894caf split PositionalTokenEncoder 2023-08-21 11:21:12 +02:00
limiteinductive 9d663534d1 cosmetic changes for text_encoder.py 2023-08-21 11:21:12 +02:00
limiteinductive b8e7179447 make clip g use quick gelu and pad_token_id 0 2023-08-17 17:31:15 +02:00
limiteinductive 6594502c11 parametrize tokenizer for text_encoder 2023-08-17 17:31:15 +02:00
limiteinductive 4575e3dd91 add start, end and pad tokens as parameter 2023-08-17 17:31:15 +02:00
limiteinductive 63fda2bfd8 add use_quick_gelu kwarg for CLIPTextEncoder 2023-08-17 17:31:15 +02:00
limiteinductive efe923a272 cosmetic changes 2023-08-17 17:31:15 +02:00
limiteinductive 17dc75421b make basic layers an enum and work with subtyping 2023-08-17 15:36:43 +02:00
limiteinductive 9da00e6fcf fix typing for informative drawings convert script 2023-08-17 14:44:45 +02:00
Pierre Chapuis 0fd46f9ec4 make type checking strict 2023-08-17 14:44:45 +02:00
Benjamin Trom 663d7c414e Update pyproject.toml
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2023-08-17 14:44:45 +02:00
Benjamin Trom 2ee094c18c Update scripts/convert-lora-weights.py
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2023-08-17 14:44:45 +02:00
limiteinductive c9fba44f39 fix typing for scripts 2023-08-17 14:44:45 +02:00
limiteinductive 89224c1e75 activate typing for all scripts 2023-08-17 14:44:45 +02:00
Pierre Chapuis 97b162d9a0 add InformativeDrawings
https://github.com/carolineec/informative-drawings

This is the preprocessor for the Lineart ControlNet.
2023-08-16 12:29:09 +02:00
Pierre Chapuis e10f761a84 GroupNorm and LayerNorm must be affine to be WeightedModules 2023-08-16 12:29:09 +02:00