mix1009 / model-keyword

Automatic1111 WEBUI extension to autofill keyword for custom stable diffusion models and LORA models.
MIT License
248 stars 13 forks source link

Failure to run extension due to missing custom-mappings.txt file - workaround is to create one #18

Closed ejrejr closed 1 year ago

ejrejr commented 1 year ago

(BTW, this is just the extension I needed when I did a big huge X/Y plot run to compare 50 some models. Running again.)

After I installed the extension, it would not run initially without creating a blank custom-mappings.txt file.

Can a blank one be created and installed by default?

Repro:

Expanding the script extension area, too, and performing Save doesn't help. Performing Check gets an error.

Traceback: Traceback (most recent call last): File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict output = await app.get_blocks().process_api( File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api result = await self.call_function( File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\Eric\repos\Stable-Diffusion\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 "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\extensions\model-keyword\scripts\model_keyword.py", line 122, in check_keyword entry = get_keyword_for_model(model_hash, model_ckpt, return_entry=True) File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\extensions\model-keyword\scripts\model_keyword.py", line 71, in get_keyword_for_model hash_dict = load_hash_dict() File "C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\extensions\model-keyword\scripts\model_keyword.py", line 41, in load_hash_dict modified = str(os.stat(default_file).stmtime) + '' + str(os.stat(user_file).st_mtime) FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\Users\Eric\repos\Stable-Diffusion\stable-diffusion-webui\extensions\model-keyword/custom-mappings.txt'

mix1009 commented 1 year ago

There was a bug in the old version. I've fixed the bug, but got in again while trying to add api support. Thank you for the report. Latest version will create the file if it's not available.