stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Open tenabraex opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

a1111 was working fine, was generating images, it froze... on starting it again I get this, can't seem to find a solution (i've tried deleting cache.json)

i notice theres also a new

Installing requirements for Web UI
Expecting value: line 1 column 1 (char 0)

at the start of my console log

there seem to be some versions of this in the issues but none have functional solutions

Steps to reproduce the problem

start webui-user.bat error occurs

What should have happened?

should start

Commit where the problem happens

a9fed7c364061ae6efb37f797b6b522cb3cf7aa2

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--autolaunch --disable-safe-unpickle --ckpt-dir 'E:\StableDiffusionData\models\Stable-diffusion' --gfpgan-models-path 'E:\StableDiffusionData\models\GFPGAN' --codeformer-models-path 'E:\StableDiffusionData\models\Codeformer' --esrgan-models-path 'E:\StableDiffusionData\models\ESRGAN' --embeddings-dir 'E:\StableDiffusionData\embeddings' --hypernetwork-dir 'E:\StableDiffusionData\models\hypernetworks' --lora-dir 'E:\StableDiffusionData\models\Lora' --xformers --no-half-vae --opt-split-attention --api --cors-allow-origins=http://127.0.0.1:3456 --gradio-inpaint-tool color-sketch --cors-allow-origins http://localhost:5173

List of extensions

so, so many. all have functioned fine (or not caused issues, nothin new installed in my past few a1111 sessions)

Console logs

venv "D:\Github\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
Installing requirements for Web UI
Expecting value: line 1 column 1 (char 0)
Installing None
Installing onnxruntime-gpu...
Installing None
Installing opencv-python...
Installing None
Installing Pillow...

Installing requirements for Batch Face Swap


Installing sd-dynamic-prompts requirements.txt





Launching Web UI with arguments: --autolaunch --disable-safe-unpickle --ckpt-dir E:\StableDiffusionData\models\Stable-diffusion --gfpgan-models-path E:\StableDiffusionData\models\GFPGAN --codeformer-models-path E:\StableDiffusionData\models\Codeformer --esrgan-models-path E:\StableDiffusionData\models\ESRGAN --embeddings-dir E:\StableDiffusionData\embeddings --hypernetwork-dir E:\StableDiffusionData\models\hypernetworks --lora-dir E:\StableDiffusionData\models\Lora --xformers --no-half-vae --opt-split-attention --api --cors-allow-origins=http://127.0.0.1:3456 --gradio-inpaint-tool color-sketch --cors-allow-origins http://localhost:5173
Traceback (most recent call last):
  File "D:\Github\stable-diffusion-webui\launch.py", line 381, in <module>
    start()
  File "D:\Github\stable-diffusion-webui\launch.py", line 372, in start
    import webui
  File "D:\Github\stable-diffusion-webui\webui.py", line 28, in <module>
    from modules import extra_networks, ui_extra_networks_checkpoints
  File "D:\Github\stable-diffusion-webui\modules\ui_extra_networks_checkpoints.py", line 5, in <module>
    from modules import shared, ui_extra_networks, sd_models
  File "D:\Github\stable-diffusion-webui\modules\shared.py", line 665, in <module>
    opts.load(config_filename)
  File "D:\Github\stable-diffusion-webui\modules\shared.py", line 602, in load
    self.data = json.load(file)
  File "C:\Users\bunnyviking\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\bunnyviking\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\bunnyviking\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\bunnyviking\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Press any key to continue . . .

Additional information

No response

tenabraex avatar Mar 23 '23 15:03 tenabraex

Its the same here i had it working until now

MaxiKitti avatar Mar 23 '23 18:03 MaxiKitti

Oops. Encountered the same problem when saving pictures image

SoldierAb avatar Mar 27 '23 09:03 SoldierAb

Same here got this issue

LEOBellocZane avatar Mar 28 '23 17:03 LEOBellocZane

How to fix it?

nbx1234 avatar Mar 28 '23 17:03 nbx1234

hello, I get same problem, I have 2 copy SD int D:\A & D:\B when A run this error ( yes, after generating images fail), I find some file in A changed Date, so I copy B ui-config.json and config.json to A, Then A work Back! I don't know why , But it's work , FYI! : )

krugerpao avatar Apr 02 '23 11:04 krugerpao

I also encountered the same problem. When I printed filename, I found that the file was config.json. When I checked the json file, I found that the file was corrupted. I deleted config.json and restarted the service, which was able to run successfully, but some of my previous configurations were lost and restored to default configurations. I don't know why this file was corrupted.

linuxdevopscn avatar Apr 10 '23 06:04 linuxdevopscn

same problem

brehiner avatar May 09 '23 14:05 brehiner

What is causing this?

loading settings: JSONDecodeError Traceback (most recent call last): File "F:\Programs\Stable Diffusion WebUI\webui\modules\ui_loadsave.py", line 30, in __init__ self.ui_settings = self.read_from_file() File "F:\Programs\Stable Diffusion WebUI\webui\modules\ui_loadsave.py", line 132, in read_from_file return json.load(file) File "json\__init__.py", line 293, in load File "json\__init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

CirnoChan999 avatar Sep 04 '23 21:09 CirnoChan999

Solved it by deleting some config files. This will reset all of the settings you've set before. You might want to check if one of the files has size 0, that might be the only file that needs to be deleted.

These are the files I deleted:

  1. ui-config.json
  2. cache.json
  3. config.json

All of these files are generated again while the Automatic1111 is running. The config.json is generated only after you save your settings once.

Good luck.

CirnoChan999 avatar Sep 04 '23 21:09 CirnoChan999