As of 2023-04-03, creating the container using the provided docker file and the current version of stable-diffusion causes an internal server error when executing text2img
:
ValueError: The component <class 'transformers.models.clip.feature_extraction_clip.CLIPFeatureExtractor'> of <class 'diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline'> cannot be loaded as it does not seem to have any of the loading methods defined in {'ModelMixin': ['save_pretrained', 'from_pretrained'], 'SchedulerMixin': ['save_config', 'from_config'], 'DiffusionPipeline': ['save_pretrained', 'from_pretrained'], 'OnnxRuntimeModel': ['save_pretrained', 'from_pretrained'], 'PreTrainedTokenizer': ['save_pretrained', 'from_pretrained'], 'PreTrainedTokenizerFast': ['save_pretrained', 'from_pretrained'], 'PreTrainedModel': ['save_pretrained', 'from_pretrained'], 'FeatureExtractionMixin': ['save_pretrained', 'from_pretrained']}.
Using pinned, more recent versions of the requirements -- and also pinning the version of the stable diffusion model -- fixes this issue and helps future-proof this tutorial.
pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
use_auth_token=hf_token,
revision="249dd2d739844dea6a0bc7fc27b3c1d014720b28"
)
diffusers==0.14.0
fastapi==0.95.0
numpy==1.23.5
opencv_python==4.7.0.72
Pillow==9.4.0
starlette==0.26.1
torch==1.12.1
uvicorn==0.21.1
transformers==4.27.4
python-multipart==0.0.6
accelerate==0.15.0