Haoming02 / sd-webui-tabs-extension

An Extension for Automatic1111 Webui that organizes Extensions into Tabs
MIT License
76 stars 2 forks source link

Gradio 4 bug: tabs-extension breaks with ddetailer extension because of the "µ" character: 'utf-8' codec can't decode byte 0xb5 #17

Closed aoleg closed 3 weeks ago

aoleg commented 1 month ago

WebUI Forge has been recently updated to gradio 4. tabs-extension continues to work, with one exception: if an extension named "µ Detection Detailer" is enabled, tabs-extension breaks.

The following line in the tab_configs.csv tends to break things (apparently, because of the "µ" character:

µ Detection Detailer,left,right

Workaround: disabling µ Detection Detailer fixes tabs-extension.

Observe the "0xb5" in the error log, which is the ASCII value for 'µ').

Error log:

*** Error loading script: tabs_config.py Traceback (most recent call last): File "C:\stable-diffusion-webui-forge\webui\modules\scripts.py", line 525, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\stable-diffusion-webui-forge\webui\modules\script_loading.py", line 13, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\stable-diffusion-webui-forge\webui\extensions\sd-webui-tabs-extension\scripts\tabs_config.py", line 29, in data = load_data() File "C:\stable-diffusion-webui-forge\webui\extensions\sd-webui-tabs-extension\scripts\tabs_config.py", line 17, in load_data data = csv_file.read() File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 647: invalid start byte

Haoming02 commented 1 month ago

Hmm... somehow, I can't recreate it.

The .csv loads fine on my end.

Funnily, it fails for another reason, as µ Detection Detailer adds an gr.Box that messed up my JavaScript. Did you not encounter this problem?

aoleg commented 1 month ago

I could have had this problem, too; immediately after updating Forge to the new build, the .csv was created nearly empty, and the conflicting line was never added to it. I had to restore the original (pre-Gradio 4 update) .csv file, and it was then when I received this "µ" character problem.

Haoming02 commented 1 month ago

I had to restore the original (pre-Gradio 4 update) .csv file, and it was then when I received this "µ" character problem

Hmm, perhaps the UnicodeDecodeError was caused by manually editing the .csv, which in turn mess up the encoding or something.

Though still, right now this Extension doesn't work with µ Detection Detailer, and only on Gradio 4 somehow...

Haoming02 commented 4 weeks ago

µ Detection Detailer now loads properly without errors.

As for the encoding error, try deleting the .csv and let it generate a new one.

aoleg commented 3 weeks ago

Currently works properly. I think this should be closed now.