Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented Mar 21, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Fixes a bug where some LoRA modules for CLIP Text Encoder were not trained, and adds support for CLIPSdpaAttention module in LoRA networks.

Bug Fixes:

  • Fixes a bug where some of LoRA modules for CLIP Text Encoder were not trained. The LoRA modules for CLIP Text Encoder are now 264 modules, which is the same as before. Only 88 modules were trained in the previous version. Thank you Nekotekina for PR #1964

Enhancements:

  • Adds support for CLIPSdpaAttention module in LoRA networks.

Nekotekina and others added 3 commits March 1, 2025 20:35
Should fix #1952
I added alternative name for CLIPAttention.
I have no idea why this name changed.
Now it should accept both names.
Fix missing text encoder attn modules
@pull pull bot added the ⤵️ pull label Mar 21, 2025
@pull pull bot merged commit 8f4ee8f into admariner:main Mar 21, 2025
Copy link

sourcery-ai bot commented Mar 21, 2025

Reviewer's Guide by Sourcery

This pull request includes a bug fix for LoRA training and adds support for CLIPSdpaAttention in several LoRA network modules. The bug fix ensures that all LoRA modules for the CLIP Text Encoder are properly trained, while the added support enhances the compatibility of LoRA with different attention mechanisms.

Updated class diagram for LoRANetwork

classDiagram
    class LoRANetwork {
        UNET_TARGET_REPLACE_MODULE
        UNET_TARGET_REPLACE_MODULE_CONV2D_3X3
        TEXT_ENCODER_TARGET_REPLACE_MODULE
        LORA_PREFIX_UNET
        LORA_PREFIX_TEXT_ENCODER
    }
    note for LoRANetwork "TEXT_ENCODER_TARGET_REPLACE_MODULE now includes CLIPSdpaAttention"
Loading

Updated class diagram for DyLoRANetwork

classDiagram
    class DyLoRANetwork {
        UNET_TARGET_REPLACE_MODULE
        UNET_TARGET_REPLACE_MODULE_CONV2D_3X3
        TEXT_ENCODER_TARGET_REPLACE_MODULE
        LORA_PREFIX_UNET
        LORA_PREFIX_TEXT_ENCODER
    }
    note for DyLoRANetwork "TEXT_ENCODER_TARGET_REPLACE_MODULE now includes CLIPSdpaAttention"
Loading

File-Level Changes

Change Details Files
Fixed a bug where some LoRA modules for CLIP Text Encoder were not being trained.
  • Ensured all 264 LoRA modules for CLIP Text Encoder are trained.
  • Addressed issue where only 88 modules were trained in the previous version.
README.md
Added CLIPSdpaAttention to the target replace modules for the text encoder in multiple LoRA network implementations.
  • Included CLIPSdpaAttention in the TEXT_ENCODER_TARGET_REPLACE_MODULE list.
  • Updated the target replace modules in DyLoRANetwork.
  • Updated the target replace modules in LoRANetwork.
  • Updated the target replace modules in LoRANetwork for diffusers.
  • Updated the target replace modules in LoRANetwork for fa.
networks/dylora.py
networks/lora.py
networks/lora_diffusers.py
networks/lora_fa.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants