sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

[Bug]: re.error: bad escape \m at position 8 in console #93

Open a7in opened 1 year ago

a7in commented 1 year ago

Is there existing issue for this?

Does this happen on the latest commit?

What happened?

error after starting, after every generation in console:

Traceback (most recent call last):
 File "D:\SD\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 202, in run 
await self.handle_request(req)
 File "D:\SD\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 435, in handle_request 
infotext = sub(
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 209, in sub 
return _compile(pattern, flags).sub(repl, string, count)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 326, in _subx 
template = _compile_repl(template, pattern)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 317, in _compile_repl 
return sre_parse.parse_template(repl, pattern)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\sre_parse.py", line 1054, in parse_template
raise s.error('bad escape %s' % this, len(this)) re.error: bad escape \m at position 8

Steps to reproduce

just Enable

What did you expect to happen?

no errors in console and work

Stable Diffusion WebUI Commit SHA

22bcc7be428c94e9408f589966c2040187245d81

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Chrome

Additional information

I managed to fix it just by commenting out these lines in horde.py:

#        infotext = sub(
#            "Model:(.*?),", "Model: " + local_model.split(".")[0] + ",", infotext
#        )
#        infotext = sub(
#            "Model hash:(.*?),", "Model hash: " + local_model_shorthash + ",", infotext
#        )

after that everything worked

theUpsider commented 1 year ago

Which python version are you using? And what is the version of your regex module?