Skip to content

Foundation models

Model deployment is for the results of your fine-tuning runs. If you want to use foundation models — e.g. vanilla Stable Diffusion instead of your own fine-tuned version — you do not need to deploy the model yourself.

Instead, import foundation models from the baseten.models subpackage to directly invoke already-deployed models.


Please refer to the individual model docs for more advanced usage of models. At a high level, you can interact with models like this:

Stable Diffusion

from baseten.models import StableDiffusionPipeline
sd = StableDiffusionPipeline()
image, url = sd("dog running on grass") 

# To see the image"my-image.png")

More: Stable Diffusion model reference.


from baseten.models import Whisper
whisper = Whisper()
transcribed = whisper("")

More: Whisper model reference.


from baseten.models import FlanT5
flan = FlanT5()
generated = flan("Could Albert Einstein have attended the super bowl?")

More: FLAN-T5 model reference.