open-mmlab / mmagic

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox. Unlock the magic 🪄: Generative-AI (AIGC), easy-to-use APIs, awsome model zoo, diffusion models, for text-to-image generation, image/video restoration/enhancement, etc.
https://mmagic.readthedocs.io/en/latest/
Apache License 2.0
6.86k stars 1.05k forks source link

[Bug] AutoencoderKL in mmagic/models/archs.py: runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json. #1870

Closed PancakeAwesome closed 1 year ago

PancakeAwesome commented 1 year ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmagic

Environment

05/23 17:43:38 - mmengine - INFO - **Environmental information** 05/23 17:43:39 - mmengine - INFO - sys.platform: linux 05/23 17:43:39 - mmengine - INFO - Python: 3.8.16 (default, Mar 2 2023, 03:21:46) [GCC 11.2.0] 05/23 17:43:39 - mmengine - INFO - CUDA available: True 05/23 17:43:39 - mmengine - INFO - numpy_random_seed: 2147483648 05/23 17:43:39 - mmengine - INFO - GPU 0,1,2: NVIDIA A100-SXM4-80GB 05/23 17:43:39 - mmengine - INFO - CUDA_HOME: /usr/local/cuda 05/23 17:43:39 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.7, V11.7.99 05/23 17:43:39 - mmengine - INFO - GCC: gcc (GCC) 8.3.1 20190604 (Alibaba 8.3.1-1 2.24) 05/23 17:43:39 - mmengine - INFO - PyTorch: 2.0.0+cu117 05/23 17:43:39 - mmengine - INFO - PyTorch compiling details: PyTorch built with:

05/23 17:43:39 - mmengine - INFO - TorchVision: 0.15.1+cu117 05/23 17:43:39 - mmengine - INFO - OpenCV: 4.7.0 05/23 17:43:39 - mmengine - INFO - MMEngine: 0.7.3 05/23 17:43:39 - mmengine - INFO - MMCV: 2.0.0 05/23 17:43:39 - mmengine - INFO - MMCV Compiler: GCC 9.3 05/23 17:43:39 - mmengine - INFO - MMCV CUDA Compiler: 11.7 05/23 17:43:39 - mmengine - INFO - MMDeploy: 1.0.0+ 05/23 17:43:39 - mmengine - INFO -

05/23 17:43:39 - mmengine - INFO - **Backend information** 05/23 17:43:39 - mmengine - INFO - tensorrt: 8.2.3.0 05/23 17:43:39 - mmengine - INFO - tensorrt custom ops: Available 05/23 17:43:39 - mmengine - INFO - ONNXRuntime: None 05/23 17:43:39 - mmengine - INFO - ONNXRuntime-gpu: 1.8.1 05/23 17:43:39 - mmengine - INFO - ONNXRuntime custom ops: NotAvailable 05/23 17:43:39 - mmengine - INFO - pplnn: None 05/23 17:43:39 - mmengine - INFO - ncnn: None 05/23 17:43:39 - mmengine - INFO - snpe: None 05/23 17:43:39 - mmengine - INFO - openvino: None 05/23 17:43:39 - mmengine - INFO - torchscript: 2.0.0 05/23 17:43:39 - mmengine - INFO - torchscript custom ops: NotAvailable 05/23 17:43:39 - mmengine - INFO - rknn-toolkit: None 05/23 17:43:39 - mmengine - INFO - rknn-toolkit2: None 05/23 17:43:39 - mmengine - INFO - ascend: None 05/23 17:43:39 - mmengine - INFO - coreml: None 05/23 17:43:39 - mmengine - INFO - tvm: None 05/23 17:43:39 - mmengine - INFO - vacc: None 05/23 17:43:39 - mmengine - INFO -

Reproduces the problem - code sample

python -c "from mmagic.apis import MMagicInferencer;sd_inferencer = MMagicInferencer(model_name='stable_diffusion')"

Reproduces the problem - command or script

python -c "from mmagic.apis import MMagicInferencer;sd_inferencer = MMagicInferencer(model_name='stable_diffusion')"

Reproduces the problem - error message

OSError: class StableDiffusion in mmagic/models/editors/stable_diffusion/stable_diffusion.py: class AutoencoderKL in mmagic/models/archs.py: runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.

Additional information

No response

Z-Fran commented 1 year ago

This is because runwayml/stable-diffusion-v1-5 hasn't been downloaded completely.

PancakeAwesome commented 1 year ago

how to download?can u tell me the link of this resource. thank u

Z-Fran commented 1 year ago

if you don't have a folder named runwayml/stable-diffusion-v1-5, it will automatically download. Or you can download it from https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main

Z-Fran commented 1 year ago

Closing due to inactivity, please reopen if there are any further problems.

PancakeAwesome commented 1 year ago

if you don't have a folder named runwayml/stable-diffusion-v1-5, it will automatically download. Or you can download it from https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main

After downloaded hug model and how can i load model from custom local path?

PancakeAwesome commented 1 year ago

@Z-Fran

LeoXing1996 commented 1 year ago

@PancakeAwesome

- stable_diffusion_v15_url = 'runwayml/stable-diffusion-v1-5'
+ stable_diffusion_v15_url = YOUR_LOCAL_PATH

unet = dict(
    type='UNet2DConditionModel',
    subfolder='unet',
    from_pretrained=stable_diffusion_v15_url)
vae = dict(
    type='AutoencoderKL',
    from_pretrained=stable_diffusion_v15_url,
    subfolder='vae')