rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.01k stars 87 forks source link

ValueError: Invalid LoRA checkpoint. #186

Closed AlgorithmicKing closed 1 month ago

AlgorithmicKing commented 1 month ago

i am getting this error when trying to load lora model:

LoRA adapter name : proteus_v04beta
Traceback (most recent call last):
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\gradio\queueing.py", line 501, in call_prediction
    output = await route_utils.call_process_api(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\gradio\route_utils.py", line 253, in call_process_api
    output = await app.get_blocks().process_api(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\gradio\blocks.py", line 1695, in process_api
    result = await self.call_function(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\gradio\blocks.py", line 1235, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\anyio\_backends\_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\anyio\_backends\_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\gradio\utils.py", line 692, in wrapper
    response = f(*args, **kwargs)
  File "I:\fastsdcpu-1.0.0-beta.30\src\frontend\webui\lora_models_ui.py", line 67, in on_click_load_lora
    load_lora_weight(
  File "I:\fastsdcpu-1.0.0-beta.30\src\backend\lora.py", line 65, in load_lora_weight
    pipeline.load_lora_weights(
  File "I:\fastsdcpu-1.0.0-beta.30\env\lib\site-packages\diffusers\loaders\lora.py", line 1248, in load_lora_weights
    raise ValueError("Invalid LoRA checkpoint.")
ValueError: Invalid LoRA checkpoint.

Screenshot 2024-05-13 191141

rupeshs commented 1 month ago

please check our tutorial https://youtu.be/N_LUxd6G2nk?si=1tCYvnkhvByelh54

AlgorithmicKing commented 1 month ago

same error

rupeshs commented 1 month ago

You need to use valid lora models

AlgorithmicKing commented 1 month ago

for example?

AlgorithmicKing commented 1 month ago

this is the model i used isnt it valid? https://civitai.com/models/267242/proteus

AlgorithmicKing commented 1 month ago

oh nvm i figured it out it was a checkpoint and not a lora model. so now can i use checkpoints in fastsd cpu?

rupeshs commented 1 month ago

yes it is not a lora model

AlgorithmicKing commented 1 month ago

can i use checkpoint models on fastsd cpu

AlgorithmicKing commented 1 month ago

is it true?: gemini: FastSD CPU does not currently support loading custom checkpoint models. It is designed to work with specific models optimized for faster inference on CPUs.

However, FastSD CPU does support:

LCM (Latent Consistency Models): These models are specifically designed for fast inference on CPUs. OpenVINO Models (SDXS-512-0.9): These models leverage the OpenVINO toolkit for accelerated inference on Intel CPUs. LCM-LoRA: This is a special type of model that can be used to fine-tune existing models or adapt them to specific styles. You can find more information about the supported models and how to use them on the FastSD CPU GitHub page: https://github.com/rupeshs/fastsdcpu

The developers of FastSD CPU are actively working on adding new features, so it's possible that custom checkpoint support might be added in the future. You can keep an eye on the project's updates on GitHub for any announcements.

Please note that loading custom checkpoint models might require additional technical knowledge and modifications to the software. If you are not familiar with these processes, it is recommended to wait for official support or seek assistance from the FastSD CPU community.

AlgorithmicKing commented 1 month ago

anyways thanks a lot

rupeshs commented 1 month ago

FastSD supports diffuser model format (safetensors) not single file checkpoint

AlgorithmicKing commented 1 month ago

ok