SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
549 stars 124 forks source link

[BUG] generating stable diffusion images is broken in neo branch #120

Closed FranciscoFornell closed 1 year ago

FranciscoFornell commented 1 year ago

Hi! I know neo branch contains work in progress, but I wanted to let you know this, just in case you didn't notice SD feature is broken in that branch. To reproduce the error you just need to use /sd using neo branch, and it instantly fails. This is the error on SillyTavern-extras console:

[2023-08-13 15:28:42,449] ERROR in app: Exception on /api/image [POST] Traceback (most recent call last): File "C:\Users\Paco\miniconda3\envs\SillyTavernExtrasNeo\Lib\site-packages\flask\app.py", line 2190, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Paco\miniconda3\envs\SillyTavernExtrasNeo\Lib\site-packages\flask\app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Paco\miniconda3\envs\SillyTavernExtrasNeo\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(args, kwargs))) ^^^^^^^^^^^^^^^^^^ File "C:\Users\Paco\miniconda3\envs\SillyTavernExtrasNeo\Lib\site-packages\flask\app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Paco\miniconda3\envs\SillyTavernExtrasNeo\Lib\site-packages\flask\app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\SillyTavern-extras\server.py", line 388, in decorated_view return fn(args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "D:\AI\SillyTavern-extras\server.py", line 749, in api_image else type(default_value) ^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not callable

I ran SillyTavern-extras with this parameters:

python server.py --enable-modules=caption,summarize,classify,talkinghead,sd,coqui-tts,chromadb --cuda --coqui-gpu --talkinghead-gpu --sd-remote-port 7861 --classification-model=joeddav/distilbert-base-uncased-go-emotions-student

I ended up using main branch again to not loose the SD feature, but it has been fun playing around with coqui-tts and talking head. 🙂

Ph0rk0z commented 1 year ago

Do you have coqui enabled? That's what breaks it for me. Otherwise I have been using it all week.

Cohee1207 commented 1 year ago

Thanks for giving me the lead @Ph0rk0z I love Python for being able to overwrite a built-in function with a random global variable from another module. This is hopefully been fixed without breaking neither SD nor coqui.

Ph0rk0z commented 1 year ago

Nice. RVC + Silero already sounds like the character but the TTS is flat. Maybe one of these will be better. I tried edge-tts but it was about equivalent.

FranciscoFornell commented 1 year ago

@Ph0rk0z you'r right! I didn't notice, but it works when I disable coqui. @Cohee1207 I pulled your latest changes and now it works like a charm using both coqui and sd. Thanks!