1. 07 Feb, 2023 1 commit
  2. 06 Feb, 2023 1 commit
  3. 30 Dec, 2022 1 commit
  4. 22 Nov, 2022 1 commit
  5. 07 Nov, 2022 1 commit
  6. 03 Nov, 2022 1 commit
    • Pedro Cuenca's avatar
      Continuation of #1035 (#1120) · 269109db
      Pedro Cuenca authored
      
      
      * remove batch size from repeat
      
      * repeat empty string if uncond_tokens is none
      
      * fix inpaint pipes
      
      * return back whitespace to pass code quality
      
      * Apply suggestions from code review
      
      * Fix typos.
      Co-authored-by: default avatarHad <had-95@yandex.ru>
      269109db
  7. 25 Oct, 2022 1 commit
  8. 17 Oct, 2022 2 commits
  9. 13 Oct, 2022 3 commits
  10. 11 Oct, 2022 2 commits
  11. 06 Oct, 2022 1 commit
    • Suraj Patil's avatar
      allow multiple generations per prompt (#741) · c119dc4c
      Suraj Patil authored
      * compute text embeds per prompt
      
      * don't repeat uncond prompts
      
      * repeat separatly
      
      * update image2image
      
      * fix repeat uncond embeds
      
      * adapt inpaint pipeline
      
      * ifx uncond tokens in img2img
      
      * add tests and fix ucond embeds in im2img and inpaint pipe
      c119dc4c
  12. 05 Oct, 2022 3 commits
  13. 04 Oct, 2022 1 commit
  14. 03 Oct, 2022 2 commits
  15. 02 Oct, 2022 1 commit
  16. 30 Sep, 2022 1 commit
    • Nouamane Tazi's avatar
      Optimize Stable Diffusion (#371) · 9ebaea54
      Nouamane Tazi authored
      * initial commit
      
      * make UNet stream capturable
      
      * try to fix noise_pred value
      
      * remove cuda graph and keep NB
      
      * non blocking unet with PNDMScheduler
      
      * make timesteps np arrays for pndm scheduler
      because lists don't get formatted to tensors in `self.set_format`
      
      * make max async in pndm
      
      * use channel last format in unet
      
      * avoid moving timesteps device in each unet call
      
      * avoid memcpy op in `get_timestep_embedding`
      
      * add `channels_last` kwarg to `DiffusionPipeline.from_pretrained`
      
      * update TODO
      
      * replace `channels_last` kwarg with `memory_format` for more generality
      
      * revert the channels_last changes to leave it for another PR
      
      * remove non_blocking when moving input ids to device
      
      * remove blocking from all .to() operations at beginning of pipeline
      
      * fix merging
      
      * fix merging
      
      * model can run in other precisions without autocast
      
      * attn refactoring
      
      * Revert "attn refactoring"
      
      This reverts commit 0c70c0e189cd2c4d8768274c9fcf5b940ee310fb.
      
      * remove restriction to run conv_norm in fp32
      
      * use `baddbmm` instead of `matmul`for better in attention for better perf
      
      * removing all reshapes to test perf
      
      * Revert "removing all reshapes to test perf"
      
      This reverts commit 006ccb8a8c6bc7eb7e512392e692a29d9b1553cd.
      
      * add shapes comments
      
      * hardcore whats needed for jitting
      
      * Revert "hardcore whats needed for jitting"
      
      This reverts commit 2fa9c698eae2890ac5f8e367ca80532ecf94df9a.
      
      * Revert "remove restriction to run conv_norm in fp32"
      
      This reverts commit cec592890c32da3d1b78d38b49e4307aedf459b9.
      
      * revert using baddmm in attention's forward
      
      * cleanup comment
      
      * remove restriction to run conv_norm in fp32. no quality loss was noticed
      
      This reverts commit cc9bc1339c998ebe9e7d733f910c6d72d9792213.
      
      * add more optimizations techniques to docs
      
      * Revert "add shapes comments"
      
      This reverts commit 31c58eadb8892f95478cdf05229adf678678c5f4.
      
      * apply suggestions
      
      * make quality
      
      * apply suggestions
      
      * styling
      
      * `scheduler.timesteps` are now arrays so we dont need .to()
      
      * remove useless .type()
      
      * use mean instead of max in `test_stable_diffusion_inpaint_pipeline_k_lms`
      
      * move scheduler timestamps to correct device if tensors
      
      * add device to `set_timesteps` in LMSD scheduler
      
      * `self.scheduler.set_timesteps` now uses device arg for schedulers that accept it
      
      * quick fix
      
      * styling
      
      * remove kwargs from schedulers `set_timesteps`
      
      * revert to using max in K-LMS inpaint pipeline test
      
      * Revert "`self.scheduler.set_timesteps` now uses device arg for schedulers that accept it"
      
      This reverts commit 00d5a51e5c20d8d445c8664407ef29608106d899.
      
      * move timesteps to correct device before loop in SD pipeline
      
      * apply previous fix to other SD pipelines
      
      * UNet now accepts tensor timesteps even on wrong device, to avoid errors
      - it shouldnt affect performance if timesteps are alrdy on correct device
      - it does slow down performance if they're on the wrong device
      
      * fix pipeline when timesteps are arrays with strides
      9ebaea54
  17. 27 Sep, 2022 3 commits
    • Kashif Rasul's avatar
      [Pytorch] Pytorch only schedulers (#534) · bd8df2da
      Kashif Rasul authored
      
      
      * pytorch only schedulers
      
      * fix style
      
      * remove match_shape
      
      * pytorch only ddpm
      
      * remove SchedulerMixin
      
      * remove numpy from karras_ve
      
      * fix types
      
      * remove numpy from lms_discrete
      
      * remove numpy from pndm
      
      * fix typo
      
      * remove mixin and numpy from sde_vp and ve
      
      * remove remaining tensor_format
      
      * fix style
      
      * sigmas has to be torch tensor
      
      * removed set_format in readme
      
      * remove set format from docs
      
      * remove set_format from pipelines
      
      * update tests
      
      * fix typo
      
      * continue to use mixin
      
      * fix imports
      
      * removed unsed imports
      
      * match shape instead of assuming image shapes
      
      * remove import typo
      
      * update call to add_noise
      
      * use math instead of numpy
      
      * fix t_index
      
      * removed commented out numpy tests
      
      * timesteps needs to be discrete
      
      * cast timesteps to int in flax scheduler too
      
      * fix device mismatch issue
      
      * small fix
      
      * Update src/diffusers/schedulers/scheduling_pndm.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      bd8df2da
    • Pedro Cuenca's avatar
      Remove deprecated `torch_device` kwarg (#623) · b671cb09
      Pedro Cuenca authored
      * Remove deprecated `torch_device` kwarg.
      
      * Remove unused imports.
      b671cb09
    • Yuta Hayashibe's avatar
      Warning for too long prompts in DiffusionPipelines (Resolve #447) (#472) · f7ebe569
      Yuta Hayashibe authored
      * Return encoded texts by DiffusionPipelines
      
      * Updated README to show hot to use enoded_text_input
      
      * Reverted examples in README.md
      
      * Reverted all
      
      * Warning for long prompts
      
      * Fix bugs
      
      * Formatted
      f7ebe569
  18. 23 Sep, 2022 1 commit
  19. 19 Sep, 2022 1 commit
  20. 17 Sep, 2022 1 commit
  21. 16 Sep, 2022 1 commit
  22. 08 Sep, 2022 3 commits
    • Patrick von Platen's avatar
      [Outputs] Improve syntax (#423) · f6fb3282
      Patrick von Platen authored
      
      
      * [Outputs] Improve syntax
      
      * improve more
      
      * fix docstring return
      
      * correct all
      
      * uP
      Co-authored-by: default avatarMishig Davaadorj <dmishig@gmail.com>
      f6fb3282
    • Pedro Cuenca's avatar
      Inference support for `mps` device (#355) · 5dda1735
      Pedro Cuenca authored
      * Initial support for mps in Stable Diffusion pipeline.
      
      * Initial "warmup" implementation when using mps.
      
      * Make some deterministic tests pass with mps.
      
      * Disable training tests when using mps.
      
      * SD: generate latents in CPU then move to device.
      
      This is especially important when using the mps device, because
      generators are not supported there. See for example
      https://github.com/pytorch/pytorch/issues/84288.
      
      In addition, the other pipelines seem to use the same approach: generate
      the random samples then move to the appropriate device.
      
      After this change, generating an image in MPS produces the same result
      as when using the CPU, if the same seed is used.
      
      * Remove prints.
      
      * Pass AutoencoderKL test_output_pretrained with mps.
      
      Sampling from `posterior` must be done in CPU.
      
      * Style
      
      * Do not use torch.long for log op in mps device.
      
      * Perform incompatible padding ops in CPU.
      
      UNet tests now pass.
      See https://github.com/pytorch/pytorch/issues/84535
      
      
      
      * Style: fix import order.
      
      * Remove unused symbols.
      
      * Remove MPSWarmupMixin, do not apply automatically.
      
      We do apply warmup in the tests, but not during normal use.
      This adopts some PR suggestions by @patrickvonplaten.
      
      * Add comment for mps fallback to CPU step.
      
      * Add README_mps.md for mps installation and use.
      
      * Apply `black` to modified files.
      
      * Restrict README_mps to SD, show measures in table.
      
      * Make PNDM indexing compatible with mps.
      
      Addresses #239.
      
      * Do not use float64 when using LDMScheduler.
      
      Fixes #358.
      
      * Fix typo identified by @patil-suraj
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * Adapt example to new output style.
      
      * Restore 1:1 results reproducibility with CompVis.
      
      However, mps latents need to be generated in CPU because generators
      don't work in the mps device.
      
      * Move PyTorch nightly to requirements.
      
      * Adapt `test_scheduler_outputs_equivalence` ton MPS.
      
      * mps: skip training tests instead of ignoring silently.
      
      * Make VQModel tests pass on mps.
      
      * mps ddim tests: warmup, increase tolerance.
      
      * ScoreSdeVeScheduler indexing made mps compatible.
      
      * Make ldm pipeline tests pass using warmup.
      
      * Style
      
      * Simplify casting as suggested in PR.
      
      * Add Known Issues to readme.
      
      * `isort` import order.
      
      * Remove _mps_warmup helpers from ModelMixin.
      
      And just make changes to the tests.
      
      * Skip tests using unittest decorator for consistency.
      
      * Remove temporary var.
      
      * Remove spurious blank space.
      
      * Remove unused symbol.
      
      * Remove README_mps.
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> 
      5dda1735
    • Pedro Cuenca's avatar
      Docs: fp16 page (#404) · c29d81c3
      Pedro Cuenca authored
      
      
      * Initial version of `fp16` page.
      
      * Fix typo in README.
      
      * Change titles of fp16 section in toctree.
      
      * PR suggestion
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * PR suggestion
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Clarify attention slicing is useful even for batches of 1
      
      Explained by @patrickvonplaten after a suggestion by @keturn.
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Do not talk about `batches` in `enable_attention_slicing`.
      
      * Use Tip (just for fun), add link to method.
      
      * Comment about fp16 results looking the same as float32 in practice.
      
      * Style: docstring line wrapping.
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      c29d81c3
  23. 07 Sep, 2022 2 commits
  24. 06 Sep, 2022 1 commit
  25. 05 Sep, 2022 1 commit
  26. 30 Aug, 2022 1 commit
  27. 29 Aug, 2022 1 commit
  28. 25 Aug, 2022 1 commit