keras / stable_diffusion_3_medium

huggingface.co
Total runs: 14
24-hour runs: 0
7-day runs: -8
30-day runs: 5
Model's Last Updated: October 28 2025
text-to-image

Introduction of stable_diffusion_3_medium

Model Details of stable_diffusion_3_medium

Model Overview

Stable Diffusion 3 Medium

demo

Model

mmdit

Stable Diffusion 3 Medium is a Multimodal Diffusion Transformer (MMDiT) text-to-image model that features greatly improved performance in image quality, typography, complex prompt understanding, and resource-efficiency.

For more technical details, please refer to the Research paper .

Please note: this model is released under the Stability Community License. For Enterprise License visit Stability.ai or contact us for commercial licensing details.

Model Description
Model card

https://huggingface.co/stabilityai/stable-diffusion-3-medium

Example Usage
# Pretrained Stable Diffusion 3 model.
model = keras_hub.models.StableDiffusion3Backbone.from_preset(
    "stable_diffusion_3_medium"
)

# Randomly initialized Stable Diffusion 3 model with custom config.
vae = keras_hub.models.VAEBackbone(...)
clip_l = keras_hub.models.CLIPTextEncoder(...)
clip_g = keras_hub.models.CLIPTextEncoder(...)
model = keras_hub.models.StableDiffusion3Backbone(
    mmdit_patch_size=2,
    mmdit_num_heads=4,
    mmdit_hidden_dim=256,
    mmdit_depth=4,
    mmdit_position_size=192,
    vae=vae,
    clip_l=clip_l,
    clip_g=clip_g,
)

# Image to image example
image_to_image = keras_hub.models.StableDiffusion3ImageToImage.from_preset(
        "stable_diffusion_3_medium", height=512, width=512
)
image_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    }
)

# Generate with batched prompts.
image_to_image.generate(
    {
        "images": np.ones((2, 512, 512, 3), dtype="float32"),
        "prompts": ["cute wallpaper art of a cat", "cute wallpaper art of a dog"],
    }
)

# Generate with different `num_steps`, `guidance_scale` and `strength`.
image_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    }
    num_steps=50,
    guidance_scale=5.0,
    strength=0.6,
)

# Generate with `negative_prompts`.
text_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
        "negative_prompts": "green color",
    }
)

# inpainting example
reference_image = np.ones((1024, 1024, 3), dtype="float32")
reference_mask = np.ones((1024, 1024), dtype="float32")
inpaint = keras_hub.models.StableDiffusion3Inpaint.from_preset(
    "stable_diffusion_3_medium", height=512, width=512
)
inpaint.generate(
    reference_image,
    reference_mask,
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
)

# Generate with batched prompts.
reference_images = np.ones((2, 512, 512, 3), dtype="float32")
reference_mask = np.ones((2, 1024, 1024), dtype="float32")
inpaint.generate(
    reference_images,
    reference_mask,
    ["cute wallpaper art of a cat", "cute wallpaper art of a dog"]
)

# Generate with different `num_steps`, `guidance_scale` and `strength`.
inpaint.generate(
    reference_image,
    reference_mask,
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    num_steps=50,
    guidance_scale=5.0,
    strength=0.6,
)

# text to image example
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
    "stable_diffusion_3_medium", height=512, width=512
)
text_to_image.generate(
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
)

# Generate with batched prompts.
text_to_image.generate(
    ["cute wallpaper art of a cat", "cute wallpaper art of a dog"]
)

# Generate with different `num_steps` and `guidance_scale`.
text_to_image.generate(
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    num_steps=50,
    guidance_scale=5.0,
)

# Generate with `negative_prompts`.
text_to_image.generate(
    {
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
        "negative_prompts": "green color",
    }
)
Example Usage with Hugging Face URI
# Pretrained Stable Diffusion 3 model.
model = keras_hub.models.StableDiffusion3Backbone.from_preset(
    "hf://keras/stable_diffusion_3_medium"
)

# Randomly initialized Stable Diffusion 3 model with custom config.
vae = keras_hub.models.VAEBackbone(...)
clip_l = keras_hub.models.CLIPTextEncoder(...)
clip_g = keras_hub.models.CLIPTextEncoder(...)
model = keras_hub.models.StableDiffusion3Backbone(
    mmdit_patch_size=2,
    mmdit_num_heads=4,
    mmdit_hidden_dim=256,
    mmdit_depth=4,
    mmdit_position_size=192,
    vae=vae,
    clip_l=clip_l,
    clip_g=clip_g,
)

# Image to image example
image_to_image = keras_hub.models.StableDiffusion3ImageToImage.from_preset(
        "hf://keras/stable_diffusion_3_medium", height=512, width=512
)
image_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    }
)

# Generate with batched prompts.
image_to_image.generate(
    {
        "images": np.ones((2, 512, 512, 3), dtype="float32"),
        "prompts": ["cute wallpaper art of a cat", "cute wallpaper art of a dog"],
    }
)

# Generate with different `num_steps`, `guidance_scale` and `strength`.
image_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    }
    num_steps=50,
    guidance_scale=5.0,
    strength=0.6,
)

# Generate with `negative_prompts`.
text_to_image.generate(
    {
        "images": np.ones((512, 512, 3), dtype="float32"),
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
        "negative_prompts": "green color",
    }
)

# inpainting example
reference_image = np.ones((1024, 1024, 3), dtype="float32")
reference_mask = np.ones((1024, 1024), dtype="float32")
inpaint = keras_hub.models.StableDiffusion3Inpaint.from_preset(
    "hf://keras/stable_diffusion_3_medium", height=512, width=512
)
inpaint.generate(
    reference_image,
    reference_mask,
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
)

# Generate with batched prompts.
reference_images = np.ones((2, 512, 512, 3), dtype="float32")
reference_mask = np.ones((2, 1024, 1024), dtype="float32")
inpaint.generate(
    reference_images,
    reference_mask,
    ["cute wallpaper art of a cat", "cute wallpaper art of a dog"]
)

# Generate with different `num_steps`, `guidance_scale` and `strength`.
inpaint.generate(
    reference_image,
    reference_mask,
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    num_steps=50,
    guidance_scale=5.0,
    strength=0.6,
)

# text to image example
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
    "hf://keras/stable_diffusion_3_medium", height=512, width=512
)
text_to_image.generate(
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
)

# Generate with batched prompts.
text_to_image.generate(
    ["cute wallpaper art of a cat", "cute wallpaper art of a dog"]
)

# Generate with different `num_steps` and `guidance_scale`.
text_to_image.generate(
    "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
    num_steps=50,
    guidance_scale=5.0,
)

# Generate with `negative_prompts`.
text_to_image.generate(
    {
        "prompts": "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
        "negative_prompts": "green color",
    }
)

Runs of keras stable_diffusion_3_medium on huggingface.co

14
Total runs
0
24-hour runs
-1
3-day runs
-8
7-day runs
5
30-day runs

More Information About stable_diffusion_3_medium huggingface.co Model

stable_diffusion_3_medium huggingface.co

stable_diffusion_3_medium huggingface.co is an AI model on huggingface.co that provides stable_diffusion_3_medium's model effect (), which can be used instantly with this keras stable_diffusion_3_medium model. huggingface.co supports a free trial of the stable_diffusion_3_medium model, and also provides paid use of the stable_diffusion_3_medium. Support call stable_diffusion_3_medium model through api, including Node.js, Python, http.

stable_diffusion_3_medium huggingface.co Url

https://huggingface.co/keras/stable_diffusion_3_medium

keras stable_diffusion_3_medium online free

stable_diffusion_3_medium huggingface.co is an online trial and call api platform, which integrates stable_diffusion_3_medium's modeling effects, including api services, and provides a free online trial of stable_diffusion_3_medium, you can try stable_diffusion_3_medium online for free by clicking the link below.

keras stable_diffusion_3_medium online free url in huggingface.co:

https://huggingface.co/keras/stable_diffusion_3_medium

stable_diffusion_3_medium install

stable_diffusion_3_medium is an open source model from GitHub that offers a free installation service, and any user can find stable_diffusion_3_medium on GitHub to install. At the same time, huggingface.co provides the effect of stable_diffusion_3_medium install, users can directly use stable_diffusion_3_medium installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

stable_diffusion_3_medium install url in huggingface.co:

https://huggingface.co/keras/stable_diffusion_3_medium

Url of stable_diffusion_3_medium

stable_diffusion_3_medium huggingface.co Url

Provider of stable_diffusion_3_medium huggingface.co

keras
ORGANIZATIONS

Other API from keras

huggingface.co

Total runs: 22
Run Growth: 19
Growth Rate: 86.36%
Updated:February 27 2026
huggingface.co

Total runs: 15
Run Growth: -129
Growth Rate: -860.00%
Updated:July 17 2026
huggingface.co

Total runs: 13
Run Growth: -28
Growth Rate: -215.38%
Updated:June 17 2025
huggingface.co

Total runs: 13
Run Growth: 6
Growth Rate: 46.15%
Updated:February 27 2026
huggingface.co

Total runs: 13
Run Growth: 10
Growth Rate: 76.92%
Updated:March 25 2025
huggingface.co

Total runs: 13
Run Growth: -23
Growth Rate: -176.92%
Updated:June 17 2025
huggingface.co

Total runs: 11
Run Growth: 8
Growth Rate: 72.73%
Updated:February 27 2026
huggingface.co

Total runs: 11
Run Growth: -129
Growth Rate: -1172.73%
Updated:July 17 2026
huggingface.co

Total runs: 10
Run Growth: 2
Growth Rate: 18.18%
Updated:March 25 2025
huggingface.co

Total runs: 9
Run Growth: 3
Growth Rate: 33.33%
Updated:March 25 2025
huggingface.co

Total runs: 8
Run Growth: 1
Growth Rate: 12.50%
Updated:March 25 2025
huggingface.co

Total runs: 7
Run Growth: -12
Growth Rate: -171.43%
Updated:May 15 2026
huggingface.co

Total runs: 7
Run Growth: -27
Growth Rate: -385.71%
Updated:June 17 2025
huggingface.co

Total runs: 7
Run Growth: 4
Growth Rate: 57.14%
Updated:February 27 2026
huggingface.co

Total runs: 7
Run Growth: 4
Growth Rate: 57.14%
Updated:February 27 2026
huggingface.co

Total runs: 6
Run Growth: 3
Growth Rate: 50.00%
Updated:June 17 2025
huggingface.co

Total runs: 6
Run Growth: 6
Growth Rate: 100.00%
Updated:June 17 2025
huggingface.co

Total runs: 6
Run Growth: 3
Growth Rate: 50.00%
Updated:March 25 2025