1. 28 Nov, 2022 1 commit
  2. 25 Nov, 2022 1 commit
    • Suraj Patil's avatar
      StableDiffusionUpscalePipeline (#1396) · 9ec5084a
      Suraj Patil authored
      
      
      * StableDiffusionUpscalePipeline
      
      * fix a few things
      
      * make it better
      
      * fix image batching
      
      * run vae in fp32
      
      * fix docstr
      
      * resize to mul of 64
      
      * doc
      
      * remove safety_checker
      
      * add max_noise_level
      
      * fix Copied
      
      * begin tests
      
      * slow tests
      
      * default max_noise_level
      
      * remove kwargs
      
      * doc
      
      * fix
      
      * fix fast tests
      
      * fix fast tests
      
      * no sf
      
      * don't offload vae
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      9ec5084a
  3. 24 Nov, 2022 1 commit
  4. 23 Nov, 2022 5 commits
    • Patrick von Platen's avatar
      trailing . fix · 9f476388
      Patrick von Platen authored
      9f476388
    • Patrick von Platen's avatar
      fix trailing . dep object · 9479052d
      Patrick von Platen authored
      9479052d
    • Patrick von Platen's avatar
      [Bad dependencies] Fix imports (#1382) · 35d81861
      Patrick von Platen authored
      * fix imports
      
      * better error
      
      * up
      
      * finish
      35d81861
    • Patrick von Platen's avatar
      [Versatile Diffusion] Add versatile diffusion model (#1283) · 2625fb59
      Patrick von Platen authored
      
      
      * up
      
      * convert dual unet
      
      * revert dual attn
      
      * adapt for vd-official
      
      * test the full pipeline
      
      * mixed inference
      
      * mixed inference for text2img
      
      * add image prompting
      
      * fix clip norm
      
      * split text2img and img2img
      
      * fix format
      
      * refactor text2img
      
      * mega pipeline
      
      * add optimus
      
      * refactor image var
      
      * wip text_unet
      
      * text unet end to end
      
      * update tests
      
      * reshape
      
      * fix image to text
      
      * add some first docs
      
      * dual guided pipeline
      
      * fix token ratio
      
      * propose change
      
      * dual transformer as a native module
      
      * DualTransformer(nn.Module)
      
      * DualTransformer(nn.Module)
      
      * correct unconditional image
      
      * save-load with mega pipeline
      
      * remove image to text
      
      * up
      
      * uP
      
      * fix
      
      * up
      
      * final fix
      
      * remove_unused_weights
      
      * test updates
      
      * save progress
      
      * uP
      
      * fix dual prompts
      
      * some fixes
      
      * finish
      
      * style
      
      * finish renaming
      
      * up
      
      * fix
      
      * fix
      
      * fix
      
      * finish
      Co-authored-by: default avataranton-l <anton@huggingface.co>
      2625fb59
    • Suraj Patil's avatar
      StableDiffusionImageVariationPipeline (#1365) · 0eb507f2
      Suraj Patil authored
      
      
      * add StableDiffusionImageVariationPipeline
      
      * add ini init
      
      * use CLIPVisionModelWithProjection
      
      * fix _encode_image
      
      * add copied from
      
      * fix copies
      
      * add doc
      
      * handle tensor in _encode_image
      
      * add tests
      
      * correct model_id
      
      * remove copied from in enable_sequential_cpu_offload
      
      * fix tests
      
      * make slow tests pass
      
      * update slow tests
      
      * use temp model for now
      
      * fix test_stable_diffusion_img_variation_intermediate_state
      
      * fix test_stable_diffusion_img_variation_intermediate_state
      
      * check for torch.Tensor
      
      * quality
      
      * fix name
      
      * fix slow tests
      
      * install transformers from source
      
      * fix install
      
      * fix install
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      * input_image -> image
      
      * remove deprication warnings
      
      * fix test_stable_diffusion_img_variation_multiple_images
      
      * make flake happy
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      0eb507f2
  5. 22 Nov, 2022 1 commit
    • Manuel Brack's avatar
      Add Safe Stable Diffusion Pipeline (#1244) · e50c25d8
      Manuel Brack authored
      
      
      * Add pipeline_stable_diffusion_safe.py to pipelines
      
      * Fix repository consistency
      
      Ran make fix-copies after adding new pipline
      
      * Add Paper/Equation reference for parameters to doc string
      
      * Ensure code style and quality
      
      * Perform code refactoring
      
      * Fix copies inherited from merge with huggingface/main
      
      * Add docs
      
      * Fix code style
      
      * Fix errors in documentation
      
      * Fix refactoring error
      
      * remove debugging print statement
      
      * added Safe Latent Diffusion tests
      
      * Fix style
      
      * Fix style
      
      * Add pre-defined safety configurations
      
      * Fix line-break
      
      * fix some tests
      
      * finish
      
      * Change safety checker
      
      * Add missing safety_checker.py file
      
      * Remove unused imports
      Co-authored-by: default avatarPatrickSchrML <patrick_schramowski@hotmail.de>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      e50c25d8
  6. 18 Nov, 2022 1 commit
    • Clayton Sims's avatar
      Legacy Inpainting Pipeline for Onnx Models (#1237) · 30220905
      Clayton Sims authored
      
      
      * Add legacy inpainting pipeline compatibility for onnx
      
      * remove commented out line
      
      * Add onnx legacy inpainting test
      
      * Fix slow decorators
      
      * pep8 styling
      
      * isort styling
      
      * dummy object
      
      * ordering consistency
      
      * style
      
      * docstring styles
      
      * Refactor common prompt encoding pattern
      
      * Update tests to permanent repository home
      
      * support all available schedulers until ONNX IO binding is available
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * updated styling from PR suggested feedback
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      30220905
  7. 16 Nov, 2022 1 commit
  8. 15 Nov, 2022 2 commits
  9. 09 Nov, 2022 1 commit
  10. 08 Nov, 2022 1 commit
  11. 06 Nov, 2022 1 commit
    • Cheng Lu's avatar
      Add multistep DPM-Solver discrete scheduler (#1132) · b4a1ed85
      Cheng Lu authored
      
      
      * add dpmsolver discrete pytorch scheduler
      
      * fix some typos in dpm-solver pytorch
      
      * add dpm-solver pytorch in stable-diffusion pipeline
      
      * add jax/flax version dpm-solver
      
      * change code style
      
      * change code style
      
      * add docs
      
      * add `add_noise` method for dpmsolver
      
      * add pytorch unit test for dpmsolver
      
      * add dummy object for pytorch dpmsolver
      
      * Update src/diffusers/schedulers/scheduling_dpmsolver_discrete.py
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * Update tests/test_config.py
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * Update tests/test_config.py
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * resolve the code comments
      
      * rename the file
      
      * change class name
      
      * fix code style
      
      * add auto docs for dpmsolver multistep
      
      * add more explanations for the stabilizing trick (for steps < 15)
      
      * delete the dummy file
      
      * change the API name of predict_epsilon, algorithm_type and solver_type
      
      * add compatible lists
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      b4a1ed85
  12. 04 Nov, 2022 2 commits
  13. 03 Nov, 2022 6 commits
    • Patrick von Platen's avatar
      make style · bde4880c
      Patrick von Platen authored
      bde4880c
    • Patrick von Platen's avatar
      Correct VQDiffusion Pipeline import · 33108bfa
      Patrick von Platen authored
      33108bfa
    • Patrick von Platen's avatar
      fix copies · 988c8222
      Patrick von Platen authored
      988c8222
    • Suraj Patil's avatar
      default fast model loading 🔥 (#1115) · 74821781
      Suraj Patil authored
      
      
      * make accelerate hard dep
      
      * default fast init
      
      * move params to cpu when device map is None
      
      * handle device_map=None
      
      * handle torch < 1.9
      
      * remove device_map="auto"
      
      * style
      
      * add accelerate in torch extra
      
      * remove accelerate from extras["test"]
      
      * raise an error if torch is available but not accelerate
      
      * update installation docs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * improve defautl loading speed even further, allow disabling fats loading
      
      * address review comments
      
      * adapt the tests
      
      * fix test_stable_diffusion_fast_load
      
      * fix test_read_init
      
      * temp fix for dummy checks
      
      * Trigger Build
      
      * Apply suggestions from code review
      Co-authored-by: default avatarAnton Lozhkov <anton@huggingface.co>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarAnton Lozhkov <anton@huggingface.co>
      74821781
    • Will Berman's avatar
      VQ-diffusion (#658) · ef2ea33c
      Will Berman authored
      
      
      * Changes for VQ-diffusion VQVAE
      
      Add specify dimension of embeddings to VQModel:
      `VQModel` will by default set the dimension of embeddings to the number
      of latent channels. The VQ-diffusion VQVAE has a smaller
      embedding dimension, 128, than number of latent channels, 256.
      
      Add AttnDownEncoderBlock2D and AttnUpDecoderBlock2D to the up and down
      unet block helpers. VQ-diffusion's VQVAE uses those two block types.
      
      * Changes for VQ-diffusion transformer
      
      Modify attention.py so SpatialTransformer can be used for
      VQ-diffusion's transformer.
      
      SpatialTransformer:
      - Can now operate over discrete inputs (classes of vector embeddings) as well as continuous.
      - `in_channels` was made optional in the constructor so two locations where it was passed as a positional arg were moved to kwargs
      - modified forward pass to take optional timestep embeddings
      
      ImagePositionalEmbeddings:
      - added to provide positional embeddings to discrete inputs for latent pixels
      
      BasicTransformerBlock:
      - norm layers were made configurable so that the VQ-diffusion could use AdaLayerNorm with timestep embeddings
      - modified forward pass to take optional timestep embeddings
      
      CrossAttention:
      - now may optionally take a bias parameter for its query, key, and value linear layers
      
      FeedForward:
      - Internal layers are now configurable
      
      ApproximateGELU:
      - Activation function in VQ-diffusion's feedforward layer
      
      AdaLayerNorm:
      - Norm layer modified to incorporate timestep embeddings
      
      * Add VQ-diffusion scheduler
      
      * Add VQ-diffusion pipeline
      
      * Add VQ-diffusion convert script to diffusers
      
      * Add VQ-diffusion dummy objects
      
      * Add VQ-diffusion markdown docs
      
      * Add VQ-diffusion tests
      
      * some renaming
      
      * some fixes
      
      * more renaming
      
      * correct
      
      * fix typo
      
      * correct weights
      
      * finalize
      
      * fix tests
      
      * Apply suggestions from code review
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      
      * finish
      
      * finish
      
      * up
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      ef2ea33c
    • Revist's avatar
      feat: add repaint (#974) · d38c8043
      Revist authored
      
      
      * feat: add repaint
      
      * fix: fix quality check with `make fix-copies`
      
      * fix: remove old unnecessary arg
      
      * chore: change default to DDPM (looks better in experiments)
      
      * ".to(device)" changed to "device="
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * make generator device-specific
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * make generator device-specific and change shape
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * fix: add preprocessing for image and mask
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * fix: update test
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * Update src/diffusers/pipelines/repaint/pipeline_repaint.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Add docs and examples
      
      * Fix toctree
      Co-authored-by: default avatarfja <fja@zurich.ibm.com>
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarAnton Lozhkov <anton@huggingface.co>
      d38c8043
  14. 02 Nov, 2022 2 commits
    • Lewington-pitsos's avatar
      Integration tests precision improvement for inpainting (#1052) · 8ee21915
      Lewington-pitsos authored
      
      
      * improve test precision
      
      get tests passing with greater precision using lewington images
      
      * make old numpy load function a wrapper around a more flexible numpy loading function
      
      * adhere to black formatting
      
      * add more black formatting
      
      * adhere to isort
      
      * loosen precision and replace path
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      8ee21915
    • MatthieuTPHR's avatar
      Up to 2x speedup on GPUs using memory efficient attention (#532) · 98c42134
      MatthieuTPHR authored
      
      
      * 2x speedup using memory efficient attention
      
      * remove einops dependency
      
      * Swap K, M in op instantiation
      
      * Simplify code, remove unnecessary maybe_init call and function, remove unused self.scale parameter
      
      * make xformers a soft dependency
      
      * remove one-liner functions
      
      * change one letter variable to appropriate names
      
      * Remove Env variable dependency, remove MemoryEfficientCrossAttention class and use enable_xformers_memory_efficient_attention method
      
      * Add memory efficient attention toggle to img2img and inpaint pipelines
      
      * Clearer management of xformers' availability
      
      * update optimizations markdown to add info about memory efficient attention
      
      * add benchmarks for TITAN RTX
      
      * More detailed explanation of how the mem eff benchmark were ran
      
      * Removing autocast from optimization markdown
      
      * import_utils: import torch only if is available
      Co-authored-by: default avatarNouamane Tazi <nouamane98@gmail.com>
      98c42134
  15. 31 Oct, 2022 2 commits
  16. 28 Oct, 2022 3 commits
  17. 25 Oct, 2022 1 commit
  18. 24 Oct, 2022 1 commit
  19. 20 Oct, 2022 2 commits
  20. 19 Oct, 2022 2 commits
  21. 18 Oct, 2022 1 commit
  22. 14 Oct, 2022 1 commit
  23. 13 Oct, 2022 1 commit