Skip to content

Commit 3e398ad

Browse files
Update README.md
1 parent 734fbc2 commit 3e398ad

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ This repository comprises
1313

1414
## Installation
1515

16-
<details>
17-
1816
The following installation steps are required for:
1917
- MLX inference
2018
- PyTorch to Core ML model conversion
@@ -31,33 +29,37 @@ pip install -e .
3129
### Hugging Face Hub Credentials
3230

3331
[Stable Diffusion 3](https://huggingface.co/stabilityai/stable-diffusion-3-medium) requires users to accept the terms before downloading the checkpoint. Once you accept the terms, sign in with your Hugging Face hub READ token as below:
32+
> [!IMPORTANT]
33+
> If using a fine-grained token, it is also necessary to [edit permissions](https://huggingface.co/settings/tokens) to allow `Read access to contents of all public gated repos you can access`
3434
3535
```bash
3636
huggingface-cli login --token YOUR_HF_HUB_TOKEN
3737
```
3838

39-
</details>
40-
4139
## <a name="converting-models-to-coreml"></a> Converting Models from PyTorch to Core ML
4240

4341
<details>
4442
<summary> Click to expand </summary>
4543

4644
**Step 1:** Follow the installation steps from the previous section
47-
**Step 2:** Prepare the denoise model (MMDiT) Core ML model files (`.mlpackage`)
45+
46+
**Step 2:** Verify you've accepted the [StabilityAI license terms](https://huggingface.co/stabilityai/stable-diffusion-3-medium) and have allowed gated access on your [HuggingFace token](https://huggingface.co/settings/tokens)
47+
48+
**Step 3:** Prepare the denoise model (MMDiT) Core ML model files (`.mlpackage`)
4849

4950
```shell
50-
python -m tests.torch2coreml.test_mmdit --sd3-ckpt-path <path-to-sd3-mmdit.safetensors or model-version-string-from-hub> --model-version {2b} -o <output-mlpackages-directory> --latent-size {64, 128}
51+
python -m tests.torch2coreml.test_mmdit --sd3-ckpt-path stabilityai/stable-diffusion-3-medium --model-version 2b -o <output-mlpackages-directory> --latent-size {64, 128}
5152
```
5253

53-
**Step 3:** Prepare the VAE Decoder Core ML model files (`.mlpackage`)
54+
**Step 4:** Prepare the VAE Decoder Core ML model files (`.mlpackage`)
5455

5556
```shell
56-
python -m tests.torch2coreml.test_vae --sd3-ckpt-path <path-to-sd3-mmdit.safetensors or model-version-string-from-hub> -o <output-mlpackages-directory> --latent-size {64, 128}
57+
python -m tests.torch2coreml.test_vae --sd3-ckpt-path stabilityai/stable-diffusion-3-medium -o <output-mlpackages-directory> --latent-size {64, 128}
5758
```
5859

5960
Note:
60-
- `--sd3-ckpt-path` can be a path to a local `.safetensors` file or a HuggingFace repo (e.g. `stabilityai/stable-diffusion-3-medium`).
61+
- `--sd3-ckpt-path` can be a path any HuggingFace repo (e.g. `stabilityai/stable-diffusion-3-medium`).
62+
- `--local-ckpt` can be a path to a local `sd3_medium.safetensors` file
6163
</details>
6264

6365
## <a name="image-generation-with-python-mlx"></a> Image Generation with Python MLX

0 commit comments

Comments
 (0)