Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when executing text2img on 2023-04-03 #1

Open
telmo-correa opened this issue Apr 3, 2023 · 0 comments
Open

ValueError when executing text2img on 2023-04-03 #1

telmo-correa opened this issue Apr 3, 2023 · 0 comments

Comments

@telmo-correa
Copy link

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.

In retrieve_model.py:

    pipe = StableDiffusionPipeline.from_pretrained(
        "CompVis/stable-diffusion-v1-4", 
        use_auth_token=hf_token,
        revision="249dd2d739844dea6a0bc7fc27b3c1d014720b28"
    )

In requirements.txt:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant