提交

98 次代码提交

作者 SHA1 备注 提交日期
msiracusa 5a170d29cf Update pull_request_template.md after changing to MIT license 1.1.1 2024-05-03 18:03:21 -07:00
msiracusa c5be2739d0 Update CONTRIBUTING.md to reflect the MIT license 2024-05-03 17:59:39 -07:00
msiracusa 5d8cdbb92d Update LICENSE.md to MIT
Changing repository license to MIT
2024-05-03 17:58:28 -07:00
Joshua Park f7d2f5e9fb Update swift-argument-parser to latest minor version
This will also make ml-stable-diffusion more tolerant with regard to which swift-argument-parser version it needs, resulting in fewer version conflicts in Xcode projects.
2024-03-12 12:38:44 -07:00
Toby Roseman d456a972cd Merge pull request #311 from TobyRoseman/mbp-new-api
Applying mixed bit compression using new optimize API
2024-01-23 16:42:12 -08:00
Toby Roseman ec09fe064f code review feedback 2024-01-23 16:41:35 -08:00
Toby Roseman a9b84c658e Update Documentation 2024-01-23 08:32:22 -08:00
Toby Roseman 9a3d463397 Applying mixed bit compression using new optimize API 2024-01-17 15:43:08 -08:00
Stuart Moore 7449ce46a4 Update CGImage+vImage.swift 2023-11-14 10:35:27 -08:00
Stuart Moore 5c62fab073 Use sRGB colorspace 2023-11-14 10:35:27 -08:00
Toby Roseman 3a0aeba5e5 Merge pull request #296 from TobyRoseman/compiled_models
Compiled Models in Python
2023-11-07 13:18:01 -08:00
Toby Roseman 46c94e8a86 Link to Core ML documentation about why compiled models are faster 2023-11-07 12:46:13 -08:00
Toby Roseman 4c54204bb0 Compiled Models in Python 2023-11-07 12:13:31 -08:00
Toby Roseman bea04420b5 Merge pull request #287 from TobyRoseman/minor-fix
Fix pipeline.py for Python 3.8
2023-10-24 08:26:53 -07:00
Toby Roseman d159b9254c Fix pipeline.py for Python 3.8 2023-10-23 10:27:56 -07:00
Atila Orhon 567dbf2757 fixes #281 2023-10-20 22:45:43 -07:00
Jiangdi f4466f0b73 fix error (#279) 2023-10-10 12:15:08 -07:00
Zach Nagengast 7fe1bf23b9 Cast safety_checker to float32 (#276) 2023-10-06 20:54:39 -07:00
Atila Orhon 11ba3a0965 Add custom_vae_version in MBP pre-analysis 2023-09-30 19:44:01 -07:00
Atila Orhon 96c044e07b Add iPhone 12 Pro Benchmark 2023-09-28 14:34:09 -07:00
Atila Orhon 081a8cb2cc v1.1 1.1.0 2023-09-28 07:26:41 -07:00
Pedro Cuenca 94814cfa41 Sigma and timestep spacing configuration for DPMSolverMultistepScheduler (#265)
* `leading` timestep spacing for DPMSolverMultistepScheduler

* Karras sigmas and timesteps

* Make sigmas/timesteps externally configurable
2023-09-27 09:35:39 -07:00
Atila Orhon d0d05ce44d Fix compute unit for chunk_mlprogram parity checks 2023-09-26 13:21:15 -07:00
Hector Lopez Hernandez, PhD f3a212491c Xl python inference (#261)
* Updated pipeline.py for XL inference

* cleaned up

* Add shape handling for UNET time_ids shape

* added support for loading from CompiledMLModel
2023-09-26 13:12:07 -07:00
Zach Nagengast 94dfc6b548 Support for SDXL refiner (#227)
* Initial support for SDXL refiner

* Cleanup

* Add arg for converting Unet in float32 precision

* Setup scale factor with pipeline in CLI

* Update cli arg and future warning

* Bundle refiner unet if specified

* Update script for bundled refiner

- Also skip loading model if check_output_correctness is missing, since the model does not require inferencing at conversion time

* Flip skip_model_load bool

* Cleanup

* Support bundled UnetRefiner

* Add seperate refiner config value

- Includes unloading base unet when swapping to refiner

* Update readme for SDXL refiner

* Add condition for new SDXL coreml input features

* Revert pipeline interface change, add extra logging on pipe load

* Reset model_version after refiner conversion

* Reset model_version before refiner conversion but after pipe init

* Add refiner chunking

* Ensure unets are unloaded for reduceMemory true

* Handle missing UnetRefiner.mlmodelc on pipeline load

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* Prewarm refiner on load, unload on complete

* Force cpu_and_gpu for VAE until it can be fixed

* Include output dtype of np.float32 for all conversions

* Allow a custom VAE to be converted.

* Revert hardcoded reduceMemory

* Fix merge

* Default chunking arg for --merge-chunks-in-pipeline-model when called from torch2coreml

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2023-09-26 13:09:58 -07:00
Atila Orhon d22986190b Support pipeline model creation for chunks 2023-09-23 09:24:59 -07:00
Atila Orhon e3c1e36e18 SDXL refiner mixed-bit palettization pre-analysis 2023-09-23 09:24:59 -07:00
Toby Roseman cf4afe150b Fix boundary var issue when chunking model with coremltools 7.0 (#259) 2023-09-20 14:01:19 -07:00
Liu Liu 7b59c2b663 Add NvRandomSource (#257)
Draw Things 1.20230913.1 released with NVIDIA GPU Compatible mode. See
example: https://twitter.com/drawthingsapp/status/1702387783166476689

This is the implementation that should be compatible with the
ml-stable-diffusion project.
2023-09-14 16:34:29 -07:00
Ryu-ga c5063225aa Update Decoder.swift (#249)
* Update Decoder.swift

* Update Encoder.swift

---------

Co-authored-by: Ryu-ga <frech5679@icloud.com>
2023-09-01 11:50:01 -07:00
Atila Orhon a56e10232d Fixes #243
Co-authored-by: TBPer <thanawat.boonmee@gmail.com>
2023-08-30 14:02:20 -07:00
Atila Orhon ebff5f7402 fixes #246 2023-08-29 06:43:07 -07:00
Aseem Wadhwa 35613e5d34 update chunking script to work with models that contains compressed weights, i.e. constexpr* ops (#245) 2023-08-29 04:57:30 -07:00
Atila Orhon 40ff5f5f1f fixes #244 2023-08-28 10:51:47 -07:00
Pedro Cuenca 80c0551419 CGImage to shaped array fix (#239)
* Take row padding into account.

* Rename symbols for clarity.
2023-08-26 23:51:58 -07:00
Pedro Cuenca df1c41c373 Upgrade coremltools, transformers; remove attn workaround (#241) 2023-08-24 22:17:44 +03:00
Pedro Cuenca 27df66021d Remove mlpackage save workaround. (#240)
https://github.com/apple/coremltools/issues/1680 has been resolved in
coremltools 7.0b1, which is now required. The reason for addressing this
change now is that reloading the model before save may incur a
performance cost (specially on SDXL models) due to `ANECompilerService`
triggering and executing for a long time.
2023-08-24 22:16:28 +03:00
Thibault Castells dc8deb3b1e Fix multiple issues in mixed bit compression pre analysis (#231)
* fix multiple issues in mixed bit compression pre analysis: wrong dtype, cannot change default nbits and ImportError

* fixed dtype issue in fake_palettize function

---------

Co-authored-by: Thibault <thibault@Thibaults-Mac-mini.local>
2023-08-22 00:00:22 +03:00
Mustafa Ateş Uzun 599bd577ed fix: read.md word spelling (#234) 2023-08-20 23:56:23 +03:00
Zach Nagengast b392a0aca0 Use denoised latent for final decoder (#230)
* Send denoised latent to final decoder

- Previously it was sending the noisy latent from the last timestep

* Include fix for no-xl pipeline
2023-08-08 10:47:42 -07:00
Atila Orhon ce8ee78e28 Fix SDXL vae scale factor
Co-authored-by: Liu Liu <i@liuliu.me>
Co-authored-by: Brad Herman <brad.herman@gmail.com>
2023-08-06 01:39:23 -07:00
Atila Orhon 7e106460e3 fix import 2023-08-02 20:30:45 -10:00
Atila Orhon 8cf34376f9 SDXL and other improvements
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Zach Nagengast <zacharynagengast@gmail.com>
2023-07-27 09:08:30 -10:00
Atila Orhon a57d127606 Mixed-bit Palettization
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2023-07-27 09:07:44 -10:00
Atila Orhon f741511ef2 import Accelerate 2023-07-19 20:56:57 -07:00
JustinMeans b8b5e886df Update ControlNet.swift (#214)
Speed up multi-control net by implementing Accelerate vectorized routines.
2023-07-18 09:34:25 -07:00
Zach Nagengast b61c9aea05 Support for denoised latent images on progress updates (#210)
* Use denoised latents for currentLatentSamples

* Remove incorrect scheduler reference

* Add denoise option to preserve original functionality
2023-07-14 15:52:13 -07:00
Zsolt Váradi db13060fec Restore compatibility with Xcode 14.3/macOS SDK 13.4 (#208) 2023-07-12 11:49:22 -07:00
Zsolt Váradi 823d21ecf4 Extend ControlNet image conversion with hole punching for InPaint (#205)
* Extend ControlNet image conversion with hole punching for InPaint

The inpainting ControlNet model expects the masked areas to be filled with -1. This never occured with the original conversion, as the pixel data was converted to values between [0;1], thus the inpainting CN model never had any effect (apart from maybe generating artifacts).

This commit uses the _previously discarded_ alpha channel of the source image to mark masked pixels: any non-opaque pixel is cleared out to -1.
For an end-user, this allows creating masks simply by erasing areas with Preview to transparent, saving the result as PNG, and feeding it to the ControlNet.

* Mask only fully transparent pixels
2023-07-09 21:11:26 -07:00
Pedro Cuenca 48f07f2489 Links to quantized models in the Hugging Face hub. (#193) 2023-06-14 09:03:59 -07:00