huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
25.49k stars 5.28k forks source link

StableDiffusionImageVariationPipeline not initializing #1655

Closed generalsvr closed 1 year ago

generalsvr commented 1 year ago

Describe the bug

When I try to initialize pipe I get this error:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/lambdalabs/sd-image-variations-diffusers/resolve/v2.0/model_index.json

There is a problem with lambdalabs repo, please check. This issue can also be found here - https://github.com/LambdaLabsML/lambda-diffusers/issues/16

Reproduction

Code to reproduce bug (from https://github.com/LambdaLabsML/lambda-diffusers):

from diffusers import StableDiffusionImageVariationPipeline
from PIL import Image

device = "cuda:0"
sd_pipe = StableDiffusionImageVariationPipeline.from_pretrained(
  "lambdalabs/sd-image-variations-diffusers",
  revision="v2.0",
  )

Logs

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/diffusers/pipeline_utils.py", line 454, in from_pretrained
    config_dict = cls.load_config(
  File "/usr/local/lib/python3.8/dist-packages/diffusers/configuration_utils.py", line 348, in load_config
    raise EnvironmentError(
OSError: v2.0 is not a valid git identifier (branch name, tag name or commit id) that exists for this model name. Check the model page at 'https://huggingface.co/lambdalabs/sd-image-variations-diffusers' for available revisions.

System Info

WASasquatch commented 1 year ago

revision="v2.0"

is not a valid revision. This is for the model floating point type, example fp16.

The error is pretty explanatory.

averad commented 1 year ago

@WASasquatch the model creator has chosen to use things like V1.0 for revision names instead of using it for FP16, Onnx, etc. 🤷 (See screen cap below or check out the model).


@artyemk Here is some more information incase you run into issues.

To correct the issue you need to:

  1. Go to the model's 🤗 page.

  2. Click on "Files and Versions" 1

  3. Click on "main" to see the drop down of available "revisions" 2

v2.0 is not a listed "revision" for that model, I believe you would want to pull/download the main "revision"

Corrected Script Example:

from diffusers import StableDiffusionImageVariationPipeline
from PIL import Image

device = "cuda:0"
sd_pipe = StableDiffusionImageVariationPipeline.from_pretrained(
  "lambdalabs/sd-image-variations-diffusers",
  revision="main",
  )

@artyemk I've opened a discussion on the models page asking the creator update the model to include v2.0 as a valid branch or to update the example code.

https://huggingface.co/lambdalabs/sd-image-variations-diffusers/discussions/6

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.