1. 24 Jul, 2023 7 commits
  2. 21 Jul, 2023 6 commits
  3. 20 Jul, 2023 4 commits
  4. 19 Jul, 2023 4 commits
  5. 18 Jul, 2023 3 commits
    • Sayak Paul's avatar
      [Core] add: controlnet support for SDXL (#4038) · 3eb498e7
      Sayak Paul authored
      * add: controlnet sdxl.
      
      * modifications to controlnet.
      
      * run styling.
      
      * add: __init__.pys
      
      * incorporate https://github.com/huggingface/diffusers/pull/4019
      
       changes.
      
      * run make fix-copies.
      
      * resize the conditioning images.
      
      * remove autocast.
      
      * run styling.
      
      * disable autocast.
      
      * debugging
      
      * device placement.
      
      * back to autocast.
      
      * remove comment.
      
      * save some memory by reusing the vae and unet in the pipeline.
      
      * apply styling.
      
      * Allow low precision sd xl
      
      * finish
      
      * finish
      
      * changes to accommodate the improved VAE.
      
      * modifications to how we handle vae encoding in the training.
      
      * make style
      
      * make existing controlnet fast tests pass.
      
      * change vae checkpoint cli arg.
      
      * fix: vae pretrained paths.
      
      * fix: steps in get_scheduler().
      
      * debugging.
      
      * debugging./
      
      * fix: weight conversion.
      
      * add: docs.
      
      * add: limited tests./
      
      * add: datasets to the requirements.
      
      * update docstrings and incorporate the usage of watermarking.
      
      * incorporate fix from #4083
      
      * fix watermarking dependency handling.
      
      * run make-fix-copies.
      
      * Empty-Commit
      
      * Update requirements_sdxl.txt
      
      * remove vae upcasting part.
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * run make style
      
      * run make fix-copies.
      
      * disable suppot for multicontrolnet.
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * run make fix-copies.
      
      * dtyle/.
      
      * fix-copies.
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      3eb498e7
    • 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
    • Patrick von Platen's avatar
      Refactor execution device & cpu offload (#4114) · 27062c36
      Patrick von Platen authored
      * create general cpu offload & execution device
      
      * Remove boiler plate
      
      * finish
      
      * kp
      
      * Correct offload more pipelines
      
      * up
      
      * Update src/diffusers/pipelines/pipeline_utils.py
      
      * make style
      
      * up
      27062c36
  6. 17 Jul, 2023 4 commits
    • Will Berman's avatar
      t2i pipeline (#3932) · a0597f33
      Will Berman authored
      
      
      * Quick implementation of t2i-adapter
      
      Load adapter module with from_pretrained
      
      Prototyping generalized adapter framework
      
      Writeup doc string for sideload framework(WIP) + some minor update on implementation
      
      Update adapter models
      
      Remove old adapter optional args in UNet
      
      Add StableDiffusionAdapterPipeline unit test
      
      Handle cpu offload in StableDiffusionAdapterPipeline
      
      Auto correct coding style
      
      Update model repo name to "RzZ/sd-v1-4-adapter-pipeline"
      
      Refactor MultiAdapter to better compatible with config system
      
      Export MultiAdapter
      
      Create pipeline document template from controlnet
      
      Create dummy objects
      
      Supproting new AdapterLight model
      
      Fix StableDiffusionAdapterPipeline common pipeline test
      
      [WIP] Update adapter pipeline document
      
      Handle num_inference_steps in StableDiffusionAdapterPipeline
      
      Update definition of Adapter "channels_in"
      
      Update documents
      
      Apply code style
      
      Fix doc typo and merge error
      
      Update doc string and example
      
      Quality of life improvement
      
      Remove redundant code and file from prototyping
      
      Remove unused pageage
      
      Remove comments
      
      Fix title
      
      Fix typo
      
      Add conditioning scale arg
      
      Bring back old implmentation
      
      Offload sideload
      
      Add supply info on document
      
      Update src/diffusers/models/adapter.py
      Co-authored-by: default avatarWill Berman <wlbberman@gmail.com>
      
      Update MultiAdapter constructor
      
      Swap out custom checkpoint and update pipeline constructor
      
      Update docment
      
      Apply suggestions from code review
      Co-authored-by: default avatarWill Berman <wlbberman@gmail.com>
      
      Correcting style
      
      Following single-file policy
      
      Update auto size in image preprocess func
      
      Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_adapter.py
      Co-authored-by: default avatarWill Berman <wlbberman@gmail.com>
      
      fix copies
      
      Update adapter pipeline behavior
      
      Add adapter_conditioning_scale doc string
      
      Add the missing doc string
      
      Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      Fix few bugs from suggestion
      
      Handle L-mode PIL image as control image
      
      Rename to differentiate adapter resblock
      
      Update src/diffusers/models/adapter.py
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      Fix typo
      
      Update adapter parameter name
      
      Update test case and code style
      
      Fix copies
      
      Fix typo
      
      Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_adapter.py
      Co-authored-by: default avatarWill Berman <wlbberman@gmail.com>
      
      Update Adapter class name
      
      Add checkpoint converting script
      
      Fix style
      
      Fix-copies
      
      Remove dev script
      
      Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      Updates for parameter rename
      
      Fix convert_adapter
      
      remove main
      
      fix diff
      
      more
      
      refactoring
      
      more
      
      more
      
      small fixes
      
      refactor
      
      tests
      
      more slow tests
      
      more tests
      
      Update docs/source/en/api/pipelines/overview.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      add community contributor to docs
      
      Update docs/source/en/api/pipelines/stable_diffusion/adapter.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      Update docs/source/en/api/pipelines/stable_diffusion/adapter.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      Update docs/source/en/api/pipelines/stable_diffusion/adapter.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      Update docs/source/en/api/pipelines/stable_diffusion/adapter.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      Update docs/source/en/api/pipelines/stable_diffusion/adapter.mdx
      Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
      
      fix
      
      remove from_adapters
      
      license
      
      paper link
      
      docs
      
      more url fixes
      
      more docs
      
      fix
      
      fixes
      
      fix
      
      fix
      
      * fix sample inplace add
      
      * additional_kwargs -> additional_residuals
      
      * move t2i adapter pipeline to own module
      
      * preprocess -> _preprocess_adapter_image
      
      * add TencentArc to license
      
      * fix example code links
      
      * add image converter and fix example doc string
      
      * fix links
      
      * clearer additional residual application
      
      ---------
      Co-authored-by: default avatarHimariO <dsfhe49854@gmail.com>
      a0597f33
    • edward zhu's avatar
      add `noise_sampler_seed` to `StableDiffusionKDiffusionPipeline.__call__` (#3911) · 6b33c11c
      edward zhu authored
      
      
      * add noise_sampler to StableDiffusionKDiffusionPipeline
      
      * fix/docs: Fix the broken doc links (#3897)
      
      * fix/docs: Fix the broken doc links
      Signed-off-by: default avatarGitHub <noreply@github.com>
      
      * Update docs/source/en/using-diffusers/write_own_pipeline.mdx
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      ---------
      Signed-off-by: default avatarGitHub <noreply@github.com>
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      * Add video img2img (#3900)
      
      * Add image to image video
      
      * Improve
      
      * better naming
      
      * make fix copies
      
      * add docs
      
      * finish tests
      
      * trigger tests
      
      * make style
      
      * correct
      
      * finish
      
      * Fix more
      
      * make style
      
      * finish
      
      * fix/doc-code: Updating to the latest version parameters (#3924)
      
      fix/doc-code: update to use the new parameter
      Signed-off-by: default avatarGitHub <noreply@github.com>
      
      * fix/doc: no import torch issue (#3923)
      
      Ffix/doc: no import torch issue
      Signed-off-by: default avatarGitHub <noreply@github.com>
      
      * Correct controlnet out of list error (#3928)
      
      * Correct controlnet out of list error
      
      * Apply suggestions from code review
      
      * correct tests
      
      * correct tests
      
      * fix
      
      * test all
      
      * Apply suggestions from code review
      
      * test all
      
      * test all
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * fix more tests
      
      * Fix more
      
      * Apply suggestions from code review
      
      * finish
      
      * Apply suggestions from code review
      
      * Update src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py
      
      * finish
      
      * Adding better way to define multiple concepts and also validation capabilities. (#3807)
      
      * - Added validation parameters
      - Changed some parameter descriptions to better explain their use.
      - Fixed a few typos.
      - Added concept_list parameter for better management of multiple subjects
      - changed logic for image validation
      
      * - Fixed bad logic for class data root directories
      
      * Defaulting validation_steps to None for an easier logic
      
      * Fixed multiple validation prompts
      
      * Fixed bug on validation negative prompt
      
      * Changed validation logic for tracker.
      
      * Added uuid for validation image labeling
      
      * Fix error when comparing validation prompts and validation negative prompts
      
      * Improved error message when negative prompts for validation are more than the number of prompts
      
      * - Changed image tracking number from epoch to global_step
      - Added Typing for functions
      
      * Added some validations more when using concept_list parameter and the regular ones.
      
      * Fixed error message
      
      * Added more validations for validation parameters
      
      * Improved messaging for errors
      
      * Fixed validation error for parameters with default values
      
      * - Added train step to image name for validation
      - reformatted code
      
      * - Added train step to image's name for validation
      - reformatted code
      
      * Updated README.md file.
      
      * reverted back original script of train_dreambooth.py
      
      * reverted back original script of train_dreambooth.py
      
      * left one blank line at the eof
      
      * reverted back setup.py
      
      * reverted back setup.py
      
      * added same logic for when parameters for prior preservation are used without enabling the flag while using concept_list parameter.
      
      * Ran black formatter.
      
      * fixed a few strings
      
      * fixed import sort with isort and removed fstrings without placeholder
      
      * fixed import order with ruff (since with isort wasn't ok)
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * [ldm3d] Update code to be functional with the new checkpoints (#3875)
      
      * fixed typo
      
      * updated doc to be consistent in naming
      
      * make style/quality
      
      * preprocessing for 4 channels and not 6
      
      * make style
      
      * test for 4c
      
      * make style/quality
      
      * fixed test on cpu
      
      ---------
      Co-authored-by: default avatarAflalo <estellea@isl-iam1.rr.intel.com>
      Co-authored-by: default avatarAflalo <estellea@isl-gpu33.rr.intel.com>
      Co-authored-by: default avatarAflalo <estellea@isl-gpu38.rr.intel.com>
      
      * Improve memory text to video (#3930)
      
      * Improve memory text to video
      
      * Apply suggestions from code review
      
      * add test
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      * finish test setup
      
      ---------
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      * revert automatic chunking (#3934)
      
      * revert automatic chunking
      
      * Apply suggestions from code review
      
      * revert automatic chunking
      
      * avoid upcasting by assigning dtype to noise tensor (#3713)
      
      * avoid upcasting by assigning dtype to noise tensor
      
      * make style
      
      * Update train_unconditional.py
      
      * Update train_unconditional.py
      
      * make style
      
      * add unit test for pickle
      
      * revert change
      
      ---------
      Co-authored-by: default avatarroot <root@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: Prathik Rao <prathikrao@microsoft.com@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
      
      * Fix failing np tests (#3942)
      
      * Fix failing np tests
      
      * Apply suggestions from code review
      
      * Update tests/pipelines/test_pipelines_common.py
      
      * Add `timestep_spacing` and `steps_offset` to schedulers (#3947)
      
      * Add timestep_spacing to DDPM, LMSDiscrete, PNDM.
      
      * Remove spurious line.
      
      * More easy schedulers.
      
      * Add `linspace` to DDIM
      
      * Noise sigma for `trailing`.
      
      * Add timestep_spacing to DEISMultistepScheduler.
      
      Not sure the range is the way it was intended.
      
      * Fix: remove line used to debug.
      
      * Support timestep_spacing in DPMSolverMultistep, DPMSolverSDE, UniPC
      
      * Fix: convert to numpy.
      
      * Use sched. defaults when instantiating from_config
      
      For params not present in the original configuration.
      
      This makes it possible to switch pipeline schedulers even if they use
      different timestep_spacing (or any other param).
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Missing args in DPMSolverMultistep
      
      * Test: default args not in config
      
      * Style
      
      * Fix scheduler name in test
      
      * Remove duplicated entries
      
      * Add test for solver_type
      
      This test currently fails in main. When switching from DEIS to UniPC,
      solver_type is "logrho" (the default value from DEIS), which gets
      translated to "bh1" by UniPC. This is different to the default value for
      UniPC: "bh2". This is where the translation happens: https://github.com/huggingface/diffusers/blob/36d22d0709dc19776e3016fb3392d0f5578b0ab2/src/diffusers/schedulers/scheduling_unipc_multistep.py#L171
      
      
      
      * UniPC: use same default for solver_type
      
      Fixes a bug when switching from UniPC from another scheduler (i.e.,
      DEIS) that uses a different solver type. The solver is now the same as
      if we had instantiated the scheduler directly.
      
      * do not save use default values
      
      * fix more
      
      * fix all
      
      * fix schedulers
      
      * fix more
      
      * finish for real
      
      * finish for real
      
      * flaky tests
      
      * Update tests/pipelines/stable_diffusion/test_stable_diffusion_pix2pix_zero.py
      
      * Default steps_offset to 0.
      
      * Add missing docstrings
      
      * Apply suggestions from code review
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Add Consistency Models Pipeline (#3492)
      
      * initial commit
      
      * Improve consistency models sampling implementation.
      
      * Add CMStochasticIterativeScheduler, which implements the multi-step sampler (stochastic_iterative_sampler) in the original code, and make further improvements to sampling.
      
      * Add Unet blocks for consistency models
      
      * Add conversion script for Unet
      
      * Fix bug in new unet blocks
      
      * Fix attention weight loading
      
      * Make design improvements to ConsistencyModelPipeline and CMStochasticIterativeScheduler and add initial version of tests.
      
      * make style
      
      * Make small random test UNet class conditional and set resnet_time_scale_shift to 'scale_shift' to better match consistency model checkpoints.
      
      * Add support for converting a test UNet and non-class-conditional UNets to the consistency models conversion script.
      
      * make style
      
      * Change num_class_embeds to 1000 to better match the original consistency models implementation.
      
      * Add support for distillation in pipeline_consistency_models.py.
      
      * Improve consistency model tests:
      	- Get small testing checkpoints from hub
      	- Modify tests to take into account "distillation" parameter of ConsistencyModelPipeline
      	- Add onestep, multistep tests for distillation and distillation + class conditional
      	- Add expected image slices for onestep tests
      
      * make style
      
      * Improve ConsistencyModelPipeline:
      	- Add initial support for class-conditional generation
      	- Fix initial sigma for onestep generation
      	- Fix some sigma shape issues
      
      * make style
      
      * Improve ConsistencyModelPipeline:
      	- add latents __call__ argument and prepare_latents method
      	- add check_inputs method
      	- add initial docstrings for ConsistencyModelPipeline.__call__
      
      * make style
      
      * Fix bug when randomly generating class labels for class-conditional generation.
      
      * Switch CMStochasticIterativeScheduler to configuring a sigma schedule and make related changes to the pipeline and tests.
      
      * Remove some unused code and make style.
      
      * Fix small bug in CMStochasticIterativeScheduler.
      
      * Add expected slices for multistep sampling tests and make them pass.
      
      * Work on consistency model fast tests:
      	- in pipeline, call self.scheduler.scale_model_input before denoising
      	- get expected slices for Euler and Heun scheduler tests
      	- make Euler test pass
      	- mark Heun test as expected fail because it doesn't support prediction_type "sample" yet
      	- remove DPM and Euler Ancestral tests because they don't support use_karras_sigmas
      
      * make style
      
      * Refactor conversion script to make it easier to add more model architectures to convert in the future.
      
      * Work on ConsistencyModelPipeline tests:
      	- Fix device bug when handling class labels in ConsistencyModelPipeline.__call__
      	- Add slow tests for onestep and multistep sampling and make them pass
      	- Refactor fast tests
      	- Refactor ConsistencyModelPipeline.__init__
      
      * make style
      
      * Remove the add_noise and add_noise_to_input methods from CMStochasticIterativeScheduler for now.
      
      * Run python utils/check_copies.py --fix_and_overwrite
      python utils/check_dummies.py --fix_and_overwrite to make dummy objects for new pipeline and scheduler.
      
      * Make fast tests from PipelineTesterMixin pass.
      
      * make style
      
      * Refactor consistency models pipeline and scheduler:
      	- Remove support for Karras schedulers (only support CMStochasticIterativeScheduler)
      	- Move sigma manipulation, input scaling, denoising from pipeline to scheduler
      	- Make corresponding changes to tests and ensure they pass
      
      * make style
      
      * Add docstrings and further refactor pipeline and scheduler.
      
      * make style
      
      * Add initial version of the consistency models documentation.
      
      * Refactor custom timesteps logic following DDPMScheduler/IFPipeline and temporarily add torch 2.0 SDPA kernel selection logic for debugging.
      
      * make style
      
      * Convert current slow tests to use fp16 and flash attention.
      
      * make style
      
      * Add slow tests for normal attention on cuda device.
      
      * make style
      
      * Fix attention weights loading
      
      * Update consistency model fast tests for new test checkpoints with attention fix.
      
      * make style
      
      * apply suggestions
      
      * Add add_noise method to CMStochasticIterativeScheduler (copied from EulerDiscreteScheduler).
      
      * Conversion script now outputs pipeline instead of UNet and add support for LSUN-256 models and different schedulers.
      
      * When both timesteps and num_inference_steps are supplied, raise warning instead of error (timesteps take precedence).
      
      * make style
      
      * Add remaining diffusers model checkpoints for models in the original consistency model release and update usage example.
      
      * apply suggestions from review
      
      * make style
      
      * fix attention naming
      
      * Add tests for CMStochasticIterativeScheduler.
      
      * make style
      
      * Make CMStochasticIterativeScheduler tests pass.
      
      * make style
      
      * Override test_step_shape in CMStochasticIterativeSchedulerTest instead of modifying it in SchedulerCommonTest.
      
      * make style
      
      * rename some models
      
      * Improve API
      
      * rename some models
      
      * Remove duplicated block
      
      * Add docstring and make torch compile work
      
      * More fixes
      
      * Fixes
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * add more docstring
      
      * update consistency conversion script
      
      ---------
      Co-authored-by: default avatarayushmangal <ayushmangal@microsoft.com>
      Co-authored-by: default avatarAyush Mangal <43698245+ayushtues@users.noreply.github.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * add test case for StableDiffusionKDiffusionPipeline noise_sampler
      
      ---------
      Signed-off-by: default avatarGitHub <noreply@github.com>
      Co-authored-by: default avatarAisuko <urakiny@gmail.com>
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarAndrés Mauricio Repetto Ferrero <amd.repetto@gmail.com>
      Co-authored-by: default avatarestelleafl <estelle.aflalo@intel.com>
      Co-authored-by: default avatarAflalo <estellea@isl-iam1.rr.intel.com>
      Co-authored-by: default avatarAflalo <estellea@isl-gpu33.rr.intel.com>
      Co-authored-by: default avatarAflalo <estellea@isl-gpu38.rr.intel.com>
      Co-authored-by: default avatarPrathik Rao <prathikr@usc.edu>
      Co-authored-by: default avatarroot <root@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
      Co-authored-by: Prathik Rao <prathikrao@microsoft.com@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
      Co-authored-by: default avatardg845 <58458699+dg845@users.noreply.github.com>
      Co-authored-by: default avatarayushmangal <ayushmangal@microsoft.com>
      Co-authored-by: default avatarAyush Mangal <43698245+ayushtues@users.noreply.github.com>
      6b33c11c
    • Patrick von Platen's avatar
      [From single file] Make accelerate optional (#4132) · 5729829c
      Patrick von Platen authored
      * Make accelerate optional
      
      * make accelerate optional
      5729829c
    • Patrick von Platen's avatar
      [From ckpt] replace with os path join (#3746) · e27500b7
      Patrick von Platen authored
      replace with os path join
      e27500b7
  7. 15 Jul, 2023 1 commit
  8. 14 Jul, 2023 4 commits
  9. 13 Jul, 2023 1 commit
  10. 12 Jul, 2023 3 commits
  11. 11 Jul, 2023 3 commits