Instructions to use keras/stable_diffusion_3_medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/stable_diffusion_3_medium with KerasHub:
import keras_hub # Load TextToImage model (optional: use half precision for inference) text_to_image = keras_hub.models.TextToImage.from_preset("hf://keras/stable_diffusion_3_medium", dtype="bfloat16") # Generate images with a TextToImage model. text_to_image.generate("Astronaut in a jungle")import keras_hub # Create a ImageToImage model task = keras_hub.models.ImageToImage.from_preset("hf://keras/stable_diffusion_3_medium")import keras_hub # Create a Inpaint model task = keras_hub.models.Inpaint.from_preset("hf://keras/stable_diffusion_3_medium")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/stable_diffusion_3_medium") - Keras
How to use keras/stable_diffusion_3_medium 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://keras/stable_diffusion_3_medium") - Notebooks
- Google Colab
- Kaggle
Update README.md with new model card content
Browse files
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
| 3 |
---
|
| 4 |
-
##
|
| 5 |
# Stable Diffusion 3 Medium
|
| 6 |

|
| 7 |
|
|
@@ -28,7 +28,7 @@ Please note: this model is released under the Stability Community License. For E
|
|
| 28 |
### Model card
|
| 29 |
https://huggingface.co/stabilityai/stable-diffusion-3-medium
|
| 30 |
|
| 31 |
-
##
|
| 32 |
```python
|
| 33 |
# Pretrained Stable Diffusion 3 model.
|
| 34 |
model = keras_hub.models.StableDiffusion3Backbone.from_preset(
|
|
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
| 3 |
---
|
| 4 |
+
## Model Overview
|
| 5 |
# Stable Diffusion 3 Medium
|
| 6 |

|
| 7 |
|
|
|
|
| 28 |
### Model card
|
| 29 |
https://huggingface.co/stabilityai/stable-diffusion-3-medium
|
| 30 |
|
| 31 |
+
## Example Usage
|
| 32 |
```python
|
| 33 |
# Pretrained Stable Diffusion 3 model.
|
| 34 |
model = keras_hub.models.StableDiffusion3Backbone.from_preset(
|