1. 17 Apr, 2025 2 commits
  2. 16 Apr, 2025 1 commit
  3. 15 Apr, 2025 1 commit
    • Hameer Abbasi's avatar
      [LoRA] Add LoRA support to AuraFlow (#10216) · 9352a5ca
      Hameer Abbasi authored
      
      
      * Add AuraFlowLoraLoaderMixin
      
      * Add comments, remove qkv fusion
      
      * Add Tests
      
      * Add AuraFlowLoraLoaderMixin to documentation
      
      * Add Suggested changes
      
      * Change attention_kwargs->joint_attention_kwargs
      
      * Rebasing derp.
      
      * fix
      
      * fix
      
      * Quality fixes.
      
      * make style
      
      * `make fix-copies`
      
      * `ruff check --fix`
      
      * Attept 1 to fix tests.
      
      * Attept 2 to fix tests.
      
      * Attept 3 to fix tests.
      
      * Address review comments.
      
      * Rebasing derp.
      
      * Get more tests passing by copying from Flux. Address review comments.
      
      * `joint_attention_kwargs`->`attention_kwargs`
      
      * Add `lora_scale` property for te LoRAs.
      
      * Make test better.
      
      * Remove useless property.
      
      * Skip TE-only tests for AuraFlow.
      
      * Support LoRA for non-CLIP TEs.
      
      * Restore LoRA tests.
      
      * Undo adding LoRA support for non-CLIP TEs.
      
      * Undo support for TE in AuraFlow LoRA.
      
      * `make fix-copies`
      
      * Sync with upstream changes.
      
      * Remove unneeded stuff.
      
      * Mirror `Lumina2`.
      
      * Skip for MPS.
      
      * Address review comments.
      
      * Remove duplicated code.
      
      * Remove unnecessary code.
      
      * Remove repeated docs.
      
      * Propagate attention.
      
      * Fix TE target modules.
      
      * MPS fix for LoRA tests.
      
      * Unrelated TE LoRA tests fix.
      
      * Fix AuraFlow LoRA tests by applying to the right denoiser layers.
      Co-authored-by: default avatarAstraliteHeart <81396681+AstraliteHeart@users.noreply.github.com>
      
      * Apply style fixes
      
      * empty commit
      
      * Fix the repo consistency issues.
      
      * Remove unrelated changes.
      
      * Style.
      
      * Fix `test_lora_fuse_nan`.
      
      * fix quality issues.
      
      * `pytest.xfail` -> `ValueError`.
      
      * Add back `skip_mps`.
      
      * Apply style fixes
      
      * `make fix-copies`
      
      ---------
      Co-authored-by: default avatarWarlord-K <warlordk28@gmail.com>
      Co-authored-by: default avatarhlky <hlky@hlky.ac>
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarAstraliteHeart <81396681+AstraliteHeart@users.noreply.github.com>
      Co-authored-by: default avatargithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
      9352a5ca
  4. 13 Apr, 2025 2 commits
    • Ishan Modi's avatar
      [ControlNet] Adds controlnet for SanaTransformer (#11040) · f1f38ffb
      Ishan Modi authored
      
      
      * added controlnet for sana transformer
      
      * improve code quality
      
      * addressed PR comments
      
      * bug fixes
      
      * added test cases
      
      * update
      
      * added dummy objects
      
      * addressed PR comments
      
      * update
      
      * Forcing update
      
      * add to docs
      
      * code quality
      
      * addressed PR comments
      
      * addressed PR comments
      
      * update
      
      * addressed PR comments
      
      * added proper styling
      
      * update
      
      * Revert "added proper styling"
      
      This reverts commit 344ee8a7014ada095b295034ef84341f03b0e359.
      
      * manually ordered
      
      * Apply suggestions from code review
      
      ---------
      Co-authored-by: default avatarAryan <contact.aryanvs@gmail.com>
      f1f38ffb
    • Adrien B's avatar
      Update autoencoderkl_allegro.md (#11303) · ed41db85
      Adrien B authored
      Correction typo
      ed41db85
  5. 11 Apr, 2025 1 commit
  6. 09 Apr, 2025 2 commits
  7. 08 Apr, 2025 1 commit
  8. 04 Apr, 2025 1 commit
    • Tolga Cangöz's avatar
      [LTX0.9.5] Refactor `LTXConditionPipeline` for text-only conditioning (#11174) · 13e48492
      Tolga Cangöz authored
      * Refactor `LTXConditionPipeline` to add text-only conditioning
      
      * style
      
      * up
      
      * Refactor `LTXConditionPipeline` to streamline condition handling and improve clarity
      
      * Improve condition checks
      
      * Simplify latents handling based on conditioning type
      
      * Refactor rope_interpolation_scale preparation for clarity and efficiency
      
      * Update LTXConditionPipeline docstring to clarify supported input types
      
      * Add LTX Video 0.9.5 model to documentation
      
      * Clarify documentation to indicate support for text-only conditioning without passing `conditions`
      
      * refactor: comment out unused parameters in LTXConditionPipeline
      
      * fix: restore previously commented parameters in LTXConditionPipeline
      
      * fix: remove unused parameters from LTXConditionPipeline
      
      * refactor: remove unnecessary lines in LTXConditionPipeline
      13e48492
  9. 01 Apr, 2025 1 commit
    • Dhruv Nair's avatar
      [WIP] Add Wan Video2Video (#11053) · df1d7b01
      Dhruv Nair authored
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      
      * update
      df1d7b01
  10. 28 Mar, 2025 1 commit
  11. 24 Mar, 2025 1 commit
    • Aryan's avatar
      New HunyuanVideo-I2V (#11066) · 8907a70a
      Aryan authored
      * update
      
      * update
      
      * update
      
      * add tests
      
      * update docs
      
      * raise value error
      
      * warning for true cfg and guidance scale
      
      * fix test
      8907a70a
  12. 21 Mar, 2025 2 commits
  13. 18 Mar, 2025 1 commit
  14. 13 Mar, 2025 1 commit
  15. 11 Mar, 2025 1 commit
  16. 10 Mar, 2025 1 commit
  17. 07 Mar, 2025 2 commits
  18. 03 Mar, 2025 1 commit
  19. 02 Mar, 2025 1 commit
  20. 26 Feb, 2025 1 commit
  21. 24 Feb, 2025 2 commits
  22. 22 Feb, 2025 1 commit
  23. 21 Feb, 2025 2 commits
  24. 20 Feb, 2025 3 commits
  25. 18 Feb, 2025 1 commit
  26. 15 Feb, 2025 1 commit
    • Yuxuan Zhang's avatar
      CogView4 (supports different length c and uc) (#10649) · d90cd362
      Yuxuan Zhang authored
      
      
      * init
      
      * encode with glm
      
      * draft schedule
      
      * feat(scheduler): Add CogView scheduler implementation
      
      * feat(embeddings): add CogView 2D rotary positional embedding
      
      * 1
      
      * Update pipeline_cogview4.py
      
      * fix the timestep init and sigma
      
      * update latent
      
      * draft patch(not work)
      
      * fix
      
      * [WIP][cogview4]: implement initial CogView4 pipeline
      
      Implement the basic CogView4 pipeline structure with the following changes:
      - Add CogView4 pipeline implementation
      - Implement DDIM scheduler for CogView4
      - Add CogView3Plus transformer architecture
      - Update embedding models
      
      Current limitations:
      - CFG implementation uses padding for sequence length alignment
      - Need to verify transformer inference alignment with Megatron
      
      TODO:
      - Consider separate forward passes for condition/uncondition
        instead of padding approach
      
      * [WIP][cogview4][refactor]: Split condition/uncondition forward pass in CogView4 pipeline
      
      Split the forward pass for conditional and unconditional predictions in the CogView4 pipeline to match the original implementation. The noise prediction is now done separately for each case before combining them for guidance. However, the results still need improvement.
      
      This is a work in progress as the generated images are not yet matching expected quality.
      
      * use with -2 hidden state
      
      * remove text_projector
      
      * 1
      
      * [WIP] Add tensor-reload to align input from transformer block
      
      * [WIP] for older glm
      
      * use with cogview4 transformers forward twice of u and uc
      
      * Update convert_cogview4_to_diffusers.py
      
      * remove this
      
      * use main example
      
      * change back
      
      * reset
      
      * setback
      
      * back
      
      * back 4
      
      * Fix qkv conversion logic for CogView4 to Diffusers format
      
      * back5
      
      * revert to sat to cogview4 version
      
      * update a new convert from megatron
      
      * [WIP][cogview4]: implement CogView4 attention processor
      
      Add CogView4AttnProcessor class for implementing scaled dot-product attention
      with rotary embeddings for the CogVideoX model. This processor concatenates
      encoder and hidden states, applies QKV projections and RoPE, but does not
      include spatial normalization.
      
      TODO:
      - Fix incorrect QKV projection weights
      - Resolve ~25% error in RoPE implementation compared to Megatron
      
      * [cogview4] implement CogView4 transformer block
      
      Implement CogView4 transformer block following the Megatron architecture:
      - Add multi-modulate and multi-gate mechanisms for adaptive layer normalization
      - Implement dual-stream attention with encoder-decoder structure
      - Add feed-forward network with GELU activation
      - Support rotary position embeddings for image tokens
      
      The implementation follows the original CogView4 architecture while adapting
      it to work within the diffusers framework.
      
      * with new attn
      
      * [bugfix] fix dimension mismatch in CogView4 attention
      
      * [cogview4][WIP]: update final normalization in CogView4 transformer
      
      Refactored the final normalization layer in CogView4 transformer to use separate layernorm and AdaLN operations instead of combined AdaLayerNormContinuous. This matches the original implementation but needs validation.
      
      Needs verification against reference implementation.
      
      * 1
      
      * put back
      
      * Update transformer_cogview4.py
      
      * change time_shift
      
      * Update pipeline_cogview4.py
      
      * change timesteps
      
      * fix
      
      * change text_encoder_id
      
      * [cogview4][rope] align RoPE implementation with Megatron
      
      - Implement apply_rope method in attention processor to match Megatron's implementation
      - Update position embeddings to ensure compatibility with Megatron-style rotary embeddings
      - Ensure consistent rotary position encoding across attention layers
      
      This change improves compatibility with Megatron-based models and provides
      better alignment with the original implementation's positional encoding approach.
      
      * [cogview4][bugfix] apply silu activation to time embeddings in CogView4
      
      Applied silu activation to time embeddings before splitting into conditional
      and unconditional parts in CogView4Transformer2DModel. This matches the
      original implementation and helps ensure correct time conditioning behavior.
      
      * [cogview4][chore] clean up pipeline code
      
      - Remove commented out code and debug statements
      - Remove unused retrieve_timesteps function
      - Clean up code formatting and documentation
      
      This commit focuses on code cleanup in the CogView4 pipeline implementation, removing unnecessary commented code and improving readability without changing functionality.
      
      * [cogview4][scheduler] Implement CogView4 scheduler and pipeline
      
      * now It work
      
      * add timestep
      
      * batch
      
      * change convert scipt
      
      * refactor pt. 1; make style
      
      * refactor pt. 2
      
      * refactor pt. 3
      
      * add tests
      
      * make fix-copies
      
      * update toctree.yml
      
      * use flow match scheduler instead of custom
      
      * remove scheduling_cogview.py
      
      * add tiktoken to test dependencies
      
      * Update src/diffusers/models/embeddings.py
      Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
      
      * apply suggestions from review
      
      * use diffusers apply_rotary_emb
      
      * update flow match scheduler to accept timesteps
      
      * fix comment
      
      * apply review sugestions
      
      * Update src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py
      Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
      
      ---------
      Co-authored-by: default avatar三洋三洋 <1258009915@qq.com>
      Co-authored-by: default avatarOleehyO <leehy0357@gmail.com>
      Co-authored-by: default avatarAryan <aryan@huggingface.co>
      Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
      d90cd362
  27. 14 Feb, 2025 1 commit
    • Aryan's avatar
      Module Group Offloading (#10503) · 9a147b82
      Aryan authored
      
      
      * update
      
      * fix
      
      * non_blocking; handle parameters and buffers
      
      * update
      
      * Group offloading with cuda stream prefetching (#10516)
      
      * cuda stream prefetch
      
      * remove breakpoints
      
      * update
      
      * copy model hook implementation from pab
      
      * update; ~very workaround based implementation but it seems to work as expected; needs cleanup and rewrite
      
      * more workarounds to make it actually work
      
      * cleanup
      
      * rewrite
      
      * update
      
      * make sure to sync current stream before overwriting with pinned params
      
      not doing so will lead to erroneous computations on the GPU and cause bad results
      
      * better check
      
      * update
      
      * remove hook implementation to not deal with merge conflict
      
      * re-add hook changes
      
      * why use more memory when less memory do trick
      
      * why still use slightly more memory when less memory do trick
      
      * optimise
      
      * add model tests
      
      * add pipeline tests
      
      * update docs
      
      * add layernorm and groupnorm
      
      * address review comments
      
      * improve tests; add docs
      
      * improve docs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
      
      * apply suggestions from code review
      
      * update tests
      
      * apply suggestions from review
      
      * enable_group_offloading -> enable_group_offload for naming consistency
      
      * raise errors if multiple offloading strategies used; add relevant tests
      
      * handle .to() when group offload applied
      
      * refactor some repeated code
      
      * remove unintentional change from merge conflict
      
      * handle .cuda()
      
      ---------
      Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
      9a147b82
  28. 12 Feb, 2025 2 commits
  29. 11 Feb, 2025 2 commits