alexandersokol/sd-model-organizer

KeyError: 'id'

Closed this issue · 3 comments

I have error that extension don't show any records after update to v1.1, I have custom path for models and lort etc.

image
image

version: v1.3.2
python: 3.10.10
torch: 2.0.1+cu118
xformers: N/A
gradio: 3.32.0

Traceback (most recent call last):
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\ui_home.py", line 14, in _prepare_data
    records = load_records_and_filter(state, True)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\data\record_utils.py", line 159, in load_records_and_filter
    local_records = _create_record_from_files(not_bound_files)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\data\record_utils.py", line 121, in _create_record_from_files
    rec = _create_record_from_file(file)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\data\record_utils.py", line 115, in _create_record_from_file
    return _create_model_from_info_file(model_file_path, info_file, model_type)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\data\record_utils.py", line 62, in _create_model_from_info_file
    version_dict = create_version_dict(json_data)
  File "D:\ProgramFiles\StableDiffusion\stable-diffusion-webui\extensions\sd-model-organizer\scripts\mo\data\mapping_utils.py", line 6, in create_version_dict
    'id': version_data['id'],
KeyError: 'id'

Hello!
Looks like that you have a broken .info file that doesn't have an id field. I will try to fix it in the nearest future.

Try to update to the latest 46bc23f commit, this bug should be fixed now.
Regarding the path - starting from version 1.1 the models path will be hidden by default in the settings (it might be still visible if it due to webui config or webui start param --mo-show-dir-settings).
Anyway Lycoris path is taking from --lyco_dir starting argument if you have Lycoris extension installed, otherwise it will use default Lycoris models path. So you may not worry if you aren't using it and not downloading Lyco models

Wow! You're super efficient! The problem has been resolved. Thank you very much!