GLM-5 is available to try on Modal. Get started
January 21, 20255 minute read

How to run Stable Diffusion 3.5 Medium on Modal

author
Yiren Lu@YirenLu
Solutions Engineer

Introduction to Stable Diffusion 3.5 Medium

Stable Diffusion 3.5 Medium is a powerful image generation model with 2.5 billion parameters that is designed to run “out of the box” on consumer hardware, striking a balance between quality and ease of customization. It is trained on 1024x1024 images, and is most suitable for generating images with those resolutions.

Why should you run Stable Diffusion 3.5 Medium on Modal?

Modal is the best and easiest way to access a GPU for running models like Stable Diffusion 3.5 Medium. With Modal, you can quickly set up your environment without the hassle of managing hardware or software dependencies. Additionally, Modal allows you to fine-tune Stable Diffusion models and create style or character LoRAs.

Example code for running the Stable Diffusion 3.5 Medium image generation model on Modal

To run the following code, you will need to:

  1. Create an account at modal.com
  2. Run pip install modal to install the modal Python package
  3. Run modal setup to authenticate (if this doesn’t work, try python -m modal setup)
  4. Copy the code below into a file called app.py
  5. Run modal run app.py

Please note that this code does not come with a UI. For a more detailed example of how to run Stable Diffusion 3.5 Medium as a CLI, API, and UI, refer here. (You can modify the code in that example to run the medium version instead of the large version.)

Additional resources

Ship your first app in minutes.

Get Started

$30 / month free compute