diffusers
493f9529 - [`PEFT` / `LoRA`] PEFT integration - text encoder (#5058)

Commit
1 year ago
[`PEFT` / `LoRA`] PEFT integration - text encoder (#5058) * more fixes * up * up * style * add in setup * oops * more changes * v1 rzfactor CI * Apply suggestions from code review Co-authored-by: Patrick 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: Sayak 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: Sayak Paul <spsayakpaul@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Apply suggestions from code review Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * add comment * Apply suggestions from code review Co-authored-by: Sayak 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: Benjamin Bossan <BenjaminBossan@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com> * circumvents pattern finding issue * left a todo * Apply suggestions from code review Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * update hub path * add lora workflow * fix --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Author
Parents
  • .github/workflows
    • File
      pr_test_peft_backend.yml
  • src/diffusers
    • File
      loaders.py
    • models
      • File
        lora.py
    • pipelines
      • alt_diffusion
        • File
          pipeline_alt_diffusion.py
        • File
          pipeline_alt_diffusion_img2img.py
      • controlnet
        • File
          pipeline_controlnet.py
        • File
          pipeline_controlnet_img2img.py
        • File
          pipeline_controlnet_inpaint.py
        • File
          pipeline_controlnet_inpaint_sd_xl.py
        • File
          pipeline_controlnet_sd_xl.py
        • File
          pipeline_controlnet_sd_xl_img2img.py
      • stable_diffusion
        • File
          pipeline_cycle_diffusion.py
        • File
          pipeline_stable_diffusion.py
        • File
          pipeline_stable_diffusion_attend_and_excite.py
        • File
          pipeline_stable_diffusion_depth2img.py
        • File
          pipeline_stable_diffusion_diffedit.py
        • File
          pipeline_stable_diffusion_gligen.py
        • File
          pipeline_stable_diffusion_gligen_text_image.py
        • File
          pipeline_stable_diffusion_img2img.py
        • File
          pipeline_stable_diffusion_inpaint.py
        • File
          pipeline_stable_diffusion_inpaint_legacy.py
        • File
          pipeline_stable_diffusion_k_diffusion.py
        • File
          pipeline_stable_diffusion_ldm3d.py
        • File
          pipeline_stable_diffusion_model_editing.py
        • File
          pipeline_stable_diffusion_panorama.py
        • File
          pipeline_stable_diffusion_paradigms.py
        • File
          pipeline_stable_diffusion_pix2pix_zero.py
        • File
          pipeline_stable_diffusion_sag.py
        • File
          pipeline_stable_diffusion_upscale.py
        • File
          pipeline_stable_unclip.py
        • File
          pipeline_stable_unclip_img2img.py
      • stable_diffusion_xl
        • File
          pipeline_stable_diffusion_xl.py
        • File
          pipeline_stable_diffusion_xl_img2img.py
        • File
          pipeline_stable_diffusion_xl_inpaint.py
        • File
          pipeline_stable_diffusion_xl_instruct_pix2pix.py
      • t2i_adapter
        • File
          pipeline_stable_diffusion_adapter.py
        • File
          pipeline_stable_diffusion_xl_adapter.py
      • text_to_video_synthesis
        • File
          pipeline_text_to_video_synth.py
        • File
          pipeline_text_to_video_synth_img2img.py
    • utils
      • File
        __init__.py
      • File
        import_utils.py
      • File
        peft_utils.py
      • File
        state_dict_utils.py
      • File
        testing_utils.py
  • tests/lora
    • File
      test_lora_layers_old_backend.py
    • File
      test_lora_layers_peft.py