bbc-mc / sdweb-merge-board

Multi-step automation merge tool. Extension/Script for Stable Diffusion UI by AUTOMATIC1111 https://github.com/AUTOMATIC1111/stable-diffusion-webui
73 stars 12 forks source link

Error: <class 'KeyError'> #15

Closed crackfoo closed 1 year ago

crackfoo commented 1 year ago

Up-to-date with auto1111 (Commit hash: 194cbd065e4644e986889b78a5a949e075b610e8) Up-to-date with merge board extension

When running the merge it keeps failing after the first merge with a keyerror...

All Multi-Merge process finished. 10 files. Merge complete. Checkpoint saved as: [MergeTest-v1-0.ckpt] Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'> Error: <class 'KeyError'>

If I merge one at time (Skip merge if same-name ckpt already exists), it works but have to delete each one in succession to make it to the end...

bbc-mc commented 1 year ago

Hi, thanks for report. Try new commit to fix KeyError which caused because checkpoint_list key is changed silently...

crackfoo commented 1 year ago

Thanks, it made it through most of the board but then stopped with the error:

AttributeError: 'NoneType' object has no attribute 'calculate_shorthash'

This was after updating auto1111 as well as the extensions just now...

  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\crackers\sd\forks\auto1111\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\crackers\sd\forks\auto1111\extensions\sdweb-merge-board\scripts\merge_board.py", line 143, in modelmerger
    _ret_all = merge_ope.run_merge(skip_merge_if_exists=chk_skip_merge_if_exists, config_source=radio_config_source)
  File "C:\Users\crackers\sd\forks\auto1111\extensions\sdweb-merge-board\scripts\multimerge\operation.py", line 32, in run_merge
    _ret = _recipe.run_merge(_index, skip_merge_if_exists, config_source)
  File "C:\Users\crackers\sd\forks\auto1111\extensions\sdweb-merge-board\scripts\multimerge\recipe.py", line 175, in run_merge
    self._update_o_filename(index, results)
  File "C:\Users\crackers\sd\forks\auto1111\extensions\sdweb-merge-board\scripts\multimerge\recipe.py", line 228, in _update_o_filename
    ckpt_info.calculate_shorthash()
AttributeError: 'NoneType' object has no attribute 'calculate_shorthash'
bbc-mc commented 1 year ago

Thanks, control system of model and hashes on AUTO1111 are now complicated... Add code to force update key of "checkpoint_list".