1. 23 Oct, 2023 1 commit
    • Ryan Dick's avatar
      Make T2I-Adapter downscale padding match the UNet (#5435) · 0eac9cd0
      Ryan Dick authored
      
      
      * Update get_dummy_inputs(...) in T2I-Adapter tests to take image height and width as params.
      
      * Update the T2I-Adapter unit tests to run with the standard number of UNet down blocks so that all T2I-Adapter down blocks get exercised.
      
      * Update the T2I-Adapter down blocks to better match the padding behavior of the UNet.
      
      * Revert "Update the T2I-Adapter unit tests to run with the standard number of UNet down blocks so that all T2I-Adapter down blocks get exercised."
      
      This reverts commit 6d4a060a34415ec973a252944216f4fb8b9926cd.
      
      * Create  utility functions for testing the T2I-Adapter downscaling bahevior.
      
      * (minor) Improve readability with an intermediate named variable.
      
      * Statically parameterize  T2I-Adapter test dimensions rather than generating them dynamically.
      
      * Fix static checks.
      
      ---------
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      0eac9cd0
  2. 21 Oct, 2023 1 commit
  3. 20 Oct, 2023 2 commits
    • Vishnu V Jaddipal's avatar
      Added support to create asymmetrical U-Net structures (#5400) · 8dba1808
      Vishnu V Jaddipal authored
      
      
      * Added args, kwargs to ```U
      
      * Add UNetMidBlock2D as a supported mid block type
      
      * Fix extra init input for UNetMidBlock2D, change allowed types for Mid-block init
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_blocks.py
      
      * Update unet_2d_blocks.py
      
      * Update unet_2d_blocks.py
      
      * Update unet_2d_condition.py
      
      * Update unet_2d_blocks.py
      
      * Updated docstring, increased check strictness
      
      Updated the docstring for ```UNet2DConditionModel``` to include ```reverse_transformer_layers_per_block``` and updated checking for nested list type ```transformer_layers_per_block```
      
      * Add basic shape-check test for asymmetrical unets
      
      * Update src/diffusers/models/unet_2d_blocks.py
      
      Removed blank line
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * Update unet_2d_condition.py
      
      Remove blank space
      
      * Update unet_2d_condition.py
      
      Changed docstring for `mid_block_type`
      
      * Fixed docstring and wrong default value
      
      * Reformat with black
      
      * Reformat with necessary commands
      
      * Add UNetMidBlockFlat to versatile_diffusion/modeling_text_unet.py to ensure consistency
      
      * Removed args, kwargs, use on mid-block type
      
      * Make fix-copies
      
      * Update src/diffusers/models/unet_2d_condition.py
      
      Wrap into single line
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * make fix-copies
      
      ---------
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      8dba1808
    • kesimeg's avatar
      fix une2td ignoring class_labels (#5401) · 5366db5d
      kesimeg authored
      
      
      * fix une2td ignoring class_labels
      
      * unet2.py error message updated
      
      * style and quality changes
      
      ---------
      Co-authored-by: default avatarDhruv Nair <dhruv.nair@gmail.com>
      5366db5d
  4. 18 Oct, 2023 2 commits
    • Patrick von Platen's avatar
      make style · e5168588
      Patrick von Platen authored
      e5168588
    • Chi's avatar
      Beautiful Doc string added into the UNetMidBlock2D class. (#5389) · 36a0bacc
      Chi authored
      
      
      * I added a new doc string to the class. This is more flexible to understanding other developers what are doing and where it's using.
      
      * Update src/diffusers/models/unet_2d_blocks.py
      
      This changes suggest by maintener.
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * Update src/diffusers/models/unet_2d_blocks.py
      
      Add suggested text
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * Update unet_2d_blocks.py
      
      I changed the Parameter to Args text.
      
      * Update unet_2d_blocks.py
      
      proper indentation set in this file.
      
      * Update unet_2d_blocks.py
      
      a little bit of change in the act_fun argument line.
      
      * I run the black command to reformat style in the code
      
      * Update unet_2d_blocks.py
      
      similar doc-string add to have in the original diffusion repository.
      
      * Update unet_2d_blocks.py
      
      Added Beutifull doc-string into the UNetMidBlock2D class.
      
      * Update unet_2d_blocks.py
      
      I replaced the definition in this parameter resnet_time_scale_shift and resnet_groups.
      
      * Update unet_2d_blocks.py
      
      I remove additional sentences into the resnet_groups argument.
      
      * Update unet_2d_blocks.py
      
      I replaced my definition with the maintainer definition in the attention_head_dim parameter.
      
      * I am using black package for reformated my file
      
      ---------
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
      36a0bacc
  5. 16 Oct, 2023 2 commits
  6. 13 Oct, 2023 1 commit
  7. 11 Oct, 2023 4 commits
  8. 09 Oct, 2023 4 commits
  9. 06 Oct, 2023 1 commit
  10. 05 Oct, 2023 1 commit
    • Kadir Nar's avatar
      [Core] Add FreeU mechanism (#5164) · 84b82a6c
      Kadir Nar authored
      *  Added Fourier filter function to upsample blocks
      
      * 🔧 Update Fourier_filter for float16 support
      
      *  Added UNetFreeUConfig to UNet model for FreeU adaptation 🛠
      
      ️
      
      * move unet to its original form and add fourier_filter to torch_utils.
      
      * implement freeU enable mechanism
      
      * implement disable mechanism
      
      * resolution index.
      
      * correct resolution idx condition.
      
      * fix copies.
      
      * no need to use resolution_idx in vae.
      
      * spell out the kwargs
      
      * proper config property
      
      * fix attribution setting
      
      * place unet hasattr properly.
      
      * fix: attribute access.
      
      * proper disable
      
      * remove validation method.
      
      * debug
      
      * debug
      
      * debug
      
      * debug
      
      * debug
      
      * debug
      
      * potential fix.
      
      * add: doc.
      
      * fix copies
      
      * add: tests.
      
      * add: support freeU in SDXL.
      
      * set default value of resolution idx.
      
      * set default values for resolution_idx.
      
      * fix copies
      
      * fix rest.
      
      * fix copies
      
      * address PR comments.
      
      * run fix-copies
      
      * move apply_free_u to utils and other minors.
      
      * introduce support for video (unet3D)
      
      * minor ups
      
      * consistent fix-copies.
      
      * consistent stuff
      
      * fix-copies
      
      * add: rest
      
      * add: docs.
      
      * fix: tests
      
      * fix: doc path
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
      
      * style up
      
      * move to techniques.
      
      * add: slow test for sd freeu.
      
      * add: slow test for sd freeu.
      
      * add: slow test for sd freeu.
      
      * add: slow test for sd freeu.
      
      * add: slow test for sd freeu.
      
      * add: slow test for sd freeu.
      
      * add: slow test for video with freeu
      
      * add: slow test for video with freeu
      
      * add: slow test for video with freeu
      
      * style
      
      ---------
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
      84b82a6c
  11. 02 Oct, 2023 4 commits
  12. 29 Sep, 2023 1 commit
  13. 27 Sep, 2023 3 commits
  14. 26 Sep, 2023 3 commits
  15. 25 Sep, 2023 2 commits
  16. 22 Sep, 2023 2 commits
    • Pedro Cuenca's avatar
      SDXL flax (#4254) · 3651b14c
      Pedro Cuenca authored
      
      
      * support transformer_layers_per block in flax UNet
      
      * add support for text_time additional embeddings to Flax UNet
      
      * rename attention layers for VAE
      
      * add shape asserts when renaming attention layers
      
      * transpose VAE attention layers
      
      * add pipeline flax SDXL code [WIP]
      
      * continue add pipeline flax SDXL code [WIP]
      
      * cleanup
      
      * Working on JIT support
      
      Fixed prompt embedding shapes so they work in parallel mode. Assuming we
      always have both text encoders for now, for simplicity.
      
      * Fixing embeddings (untested)
      
      * Remove spurious line
      
      * Shard guidance_scale when jitting.
      
      * Decode images
      
      * Fix sharding
      
      * style
      
      * Refiner UNet can be loaded.
      
      * Refiner / img2img pipeline
      
      * Allow latent outputs from base and latent inputs in refiner
      
      This makes it possible to chain base + refiner without having to use the
      vae decoder in the base model, the vae encoder in the refiner, skipping
      conversions to/from PIL, and avoiding TPU <-> CPU memory copies.
      
      * Adapt to FlaxCLIPTextModelOutput
      
      * Update Flax XL pipeline to FlaxCLIPTextModelOutput
      
      * make fix-copies
      
      * make style
      
      * add euler scheduler
      
      * Fix import
      
      * Fix copies, comment unused code.
      
      * Fix SDXL Flax imports
      
      * Fix euler discrete begin
      
      * improve init import
      
      * finish
      
      * put discrete euler in init
      
      * fix flax euler
      
      * Fix more
      
      * make style
      
      * correct init
      
      * correct init
      
      * Temporarily remove FlaxStableDiffusionXLImg2ImgPipeline
      
      * correct pipelines
      
      * finish
      
      ---------
      Co-authored-by: default avatarMartin Müller <martin.muller.me@gmail.com>
      Co-authored-by: default avatarpatil-suraj <surajp815@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      3651b14c
    • Younes Belkada's avatar
      [`PEFT` / `LoRA`] PEFT integration - text encoder (#5058) · 493f9529
      Younes Belkada authored
      
      
      * more fixes
      
      * up
      
      * up
      
      * style
      
      * add in setup
      
      * oops
      
      * more changes
      
      * v1 rzfactor CI
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * few todos
      
      * protect torch import
      
      * style
      
      * fix fuse text encoder
      
      * Update src/diffusers/loaders.py
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * replace with `recurse_replace_peft_layers`
      
      * keep old modules for BC
      
      * adjustments on `adjust_lora_scale_text_encoder`
      
      * nit
      
      * move tests
      
      * add conversion utils
      
      * remove unneeded methods
      
      * use class method instead
      
      * oops
      
      * use `base_version`
      
      * fix examples
      
      * fix CI
      
      * fix weird error with python 3.8
      
      * fix
      
      * better fix
      
      * style
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * add comment
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      * conv2d support for recurse remove
      
      * added docstrings
      
      * more docstring
      
      * add deprecate
      
      * revert
      
      * try to fix merge conflicts
      
      * v1 tests
      
      * add new decorator
      
      * add saving utilities test
      
      * adapt tests a bit
      
      * add save / from_pretrained tests
      
      * add saving tests
      
      * add scale tests
      
      * fix deps tests
      
      * fix lora CI
      
      * fix tests
      
      * add comment
      
      * fix
      
      * style
      
      * add slow tests
      
      * slow tests pass
      
      * style
      
      * Update src/diffusers/utils/import_utils.py
      Co-authored-by: default avatarBenjamin Bossan <BenjaminBossan@users.noreply.github.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarBenjamin Bossan <BenjaminBossan@users.noreply.github.com>
      
      * circumvents pattern finding issue
      
      * left a todo
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * update hub path
      
      * add lora workflow
      
      * fix
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarBenjamin Bossan <BenjaminBossan@users.noreply.github.com>
      493f9529
  17. 20 Sep, 2023 1 commit
    • Sayak Paul's avatar
      [LoRA] support LyCORIS (#5102) · e312b230
      Sayak Paul authored
      * better condition.
      
      * debugging
      
      * how about now?
      
      * how about now?
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * debugging
      
      * support for lycoris.
      
      * style
      
      * add: lycoris test
      
      * fix from_pretrained call.
      
      * fix assertion values.
      e312b230
  18. 18 Sep, 2023 2 commits
    • Will Berman's avatar
      t2i Adapter community member fix (#5090) · 6d7279ad
      Will Berman authored
      
      
      * convert tensorrt controlnet
      
      * Fix code quality
      
      * Fix code quality
      
      * Fix code quality
      
      * Fix code quality
      
      * Fix code quality
      
      * Fix code quality
      
      * Fix number controlnet condition
      
      * Add convert SD XL to onnx
      
      * Add convert SD XL to tensorrt
      
      * Add convert SD XL to tensorrt
      
      * Add examples in comments
      
      * Add examples in comments
      
      * Add test onnx controlnet
      
      * Add tensorrt test
      
      * Remove copied
      
      * Move file test to examples/community
      
      * Remove script
      
      * Remove script
      
      * Remove text
      
      * Fix import
      
      * Fix T2I MultiAdapter
      
      * fix tests
      
      ---------
      Co-authored-by: default avatardotieuthien <thien.do@mservice.com.vn>
      Co-authored-by: default avatardotieuthien <dotieuthien9997@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatardotieuthien <hades@cinnamon.is>
      6d7279ad
    • Ruoxi's avatar
      Implement `CustomDiffusionAttnProcessor2_0`. (#4604) · 16b9a57d
      Ruoxi authored
      * Implement `CustomDiffusionAttnProcessor2_0`
      
      * Doc-strings and type annotations for `CustomDiffusionAttnProcessor2_0`. (#1)
      
      * Update attnprocessor.md
      
      * Update attention_processor.py
      
      * Interops for `CustomDiffusionAttnProcessor2_0`.
      
      * Formatted `attention_processor.py`.
      
      * Formatted doc-string in `attention_processor.py`
      
      * Conditional CustomDiffusion2_0 for training example.
      
      * Remove unnecessary reference impl in comments.
      
      * Fix `save_attn_procs`.
      16b9a57d
  19. 16 Sep, 2023 1 commit
  20. 15 Sep, 2023 2 commits