0xbitches / sd-webui-lcm

Latent Consistency Model for AUTOMATIC1111 Stable Diffusion WebUI
MIT License
614 stars 43 forks source link

AttributeError: module diffusers has no attribute LCMScheduler #29

Open roselma opened 8 months ago

roselma commented 8 months ago

In a v1.6.0 Automatic1111 installation, I followed the installation steps for this extension and an attempt to generate an image in the LCM extension yields the following:

The config attributes {'original_inference_steps': 50} were passed to LCMScheduler, but are not expected and will be ignored. Please verify your scheduler_config.json configuration file.
The config attributes {'requires_safety_checker': True} were passed to LatentConsistencyModelPipeline, but are not expected and will be ignored. Please verify your model_index.json configuration file.
Keyword arguments {'requires_safety_checker': True} are not expected by LatentConsistencyModelPipeline and will be ignored.
Traceback (most recent call last):
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/home/m/stable-diffusion-webui/extensions/sd-webui-lcm/scripts/main.py", line 99, in generate
    pipe = LatentConsistencyModelPipeline.from_pretrained(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 1098, in from_pretrained
    maybe_raise_or_warn(
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 282, in maybe_raise_or_warn
    class_obj = getattr(library, class_name)
  File "/home/m/stable-diffusion-webui/venv/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 677, in __getattr__
    raise AttributeError(f"module {self.__name__} has no attribute {name}")
AttributeError: module diffusers has no attribute LCMScheduler
roselma commented 8 months ago

The following resolved the problem for me. Perhaps you want to update your README.md?

$ source bin/activate
$ pip install --upgrade diffusers transformers accelerate peft
luosiallen commented 8 months ago

Yes. Update the diffursers to the latest version, that will fix the problem!