Commit graph

574 commits

Author SHA1 Message Date
Benjamin Trom 282578ddc0 add Segment Anything (SAM) to foundational models
Note: dense prompts (i.e. masks) support is still partial (see MaskEncoder)

Co-authored-by: Cédric Deltheil <cedric@deltheil.me>
2023-09-21 11:44:30 +02:00
Cédric Deltheil 2faff9f57a ldm: properly resize non-square init image 2023-09-20 10:27:22 +02:00
Benjamin Trom 01aeaf3e36 add unit test for multi_diffusion 2023-09-19 15:30:50 +02:00
Benjamin Trom 85095418aa implement multi_diffusion for SD1 and SDXL 2023-09-19 15:30:50 +02:00
Benjamin Trom b86521da2f implement abstract MultiDiffusion class 2023-09-19 15:30:50 +02:00
Cédric Deltheil e319f13d05 utils: remove inplace opt-in from normalize 2023-09-18 18:07:20 +02:00
Cédric Deltheil bce3910383 utils: simplify normalize a bit 2023-09-18 18:07:20 +02:00
Cédric Deltheil d6046e1fbf move image tensor normalize under fluxion's utils 2023-09-18 18:07:20 +02:00
dnsbrl 91ac2353e7 Update README.md
- Added new sections ("adapter zoo", "awesome adaptation papers")
- Tweaked sections order
2023-09-18 15:08:11 +02:00
Benjamin Trom dc1fc239aa show an ellipsis when chain has been shortened because of depth and count siblings with same class name 2023-09-15 02:08:50 +02:00
Benjamin Trom 1cb798e8ae remove structural_attrs 2023-09-14 14:49:06 +02:00
Benjamin Trom 121ef4df39 add is_optimized option for attention 2023-09-14 14:12:27 +02:00
Pierre Chapuis fc2390ad1c fix legacy wording for refonly control 2023-09-14 11:21:11 +02:00
Pierre Chapuis 0e0c39b4b5 black 2023-09-13 17:02:47 +02:00
Pierre Chapuis eb88cde7ac document use of Poetry (main branch) instead of pip 2023-09-13 17:02:47 +02:00
Pierre Chapuis 0dfdd0d419 use extras instead of groups 2023-09-13 17:02:47 +02:00
Pierre Chapuis c421cfd56c add a test for IP-Adapter + ControlNet 2023-09-13 14:24:53 +02:00
Pierre Chapuis cf9efb57c8 remove useless torch.no_grad() contexts 2023-09-13 11:14:09 +02:00
Cédric Deltheil eea340c6c4 add support for SDXL IP-Adapter
This only supports the latest SDXL IP-Adapter release (2023.9.8) which
builds upon the ViT-H/14 CLIP image encoder.
2023-09-12 18:00:39 +02:00
Cédric Deltheil 1b4dcebe06 make scheduler an actual abstract base class 2023-09-12 16:47:47 +02:00
Cédric Deltheil 12e37f5d85 controlnet: replace Lambda w/ Slicing basic layer 2023-09-12 15:37:33 +02:00
Pierre Chapuis 7a32699cc6 add ensure_find and ensure_find_parent helpers 2023-09-12 14:19:10 +02:00
Pierre Chapuis b69dbc4e5c improve CrossAttentionAdapter test 2023-09-12 11:58:24 +02:00
Pierre Chapuis dc2c3e0163 implement CrossAttentionAdapter using chain operations 2023-09-12 11:58:24 +02:00
Pierre Chapuis 43075f60b0 do not use get_parameter_name in conversion script 2023-09-12 11:58:24 +02:00
Pierre Chapuis 3c056e2231 expose lookup_top_adapter 2023-09-12 11:58:24 +02:00
Cédric Deltheil f4e9707297 sdxl test: refreshed reference image
The former one was generated using SDXL 0.9 vs 1.0. The new one has been
generated with diffusers:

    import torch
    from diffusers import StableDiffusionXLPipeline, DDIMScheduler

    noise_scheduler = DDIMScheduler(
        num_train_timesteps=1000,
        beta_start=0.00085,
        beta_end=0.012,
        beta_schedule="scaled_linear",
        clip_sample=False,
        set_alpha_to_one=False,
        steps_offset=1,
    )

    base_model_path = "/path/to/stabilityai/stable-diffusion-xl-base-1.0"

    device = "cuda"
    prompt = "a cute cat, detailed high-quality professional image"
    negative_prompt = "lowres, bad anatomy, bad hands, cropped, worst quality"
    seed = 2

    pipe = StableDiffusionXLPipeline.from_pretrained(base_model_path, scheduler=noise_scheduler, torch_dtype=torch.float16, add_watermarker=False)
    pipe = pipe.to(device)
    generator = torch.Generator(device).manual_seed(seed)
    images = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=30, generator=generator).images
2023-09-12 10:59:26 +02:00
Cédric Deltheil 0e38928c8d sdxl test: add missing torch no_grad 2023-09-12 10:59:26 +02:00
Benjamin Trom b515c02867 add new basic layers and Matmul chain 2023-09-12 10:55:34 +02:00
Doryan Kaced 2f2510a9b1 Use bias correction on Prodigy 2023-09-12 10:44:05 +02:00
Cédric Deltheil 9364c0ea1c converters: get rid of default=True for --half 2023-09-11 21:49:24 +02:00
Cédric Deltheil 32cba1afd8 test_sdxl_double_encoder: use proper weights 2023-09-11 21:49:24 +02:00
Cédric Deltheil cc3b20320d make clip text converter support SDXL
i.e. convert the 2nd text encoder and save the final double text encoder
2023-09-11 21:49:24 +02:00
Pierre Chapuis be54cfc016 fix weight loading for float16 LoRAs 2023-09-11 16:14:19 +02:00
Pierre Chapuis dd0cca5855 use float32 reference for textual inversion (fixes tests on CPU) 2023-09-11 16:11:53 +02:00
Cédric Deltheil e5425e2968 make IP-Adapter generic for SD1 and SDXL 2023-09-08 16:38:01 +02:00
Cédric Deltheil 61858d9371 add CLIPImageEncoderG 2023-09-08 12:00:21 +02:00
Cédric Deltheil 946e7c2974 add threshold for clip image encoder conversion 2023-09-08 12:00:21 +02:00
Cédric Deltheil c6fadd1c81 deprecate bidirectional_mapping util 2023-09-07 18:43:20 +02:00
limiteinductive 2786117469 implement SDXL + e2e test on random init 2023-09-07 18:34:42 +02:00
limiteinductive 02af8e9f0b improve typing of ldm and sd1, introducing SD1Autoencoder class 2023-09-07 18:34:42 +02:00
Pierre Chapuis 78e69c7da0 fix typo + skip test if weights are not available 2023-09-07 17:31:20 +02:00
Benjamin Trom cf43cb191f Add better tree representation for fluxion Module 2023-09-07 16:33:24 +02:00
Pierre Chapuis d9a461e9b5 stop relying on SDXL 0.9 weights in test 2023-09-07 12:18:38 +02:00
Pierre Chapuis d54a38ae07 do not hardcode a CUDA device in tests 2023-09-06 19:33:48 +02:00
Cédric Deltheil c55917e293 add IP-Adapter support for SD 1.5
Official repo: https://github.com/tencent-ailab/IP-Adapter
2023-09-06 15:12:48 +02:00
Cédric Deltheil d4dd45fd4d use Module's load_from_safetensors
Instead of manual calls to load_state_dict
2023-09-06 15:06:51 +02:00
Pierre Chapuis 4388968ad3 Update tests/e2e/test_diffusion.py
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2023-09-06 11:49:55 +02:00
Pierre Chapuis 547a73e67a clarify the "adapting when a LoRA is injected" issue in tests 2023-09-06 11:49:55 +02:00
Pierre Chapuis 864937a776 support injecting several LoRAs simultaneously 2023-09-06 11:49:55 +02:00