The AutoModel
is designed to make it easy to load a checkpoint without needing to know the specific model class. AutoModel
automatically retrieves the correct model class from the checkpoint config.json
file.
fromdiffusersimportAutoModel, AutoPipelineForText2Imageunet=AutoModel.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", subfolder="unet") pipe=AutoPipelineForText2Image.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", unet=unet)
[[autodoc]] AutoModel - all - from_pretrained