Update README.md
Browse files
README.md
CHANGED
|
@@ -3,6 +3,7 @@ license: creativeml-openrail-m
|
|
| 3 |
tags:
|
| 4 |
- stable-diffusion
|
| 5 |
- stable-diffusion-1-5
|
|
|
|
| 6 |
- euler
|
| 7 |
- axera
|
| 8 |
- ax-m1
|
|
@@ -10,49 +11,120 @@ tags:
|
|
| 10 |
- axmodel
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# AX-M1 (AX8850) —
|
| 14 |
|
| 15 |
-
This repository hosts the compiled **`.axmodel`** weights for running **Stable Diffusion 1.5
|
| 16 |
|
| 17 |
**Runtime / scripts (GitHub):** https://github.com/Mojo24x7/SD1.5_AXM1-AX8850_Euler
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
Main weights:
|
| 22 |
-
- `sd15_text_encoder_sim.axmodel` — CLIP text encoder (prompt → embeddings)
|
| 23 |
- `unet.axmodel` — UNet denoiser (latent diffusion core)
|
| 24 |
- `vae_decoder.axmodel` — VAE decoder (latent → RGB image)
|
| 25 |
|
| 26 |
-
Optional (for img2img / masked workflows):
|
| 27 |
- `vae_encoder.axmodel` — VAE encoder (RGB → latent)
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
|
| 35 |
-
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
- `timestep` `[1]` `int32`
|
| 39 |
-
- `encoder_hidden_states` `[1,77,768]` `fp32`
|
| 40 |
-
- output: `[1,4,64,64]` `fp32`
|
| 41 |
|
| 42 |
-
- **
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
-
These weights are
|
| 49 |
-
- run **EulerDiscreteScheduler**
|
| 50 |
-
- ensure `input_ids` and `timestep` are **int32**
|
| 51 |
-
- run text_encoder → UNet → VAE decode
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
-
-
|
| 58 |
-
-
|
|
|
|
| 3 |
tags:
|
| 4 |
- stable-diffusion
|
| 5 |
- stable-diffusion-1-5
|
| 6 |
+
- realistic-vision
|
| 7 |
- euler
|
| 8 |
- axera
|
| 9 |
- ax-m1
|
|
|
|
| 11 |
- axmodel
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# AX-M1 (AX8850) — Realistic Vision (SD 1.5) **Euler 512** (AXMODEL weights)
|
| 15 |
|
| 16 |
+
This repository hosts the compiled **`.axmodel`** weights for running **Realistic Vision (Stable Diffusion 1.5–based)** with **Euler / EulerDiscreteScheduler** at **512×512** on **Radxa AI Core AX-M1 (AX8850)**.
|
| 17 |
|
| 18 |
**Runtime / scripts (GitHub):** https://github.com/Mojo24x7/SD1.5_AXM1-AX8850_Euler
|
| 19 |
|
| 20 |
+
> These files are **compiled AXERA artifacts** (`.axmodel`) intended for AX-M1 / AX8850 inference via AXCLRT/axengine. They are not raw PyTorch weights.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## What’s inside
|
| 25 |
|
| 26 |
Main weights:
|
| 27 |
+
- `sd15_text_encoder_sim.axmodel` — CLIP text encoder (prompt → text embeddings)
|
| 28 |
- `unet.axmodel` — UNet denoiser (latent diffusion core)
|
| 29 |
- `vae_decoder.axmodel` — VAE decoder (latent → RGB image)
|
| 30 |
|
| 31 |
+
Optional (needed for img2img / masked workflows):
|
| 32 |
- `vae_encoder.axmodel` — VAE encoder (RGB → latent)
|
| 33 |
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Download
|
| 37 |
+
|
| 38 |
+
### Option A — Git LFS (recommended)
|
| 39 |
+
```bash
|
| 40 |
+
git lfs install
|
| 41 |
+
git clone https://huggingface.co/Mojo24x7/sd15-axm1-euler512-axmodels
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
### Option B — Hugging Face CLI
|
| 45 |
+
```bash
|
| 46 |
+
pip install -U "huggingface_hub[cli]"
|
| 47 |
+
huggingface-cli download Mojo24x7/sd15-axm1-euler512-axmodels \
|
| 48 |
+
--local-dir sd15-axm1-euler512-axmodels
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## Where to place the files
|
| 54 |
+
|
| 55 |
+
In the runtime repo, place these into:
|
| 56 |
+
|
| 57 |
+
```text
|
| 58 |
+
./axmodels/
|
| 59 |
+
sd15_text_encoder_sim.axmodel
|
| 60 |
+
unet.axmodel
|
| 61 |
+
vae_decoder.axmodel
|
| 62 |
+
vae_encoder.axmodel (optional)
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
The runtime/scripts repo also expects supporting assets (tokenizer, scheduler config, VAE config). See the GitHub repo for the full folder layout.
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## Expected model I/O (Euler 512)
|
| 70 |
+
|
| 71 |
+
### Text encoder
|
| 72 |
+
- input: `input_ids` `[1,77]` `int32`
|
| 73 |
+
- output: `last_hidden_state` `[1,77,768]` `fp32`
|
| 74 |
+
|
| 75 |
+
### UNet
|
| 76 |
+
- inputs:
|
| 77 |
+
- `sample` `[1,4,64,64]` `fp32` *(512/8 = 64 latent resolution)*
|
| 78 |
+
- `timestep` `[1]` `int32`
|
| 79 |
+
- `encoder_hidden_states` `[1,77,768]` `fp32`
|
| 80 |
+
- output: `[1,4,64,64]` `fp32`
|
| 81 |
+
|
| 82 |
+
### VAE decoder
|
| 83 |
+
- input: `latent` `[1,4,64,64]` `fp32`
|
| 84 |
+
- output: `[1,3,512,512]` `fp32` *(commonly in `[-1..1]` before postprocess)*
|
| 85 |
|
| 86 |
+
### VAE encoder (optional)
|
| 87 |
+
- input: image `[1,3,512,512]` `fp32`
|
| 88 |
+
- output: latent `[1,4,64,64]` `fp32`
|
| 89 |
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Runtime notes (important)
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
- The runtime scripts use **EulerDiscreteScheduler**.
|
| 95 |
+
- Ensure `input_ids` and `timestep` are **int32** (int64 will fail in many AX pipelines).
|
| 96 |
+
- Typical flow:
|
| 97 |
+
1) tokenize → text encoder
|
| 98 |
+
2) scheduler loop → UNet
|
| 99 |
+
3) VAE decode → image postprocess
|
| 100 |
+
|
| 101 |
+
---
|
| 102 |
|
| 103 |
+
## Base model: Realistic Vision
|
| 104 |
|
| 105 |
+
These compiled weights are derived from **Realistic Vision**, which is **Stable Diffusion 1.5–based**.
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
+
When you reuse or redistribute these artifacts:
|
| 108 |
+
- Follow the **CreativeML OpenRAIL-M** license terms.
|
| 109 |
+
- Also follow **Realistic Vision** upstream terms (model card/license) where applicable.
|
| 110 |
+
|
| 111 |
+
> Tip: If you want maximum clarity, add the exact Realistic Vision version you used (e.g., “Realistic Vision vX.X”) and link to its model card.
|
| 112 |
+
|
| 113 |
+
---
|
| 114 |
+
|
| 115 |
+
## Troubleshooting
|
| 116 |
+
|
| 117 |
+
- If cloning is slow or files look tiny: you likely don’t have LFS installed.
|
| 118 |
+
- Run `git lfs install` and re-clone.
|
| 119 |
+
- If the runtime says a model input type is wrong:
|
| 120 |
+
- Verify `timestep` is `int32`
|
| 121 |
+
- Verify `input_ids` is `int32`
|
| 122 |
+
- If outputs look washed out:
|
| 123 |
+
- Check VAE postprocess and scaling (model outputs typically need `(x * 0.5 + 0.5)` then clamp to `[0..1]`).
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
|
| 127 |
+
## Credits
|
| 128 |
|
| 129 |
+
- **AX-M1 / AX8850** compilation and runtime packaging: Mojo24x7
|
| 130 |
+
- Base architecture: Stable Diffusion 1.5 family (Realistic Vision derivative)
|