1. 23 Sep, 2022 1 commit
  2. 22 Sep, 2022 1 commit
    • Suraj Patil's avatar
      [UNet2DConditionModel] add gradient checkpointing (#461) · e7120bae
      Suraj Patil authored
      * add grad ckpt to downsample blocks
      
      * make it work
      
      * don't pass gradient_checkpointing to upsample block
      
      * add tests for UNet2DConditionModel
      
      * add test_gradient_checkpointing
      
      * add gradient_checkpointing for up and down blocks
      
      * add functions to enable and disable grad ckpt
      
      * remove the forward argument
      
      * better naming
      
      * make supports_gradient_checkpointing private
      e7120bae
  3. 21 Sep, 2022 1 commit
    • Pedro Cuenca's avatar
      Allow dtype to be specified in Flax pipeline (#600) · fb2fbab1
      Pedro Cuenca authored
      * Fix typo in docstring.
      
      * Allow dtype to be overridden on model load.
      
      This may be a temporary solution until #567 is addressed.
      
      * Create latents in float32
      
      The denoising loop always computes the next step in float32, so this
      would fail when using `bfloat16`.
      fb2fbab1
  4. 20 Sep, 2022 4 commits
  5. 19 Sep, 2022 2 commits
  6. 17 Sep, 2022 1 commit
  7. 16 Sep, 2022 2 commits
  8. 15 Sep, 2022 1 commit
    • Kashif Rasul's avatar
      Karras VE, DDIM and DDPM flax schedulers (#508) · b34be039
      Kashif Rasul authored
      * beta never changes removed from state
      
      * fix typos in docs
      
      * removed unused var
      
      * initial ddim flax scheduler
      
      * import
      
      * added dummy objects
      
      * fix style
      
      * fix typo
      
      * docs
      
      * fix typo in comment
      
      * set return type
      
      * added flax ddom
      
      * fix style
      
      * remake
      
      * pass PRNG key as argument and split before use
      
      * fix doc string
      
      * use config
      
      * added flax Karras VE scheduler
      
      * make style
      
      * fix dummy
      
      * fix ndarray type annotation
      
      * replace returns a new state
      
      * added lms_discrete scheduler
      
      * use self.config
      
      * add_noise needs state
      
      * use config
      
      * use config
      
      * docstring
      
      * added flax score sde ve
      
      * fix imports
      
      * fix typos
      b34be039
  9. 13 Sep, 2022 1 commit
  10. 12 Sep, 2022 1 commit
    • Kashif Rasul's avatar
      update expected results of slow tests (#268) · f4781a0b
      Kashif Rasul authored
      
      
      * update expected results of slow tests
      
      * relax sum and mean tests
      
      * Print shapes when reporting exception
      
      * formatting
      
      * fix sentence
      
      * relax test_stable_diffusion_fast_ddim for gpu fp16
      
      * relax flakey tests on GPU
      
      * added comment on large tolerences
      
      * black
      
      * format
      
      * set scheduler seed
      
      * added generator
      
      * use np.isclose
      
      * set num_inference_steps to 50
      
      * fix dep. warning
      
      * update expected_slice
      
      * preprocess if image
      
      * updated expected results
      
      * updated expected from CI
      
      * pass generator to VAE
      
      * undo change back to orig
      
      * use orignal
      
      * revert back the expected on cpu
      
      * revert back values for CPU
      
      * more undo
      
      * update result after using gen
      
      * update mean
      
      * set generator for mps
      
      * update expected on CI server
      
      * undo
      
      * use new seed every time
      
      * cpu manual seed
      
      * reduce num_inference_steps
      
      * style
      
      * use generator for randn
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      f4781a0b
  11. 08 Sep, 2022 7 commits
    • Patrick von Platen's avatar
      [Black] Update black (#433) · b2b3b1a8
      Patrick von Platen authored
      * Update black
      
      * update table
      b2b3b1a8
    • Patrick von Platen's avatar
      [Docs] Correct links (#432) · 44968e42
      Patrick von Platen authored
      44968e42
    • Patrick von Platen's avatar
      Mark in painting experimental (#430) · 195ebe5a
      Patrick von Platen authored
      195ebe5a
    • 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
    • Anton Lozhkov's avatar
      [ONNX] Stable Diffusion exporter and pipeline (#399) · 8d9c4a53
      Anton Lozhkov authored
      
      
      * initial export and design
      
      * update imports
      
      * custom prover, import fixes
      
      * Update src/diffusers/onnx_utils.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/diffusers/onnx_utils.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * remove push_to_hub
      
      * Update src/diffusers/onnx_utils.py
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * remove torch_device
      
      * numpify the rest of the pipeline
      
      * torchify the safety checker
      
      * revert tensor
      
      * Code review suggestions + quality
      
      * fix tests
      
      * fix provider, add an end-to-end test
      
      * style
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      8d9c4a53
    • 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
  12. 07 Sep, 2022 9 commits
  13. 06 Sep, 2022 1 commit
  14. 05 Sep, 2022 2 commits
  15. 03 Sep, 2022 1 commit
  16. 02 Sep, 2022 2 commits
  17. 01 Sep, 2022 3 commits