1. 01 Dec, 2025 1 commit
  2. 14 Nov, 2025 1 commit
    • David El Malih's avatar
      Improve docstrings and type hints in scheduling_euler_discrete.py (#12654) · 63dd6017
      David El Malih authored
      * refactor: enhance type hints and documentation in EulerDiscreteScheduler
      
      Updated type hints for function parameters and return types in the EulerDiscreteScheduler class to improve code clarity and maintainability. Enhanced docstrings for several methods to provide clearer descriptions of their functionality and expected arguments. This includes specifying Literal types for certain parameters and ensuring consistent return type annotations across the class.
      
      * refactor: enhance type hints and documentation across multiple schedulers
      
      Updated type hints and improved docstrings in various scheduler classes, including CMStochasticIterativeScheduler, CosineDPMSolverMultistepScheduler, and others. This includes specifying parameter types, return types, and providing clearer descriptions of method functionalities. Notable changes include the addition of default values in the begin_index argument and enhanced explanations for noise addition methods. These improvements aim to enhance code clarity and maintainability across the scheduling module.
      
      * refactor: update docstrings to clarify noise schedule construction
      
      Revised docstrings across multiple scheduler classes to enhance clarity regarding the construction of noise schedules. Updated references to relevant papers, ensuring accurate citations for the methodologies used. This includes changes in DEISMultistepScheduler, DPMSolverMultistepInverseScheduler, and others, improving documentation consistency and readability.
      63dd6017
  3. 13 Nov, 2025 2 commits
    • David El Malih's avatar
      Improve docstrings and type hints in scheduling_ddpm.py (#12651) · 3c1ca869
      David El Malih authored
      * Enhance type hints and docstrings in scheduling_ddpm.py
      
      - Added type hints for function parameters and return types across the DDPMScheduler class and related functions.
      - Improved docstrings for clarity, including detailed descriptions of parameters and return values.
      - Updated the alpha_transform_type and beta_schedule parameters to use Literal types for better type safety.
      - Refined the _get_variance and previous_timestep methods with comprehensive documentation.
      
      * Refactor docstrings and type hints in scheduling_ddpm.py
      
      - Cleaned up whitespace in the rescale_zero_terminal_snr function.
      - Enhanced the variance_type parameter in the DDPMScheduler class with improved formatting for better readability.
      - Updated the docstring for the compute_variance method to maintain consistency and clarity in parameter descriptions and return values.
      
      * Apply `make fix-copies`
      
      * Refactor type hints across multiple scheduler files
      
      - Updated type hints to include `Literal` for improved type safety in various scheduling files.
      - Ensured consistency in type hinting for parameters and return types across the affected modules.
      - This change enhances code clarity and maintainability.
      3c1ca869
    • David El Malih's avatar
      Improve docstrings and type hints in scheduling_ddim.py (#12622) · 6fe4a6ff
      David El Malih authored
      * Improve docstrings and type hints in scheduling_ddim.py
      
      - Add complete type hints for all function parameters
      - Enhance docstrings to follow project conventions
      - Add missing parameter descriptions
      
      Fixes #9567
      
      * Enhance docstrings and type hints in scheduling_ddim.py
      
      - Update parameter types and descriptions for clarity
      - Improve explanations in method docstrings to align with project standards
      - Add optional annotations for parameters where applicable
      
      * Refine type hints and docstrings in scheduling_ddim.py
      
      - Update parameter types to use Literal for specific string options
      - Enhance docstring descriptions for clarity and consistency
      - Ensure all parameters have appropriate type annotations and defaults
      
      * Apply review feedback on scheduling_ddim.py
      
      - Replace "prevent singularities" with "avoid numerical instability" for better clarity
      - Add backticks around `alpha_bar` variable name for consistent formatting
      - Convert Imagen Video paper URLs to Hugging Face papers references
      
      * Propagate changes using 'make fix-copies'
      
      * Add missing Literal
      6fe4a6ff
  4. 19 Jun, 2025 1 commit
  5. 19 May, 2025 1 commit
  6. 11 Jan, 2025 1 commit
    • andreabosisio's avatar
      Typo fix in the table number of a referenced paper (#10528) · 1b0fe636
      andreabosisio authored
      Correcting a typo in the table number of a referenced paper (in scheduling_ddim_inverse.py)
      
      Changed the number of the referenced table from 1 to 2 in a comment of the set_timesteps() method of the DDIMInverseScheduler class (also according to the description of the 'timestep_spacing' attribute of its __init__ method).
      1b0fe636
  7. 24 May, 2024 1 commit
  8. 10 May, 2024 1 commit
    • Mark Van Aken's avatar
      #7535 Update FloatTensor type hints to Tensor (#7883) · be4afa0b
      Mark Van Aken authored
      * find & replace all FloatTensors to Tensor
      
      * apply formatting
      
      * Update torch.FloatTensor to torch.Tensor in the remaining files
      
      * formatting
      
      * Fix the rest of the places where FloatTensor is used as well as in documentation
      
      * formatting
      
      * Update new file from FloatTensor to Tensor
      be4afa0b
  9. 18 Mar, 2024 1 commit
    • M. Tolga Cangöz's avatar
      Fix Typos (#7325) · 6a05b274
      M. Tolga Cangöz authored
      * Fix PyTorch's convention for inplace functions
      
      * Fix import structure in __init__.py and update config loading logic in test_config.py
      
      * Update configuration access
      
      * Fix typos
      
      * Trim trailing white spaces
      
      * Fix typo in logger name
      
      * Revert "Fix PyTorch's convention for inplace functions"
      
      This reverts commit f65dc4afcb57ceb43d5d06389229d47bafb10d2d.
      
      * Fix typo in step_index property description
      
      * Revert "Update configuration access"
      
      This reverts commit 8d44e870b8c1ad08802e3e904c34baeca1b598f8.
      
      * Revert "Fix import structure in __init__.py and update config loading logic in test_config.py"
      
      This reverts commit 2ad5e8bca25aede3b912da22bd57285b598fe171.
      
      * Fix typos
      
      * Fix typos
      
      * Fix typos
      
      * Fix a typo: tranform -> transform
      6a05b274
  10. 14 Mar, 2024 1 commit
  11. 08 Feb, 2024 1 commit
  12. 26 Dec, 2023 1 commit
  13. 20 Nov, 2023 1 commit
  14. 29 Sep, 2023 2 commits
  15. 09 Aug, 2023 1 commit
    • Steven Liu's avatar
      [docs] Clean scheduler api (#4204) · 16ad13b6
      Steven Liu authored
      * clean scheduler mixin
      
      * up to dpmsolvermultistep
      
      * finish cleaning
      
      * first draft
      
      * fix overview table
      
      * apply feedback
      
      * update reference code
      16ad13b6
  16. 18 Jul, 2023 1 commit
    • clarencechen's avatar
      Add Recent Timestep Scheduling Improvements to DDIM Inverse Scheduler (#3865) · c6e56e92
      clarencechen authored
      * Add Recent Timestep Scheduling Improvements to DDIM Inverse Scheduler
      
      Roll timesteps by one to reflect origin-destination semantic discrepancy
      
      Restore `set_alpha_to_one` option to handle negative initial timesteps
      
      Remove `set_alpha_to_zero` option not used due to previous truncation
      
      * Bugfix
      
      * Remove unnecessary calls to `detach()`
      
      Use `self.image_processor.preprocess` in DiffEdit pipeline functions
      
      * Preprocess list input for inverted image latents in diffedit pipeline
      
      * Add `timestep_spacing` and `steps_offset` to `DPMSolverMultistepInverseScheduler`
      
      * Update expected test results to account for inverting last forward diffusion step
      
      * Fix inversion progress bar bug
      
      * Add first draft for proper fast tests for DDIMInverseScheduler
      
      * Add deprecated DDIMInverseScheduler kwarg to ConfigMixer registry
      
      * Fix test failure in DPMMultistepInverseScheduler
      
      Invert step specification leads to negative noise variance in SDE-based algs
      
      Add first draft for proper fast tests for DPMMultistepInverseScheduler
      
      * Update expected test results to account for inverting last forward diffusion step
      
      Clean up diffedit fast test
      c6e56e92
  17. 06 Jul, 2023 1 commit
    • YiYi Xu's avatar
      Add Shap-E (#3742) · 45f6d52b
      YiYi Xu authored
      
      
      * refactor prior_transformer
      
      adding conversion script
      
      add pipeline
      
      add step_index from pipeline, + remove permute
      
      add zero pad token
      
      remove copy from statement for betas_for_alpha_bar function
      
      * add
      
      * add
      
      * update conversion script for renderer model
      
      * refactor camera a little bit
      
      * clean up
      
      * style
      
      * fix copies
      
      * Update src/diffusers/schedulers/scheduling_heun_discrete.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * alpha_transform_type
      
      * remove step_index argument
      
      * remove get_sigmas_karras
      
      * remove _yiyi_sigma_to_t
      
      * move the rescale prompt_embeds from prior_transformer to pipeline
      
      * replace baddbmm with einsum to match origial repo
      
      * Revert "replace baddbmm with einsum to match origial repo"
      
      This reverts commit 3f6b435d65dad3e5514cad2f5dd9e4419ca78e0b.
      
      * add step_index to scale_model_input
      
      * Revert "move the rescale prompt_embeds from prior_transformer to pipeline"
      
      This reverts commit 5b5a8e6be918fefd114a2945ed89d8e8fa8be21b.
      
      * move rescale from prior_transformer to pipeline
      
      * correct step_index in scale_model_input
      
      * remove print lines
      
      * refactor prior - reduce arguments
      
      * make style
      
      * add prior_image
      
      * arg embedding_proj_norm -> norm_embedding_proj
      
      * add pre-norm for proj_embedding
      
      * move rescale prompt from pipeline to _encode_prompt
      
      * add img2img pipeline
      
      * style
      
      * copies
      
      * Update src/diffusers/models/prior_transformer.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      
      add arg: encoder_hid_proj
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      
      add new config: norm_in_type
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      
      add new config: added_emb_type
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      
      rename out_dim -> clip_embed_dim
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      
      rename config: out_dim -> clip_embed_dim
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/models/prior_transformer.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * finish refactor prior_tranformer
      
      * make style
      
      * refactor renderer
      
      * fix
      
      * make style
      
      * refactor img2img
      
      * remove params_proj
      
      * add test
      
      * add upcast_softmax to prior_transformer
      
      * enable num_images_per_prompt, add save_gif utility
      
      * add
      
      * add fast test
      
      * make style
      
      * add slow test
      
      * style
      
      * add test for img2img
      
      * refactor
      
      * enable batching
      
      * style
      
      * refactor scheduler
      
      * update test
      
      * style
      
      * attempt to solve batch related tests timeout
      
      * add doc
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * hardcode rendering related config
      
      * update betas_for_alpha_bar on ddpm_scheduler
      
      * fix copies
      
      * fix
      
      * export_to_gif
      
      * style
      
      * second attempt to speed up batching tests
      
      * add doc page to index
      
      * Remove intermediate clipping
      
      * 3rd attempt to speed up batching tests
      
      * Remvoe time index
      
      * simplify scheduler
      
      * Fix more
      
      * Fix more
      
      * fix more
      
      * make style
      
      * fix schedulers
      
      * fix some more tests
      
      * finish
      
      * add one more test
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * style
      
      * apply feedbacks
      
      * style
      
      * fix copies
      
      * add one example
      
      * style
      
      * add example for img2img
      
      * fix doc
      
      * fix more doc strings
      
      * size -> frame_size
      
      * style
      
      * update doc
      
      * style
      
      * fix on doc
      
      * update repo name
      
      * improve the usage example in shap-e img2img
      
      * add usage examples in the shap-e docs.
      
      * consolidate examples.
      
      * minor fix.
      
      * update doc
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * remove upcast
      
      * Make sure background is white
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
      
      * Apply suggestions from code review
      
      * Finish
      
      * Apply suggestions from code review
      
      * Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
      
      * Make style
      
      ---------
      Co-authored-by: default avataryiyixuxu <yixu310@gmail,com>
      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 avatarPedro Cuenca <pedro@huggingface.co>
      45f6d52b
  18. 14 Mar, 2023 1 commit
    • clarencechen's avatar
      Add support for different model prediction types in DDIMInverseScheduler (#2619) · ee71d9d0
      clarencechen authored
      
      
      * Add support for different model prediction types in DDIMInverseScheduler
      Resolve alpha_prod_t_prev index issue for final step of inversion
      
      * Fix old bug introduced when prediction type is "sample"
      
      * Add support for sample clipping for numerical stability and deprecate old kwarg
      
      * Detach sample, alphas, betas
      
      Derive predicted noise from model output before dist. regularization
      
      Style cleanup
      
      * Log loss for debugging
      
      * Revert "Log loss for debugging"
      
      This reverts commit 76ea9c856f99f4c8eca45a0b1801593bb982584b.
      
      * Add comments
      
      * Add inversion equivalence test
      
      * Add expected data for Pix2PixZero pipeline tests with SD 2
      
      * Update tests/pipelines/stable_diffusion/test_stable_diffusion_pix2pix_zero.py
      
      * Remove cruft and add more explanatory comments
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      ee71d9d0
  19. 01 Mar, 2023 1 commit
  20. 17 Feb, 2023 1 commit
  21. 16 Feb, 2023 1 commit
  22. 08 Feb, 2023 1 commit
  23. 25 Jan, 2023 1 commit
  24. 19 Jan, 2023 1 commit
  25. 17 Jan, 2023 1 commit
    • Kashif Rasul's avatar
      DiT Pipeline (#1806) · 37d113cc
      Kashif Rasul authored
      
      
      * added dit model
      
      * import
      
      * initial pipeline
      
      * initial convert script
      
      * initial pipeline
      
      * make style
      
      * raise valueerror
      
      * single function
      
      * rename classes
      
      * use DDIMScheduler
      
      * timesteps embedder
      
      * samples to cpu
      
      * fix var names
      
      * fix numpy type
      
      * use timesteps class for proj
      
      * fix typo
      
      * fix arg name
      
      * flip_sin_to_cos and better var names
      
      * fix C shape cal
      
      * make style
      
      * remove unused imports
      
      * cleanup
      
      * add back patch_size
      
      * initial dit doc
      
      * typo
      
      * Update docs/source/api/pipelines/dit.mdx
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * added copyright license headers
      
      * added example usage and toc
      
      * fix variable names asserts
      
      * remove comment
      
      * added docs
      
      * fix typo
      
      * upstream changes
      
      * set proper device for drop_ids
      
      * added initial dit pipeline test
      
      * update docs
      
      * fix imports
      
      * make fix-copies
      
      * isort
      
      * fix imports
      
      * get rid of more magic numbers
      
      * fix code when guidance is off
      
      * remove block_kwargs
      
      * cleanup script
      
      * removed to_2tuple
      
      * use FeedForward class instead of another MLP
      
      * style
      
      * work on mergint DiTBlock with BasicTransformerBlock
      
      * added missing final_dropout and args to BasicTransformerBlock
      
      * use norm from block
      
      * fix arg
      
      * remove unused arg
      
      * fix call to class_embedder
      
      * use timesteps
      
      * make style
      
      * attn_output gets multiplied
      
      * removed commented code
      
      * use Transformer2D
      
      * use self.is_input_patches
      
      * fix flags
      
      * fixed conversion to use Transformer2DModel
      
      * fixes for pipeline
      
      * remove dit.py
      
      * fix timesteps device
      
      * use randn_tensor and fix fp16 inf.
      
      * timesteps_emb already the right dtype
      
      * fix dit test class
      
      * fix test and style
      
      * fix norm2 usage in vq-diffusion
      
      * added author names to pipeline and lmagenet labels link
      
      * fix tests
      
      * use norm_type as string
      
      * rename dit to transformer
      
      * fix name
      
      * fix test
      
      * set  norm_type = "layer" by default
      
      * fix tests
      
      * do not skip common tests
      
      * Update src/diffusers/models/attention.py
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * revert AdaLayerNorm API
      
      * fix norm_type name
      
      * make sure all components are in eval mode
      
      * revert norm2 API
      
      * compact
      
      * finish deprecation
      
      * add slow tests
      
      * remove @
      
      * refactor some stuff
      
      * upload
      
      * Update src/diffusers/pipelines/dit/pipeline_dit.py
      
      * finish more
      
      * finish docs
      
      * improve docs
      
      * finish docs
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      Co-authored-by: default avatarWilliam Berman <WLBberman@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      37d113cc
  26. 04 Jan, 2023 2 commits
    • Patrick von Platen's avatar
      Improve reproduceability 2/3 (#1906) · 9b638548
      Patrick von Platen authored
      * [Repro] Correct reproducability
      
      * up
      
      * up
      
      * uP
      
      * up
      
      * need better image
      
      * allow conversion from no state dict checkpoints
      
      * up
      
      * up
      
      * up
      
      * up
      
      * check tensors
      
      * check tensors
      
      * check tensors
      
      * check tensors
      
      * next try
      
      * up
      
      * up
      
      * better name
      
      * up
      
      * up
      
      * Apply suggestions from code review
      
      * correct more
      
      * up
      
      * replace all torch randn
      
      * fix
      
      * correct
      
      * correct
      
      * finish
      
      * fix more
      
      * up
      9b638548
    • Joqsan's avatar
      fix: DDPMScheduler.set_timesteps() (#1912) · 675ef1ff
      Joqsan authored
      675ef1ff
  27. 19 Dec, 2022 1 commit
  28. 13 Dec, 2022 1 commit
  29. 02 Dec, 2022 1 commit
  30. 30 Nov, 2022 2 commits
  31. 28 Nov, 2022 2 commits
    • Patrick von Platen's avatar
      Add 2nd order heun scheduler (#1336) · 4c54519e
      Patrick von Platen authored
      * Add heun
      
      * Finish first version of heun
      
      * remove bogus
      
      * finish
      
      * finish
      
      * improve
      
      * up
      
      * up
      
      * fix more
      
      * change progress bar
      
      * Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
      
      * finish
      
      * up
      
      * up
      
      * up
      4c54519e
    • Suraj Patil's avatar
      v-prediction training support (#1455) · 6c56f050
      Suraj Patil authored
      * add get_velocity
      
      * add v prediction for training
      
      * fix saving
      
      * add revision arg
      
      * fix saving
      
      * save checkpoints dreambooth
      
      * fix saving embeds
      
      * add instruction in readme
      
      * quality
      
      * noise_pred -> model_pred
      6c56f050
  32. 25 Nov, 2022 2 commits
    • Patrick von Platen's avatar
      Allow to set config params directly in init (#1419) · 8faa822d
      Patrick von Platen authored
      * fix
      
      * fix deprecated kwargs logic
      
      * add tests
      
      * finish
      8faa822d
    • Pedro Cuenca's avatar
      Deprecate `predict_epsilon` (#1393) · d52388f4
      Pedro Cuenca authored
      
      
      * Adapt ddpm, ddpmsolver to prediction_type.
      
      * Deprecate predict_epsilon in __init__.
      
      * Bring FlaxDDIMScheduler up to date with DDIMScheduler.
      
      * Set prediction_type as an ivar for consistency.
      
      * Convert pipeline_ddpm
      
      * Adapt tests.
      
      * Adapt unconditional training script.
      
      * Adapt BitDiffusion example.
      
      * Add missing kwargs in dpmsolver_multistep
      
      * Ugly workaround to accept deprecated predict_epsilon when loading
      schedulers using from_pretrained.
      
      * make style
      
      * Remove import no longer in use.
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Use config.prediction_type everywhere
      
      * Add a couple of Flax prediction type tests.
      
      * make style
      
      * fix register deprecated arg
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      d52388f4
  33. 24 Nov, 2022 1 commit
  34. 15 Nov, 2022 1 commit