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
23.99k stars 4.94k forks source link

StableCascadeUNet.from_single_file not working error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json. #8465

Open s9anus98a opened 4 weeks ago

s9anus98a commented 4 weeks ago

i want to try this stable cascade fine tuned model https://civitai.com/models/326354/altcascade

script:


import torch
from math import ceil
from diffusers import (
    StableCascadeDecoderPipeline,
    StableCascadePriorPipeline,
    StableCascadeUNet
)
# from diffusers.models import StableCascadeUNet

torch.set_grad_enabled(False)
prior_unet = StableCascadeUNet.from_single_file(
    "/content/model.safetensors",
    torch_dtype=torch.bfloat16
)

error:


HTTPError                                 Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name)
    303     try:
--> 304         response.raise_for_status()
    305     except HTTPError as e:

15 frames

HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/config.json

The above exception was the direct cause of the following exception:

EntryNotFoundError                        Traceback (most recent call last)

EntryNotFoundError: 404 Client Error. (Request ID: Root=1-66679074-19a06df0021ab1f94d5e607e;ee7cdda4-5c90-4783-bea8-fae0fea95b7a)

Entry Not Found for url: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/config.json.

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py](https://localhost:8080/#) in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, return_commit_hash, **kwargs)
    409                 )
    410             except EntryNotFoundError:
--> 411                 raise EnvironmentError(
    412                     f"{pretrained_model_name_or_path} does not appear to have a file named {cls.config_name}."
    413                 )

OSError: runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
DN6 commented 4 weeks ago

Hmm @s9anus98a it seems like the keys in the checkpoint are meant to work with Comfy UI. We'll have to convert them in order to use it with Diffusers. We don't have a Comfy UI to diffusers conversion script for this checkpoint at the moment.

@asomoza Do you have bandwidth to come up with a script to convert the checkpoint from Comfy format to either Diffusers or Stability's original format (either one can be loaded with diffusers)
https://huggingface.co/stabilityai/stable-cascade/tree/main?show_file_info=stage_c_bf16.safetensors

I think we can look into adding support for single file loading Comfy UI checkpoints as well.

asomoza commented 3 weeks ago

I'll take a look into this but I haven't seen any training code just for comfyui, I have a hunch that the problem here isn't that.

s9anus98a commented 3 weeks ago

any update @asomoza ?