Text-to-Image
ZeroModels
Keras
PyTorch
JAX
TensorFlow
English
stable-diffusion
stable-diffusion-diffusers
diffusion
latent-diffusion
Instructions to use zeromodels/stable-diffusion-2-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/stable-diffusion-2-1 with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/stable-diffusion-2-1") - Keras
How to use zeromodels/stable-diffusion-2-1 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/stable-diffusion-2-1") - Notebooks
- Google Colab
- Kaggle
Add the attribution notice and the modification statement to the model card
Browse files
README.md
CHANGED
|
@@ -79,7 +79,7 @@ Load any Stable Diffusion 2.x checkpoint the same way with `from_weights("zeromo
|
|
| 79 |
| `stable-diffusion-2` | [zeromodels/stable-diffusion-2](https://huggingface.co/zeromodels/stable-diffusion-2) | 768px, v-prediction: 2-base + 150k steps at 768px |
|
| 80 |
| `stable-diffusion-2-1-base` | [zeromodels/stable-diffusion-2-1-base](https://huggingface.co/zeromodels/stable-diffusion-2-1-base) | 512px, epsilon: 2-base + 220k steps at 512px (punsafe 0.98) |
|
| 81 |
| `stable-diffusion-2-1` | [zeromodels/stable-diffusion-2-1](https://huggingface.co/zeromodels/stable-diffusion-2-1) | 768px, v-prediction: 2 + 55k steps (punsafe 0.1) + 155k steps (punsafe 0.98) at 768px |
|
| 82 |
-
| `sd-turbo` | [zeromodels/sd-turbo](https://huggingface.co/zeromodels/sd-turbo) | 512px, epsilon, Euler (trailing spacing), 1 to 4 steps, no guidance: SD 2.1 distilled with Adversarial Diffusion Distillation (
|
| 83 |
|
| 84 |
## Tips
|
| 85 |
|
|
@@ -99,9 +99,16 @@ Load any Stable Diffusion 2.x checkpoint the same way with `from_weights("zeromo
|
|
| 99 |
|
| 100 |
## License
|
| 101 |
|
| 102 |
-
The weights are redistributed under the
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
## Special Thanks
|
| 107 |
|
|
|
|
| 79 |
| `stable-diffusion-2` | [zeromodels/stable-diffusion-2](https://huggingface.co/zeromodels/stable-diffusion-2) | 768px, v-prediction: 2-base + 150k steps at 768px |
|
| 80 |
| `stable-diffusion-2-1-base` | [zeromodels/stable-diffusion-2-1-base](https://huggingface.co/zeromodels/stable-diffusion-2-1-base) | 512px, epsilon: 2-base + 220k steps at 512px (punsafe 0.98) |
|
| 81 |
| `stable-diffusion-2-1` | [zeromodels/stable-diffusion-2-1](https://huggingface.co/zeromodels/stable-diffusion-2-1) | 768px, v-prediction: 2 + 55k steps (punsafe 0.1) + 155k steps (punsafe 0.98) at 768px |
|
| 82 |
+
| `sd-turbo` | [zeromodels/sd-turbo](https://huggingface.co/zeromodels/sd-turbo) | 512px, epsilon, Euler (trailing spacing), 1 to 4 steps, no guidance: SD 2.1 distilled with Adversarial Diffusion Distillation (Stability AI Community License) |
|
| 83 |
|
| 84 |
## Tips
|
| 85 |
|
|
|
|
| 99 |
|
| 100 |
## License
|
| 101 |
|
| 102 |
+
The weights are redistributed under the [CreativeML Open RAIL++-M License](https://huggingface.co/sd2-community/stable-diffusion-2/blob/main/LICENSE-MODEL) of the upstream
|
| 103 |
+
checkpoint, including its use-based restrictions. By using them you agree to those terms.
|
| 104 |
+
|
| 105 |
+
## Notice
|
| 106 |
+
|
| 107 |
+
Modifications by zeromodels (https://github.com/IMvision12/ZeroModels): the checkpoint
|
| 108 |
+
released at https://huggingface.co/sd2-community/stable-diffusion-2-1 was converted to the
|
| 109 |
+
Keras 3 weights layout of zeromodels (`model.weights.h5, zm_config.json, tokenizer.json`),
|
| 110 |
+
stored in float32 as released. The model architecture and the parameter values are
|
| 111 |
+
unchanged; the weight names and the file format differ from the release.
|
| 112 |
|
| 113 |
## Special Thanks
|
| 114 |
|