StableDiffusion3TextToImagePreprocessor classkeras_hub.models.StableDiffusion3TextToImagePreprocessor(
clip_l_preprocessor, clip_g_preprocessor, t5_preprocessor=None, **kwargs
)
Stable Diffusion 3 text-to-image model preprocessor.
This preprocessing layer is meant for use with
keras_hub.models.StableDiffusion3TextToImage.
For use with generation, the layer exposes one methods
generate_preprocess().
Arguments
keras_hub.models.CLIPPreprocessor instance.keras_hub.models.CLIPPreprocessor instance.keras_hub.models.T5Preprocessor instance.Guides and examples using StableDiffusion3TextToImagePreprocessor
from_preset methodStableDiffusion3TextToImagePreprocessor.from_preset(
preset, config_file="preprocessor.json", **kwargs
)
Instantiate a keras_hub.models.Preprocessor from a model preset.
A preset is a directory of configs, weights and other file assets used
to save and load a pre-trained model. The preset can be passed as
one of:
'bert_base_en''kaggle://user/bert/keras/bert_base_en''hf://user/bert_base_en''./bert_base_en'For any Preprocessor subclass, you can run cls.presets.keys() to
list all built-in presets available on the class.
As there are usually multiple preprocessing classes for a given model,
this method should be called on a specific subclass like
keras_hub.models.BertTextClassifierPreprocessor.from_preset().
Arguments
Examples
# Load a preprocessor for Gemma generation.
preprocessor = keras_hub.models.CausalLMPreprocessor.from_preset(
"gemma_2b_en",
)
# Load a preprocessor for Bert classification.
preprocessor = keras_hub.models.TextClassifierPreprocessor.from_preset(
"bert_base_en",
)
| Preset | Parameters | Description |
|---|---|---|
| stable_diffusion_3_medium | 2.99B | 3 billion parameter, including CLIP L and CLIP G text encoders, MMDiT generative model, and VAE autoencoder. Developed by Stability AI. |
| stable_diffusion_3.5_medium | 3.37B | 3 billion parameter, including CLIP L and CLIP G text encoders, MMDiT-X generative model, and VAE autoencoder. Developed by Stability AI. |
| stable_diffusion_3.5_large | 9.05B | 9 billion parameter, including CLIP L and CLIP G text encoders, MMDiT generative model, and VAE autoencoder. Developed by Stability AI. |
| stable_diffusion_3.5_large_turbo | 9.05B | 9 billion parameter, including CLIP L and CLIP G text encoders, MMDiT generative model, and VAE autoencoder. A timestep-distilled version that eliminates classifier-free guidance and uses fewer steps for generation. Developed by Stability AI. |
Guides and examples using from_preset