rsxdalv / tts-generation-webui

TTS Generation Web UI (Bark, MusicGen + AudioGen, Tortoise, RVC, Vocos, Demucs, SeamlessM4T, MAGNet, StyleTTS2, MMS)
https://rsxdalv.github.io/tts-generation-webui/
MIT License
1.46k stars 160 forks source link

Question: Is there any way to call tts API? #222

Closed SnowingFox closed 5 months ago

SnowingFox commented 7 months ago

I'm sorry for taking up your issue resource, but this question has been bothering me for a long time

I found that when i click generate button, webgui will call a websocket to response data.

But in API docs are all HTTP request and just have musicgen & /demucs, other api are fn_index

So I would like to ask what I should do if I want to call a tts API that has already been trained on a model. Thank you

rsxdalv commented 7 months ago

There's more than just http requests. And yes you can also manually replicate gradios websocket code as some frontend projects have done.

Gradio does offer some asynchronous APIs though. The documentation might be a little hard to find.

On Mon, Nov 27, 2023, 8:58 PM snowingfox @.***> wrote:

I'm sorry for taking up your issue resource, but this question has been bothering me for a long time I found that when i click generate button, webgui will call a websocket to response data.

image.png (view on web) https://github.com/rsxdalv/tts-generation-webui/assets/26035718/3ac3e685-1f82-49e6-b285-b35cccc8353d But in API docs are all HTTP request

image.png (view on web) https://github.com/rsxdalv/tts-generation-webui/assets/26035718/9d50a39a-c82e-4989-a136-ef4d88c98e38 So I would like to ask what I should do if I want to call a tts API that has already been trained on a model. Thank you

— Reply to this email directly, view it on GitHub https://github.com/rsxdalv/tts-generation-webui/issues/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTRXI4VTRZMZ35JNB3ENU3YGSFAZAVCNFSM6AAAAAA737U6GKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTEMRRHEYTEOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rsxdalv commented 7 months ago

I'm not sure I fully understand what you mean, even if you used just a http request it wouldn't be a problem. If you set up the parameters to use your model, then it should be fine. There are multiple models here and their specifics differ.

On Mon, Nov 27, 2023, 9:20 PM Roberts Slisans @.***> wrote:

There's more than just http requests. And yes you can also manually replicate gradios websocket code as some frontend projects have done.

Gradio does offer some asynchronous APIs though. The documentation might be a little hard to find.

On Mon, Nov 27, 2023, 8:58 PM snowingfox @.***> wrote:

I'm sorry for taking up your issue resource, but this question has been bothering me for a long time I found that when i click generate button, webgui will call a websocket to response data.

image.png (view on web) https://github.com/rsxdalv/tts-generation-webui/assets/26035718/3ac3e685-1f82-49e6-b285-b35cccc8353d But in API docs are all HTTP request

image.png (view on web) https://github.com/rsxdalv/tts-generation-webui/assets/26035718/9d50a39a-c82e-4989-a136-ef4d88c98e38 So I would like to ask what I should do if I want to call a tts API that has already been trained on a model. Thank you

— Reply to this email directly, view it on GitHub https://github.com/rsxdalv/tts-generation-webui/issues/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTRXI4VTRZMZ35JNB3ENU3YGSFAZAVCNFSM6AAAAAA737U6GKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTEMRRHEYTEOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

SnowingFox commented 7 months ago

I'm not sure I fully understand what you mean, even if you used just a http request it wouldn't be a problem. If you set up the parameters to use your model, then it should be fine. There are multiple models here and their specifics differ. On Mon, Nov 27, 2023, 9:20 PM Roberts Slisans @.> wrote: There's more than just http requests. And yes you can also manually replicate gradios websocket code as some frontend projects have done. Gradio does offer some asynchronous APIs though. The documentation might be a little hard to find. On Mon, Nov 27, 2023, 8:58 PM snowingfox @.> wrote: > I'm sorry for taking up your issue resource, but this question has been > bothering me for a long time > I found that when i click generate button, webgui will call a websocket > to response data. > > image.png (view on web) > https://github.com/rsxdalv/tts-generation-webui/assets/26035718/3ac3e685-1f82-49e6-b285-b35cccc8353d > But in API docs are all HTTP request > > image.png (view on web) > https://github.com/rsxdalv/tts-generation-webui/assets/26035718/9d50a39a-c82e-4989-a136-ef4d88c98e38 > So I would like to ask what I should do if I want to call a tts API that > has already been trained on a model. Thank you > > — > Reply to this email directly, view it on GitHub > <#222>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/ABTRXI4VTRZMZ35JNB3ENU3YGSFAZAVCNFSM6AAAAAA737U6GKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTEMRRHEYTEOA > . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

I understand what you mean, but my coding skills are limited, and it's difficult for me to find where the front-end and back-end code is for handling this part of the content. Could you please help me point out where the front-end and back-end code is so that i can resolve it by myself. Thank you.

rsxdalv commented 7 months ago

Gradio blends them together (which is also a reason why I'm migrating away from it).

You can call gradio from API, using it as a backend. Without more information about which model and whatnot, there's nothing more I can say. You can check the JavaScript frontend for code examples.

On Mon, Nov 27, 2023, 9:33 PM snowingfox @.***> wrote:

I'm not sure I fully understand what you mean, even if you used just a http request it wouldn't be a problem. If you set up the parameters to use your model, then it should be fine. There are multiple models here and their specifics differ. On Mon, Nov 27, 2023, 9:20 PM Roberts Slisans @.

> wrote: … <#m-4694088110171469668> There's more than just http requests. And yes you can also manually replicate gradios websocket code as some frontend projects have done. Gradio does offer some asynchronous APIs though. The documentation might be a little hard to find. On Mon, Nov 27, 2023, 8:58 PM snowingfox @.> wrote: > I'm sorry for taking up your issue resource, but this question has been > bothering me for a long time > I found that when i click generate button, webgui will call a websocket > to response data. > > image.png (view on web) > https://github.com/rsxdalv/tts-generation-webui/assets/26035718/3ac3e685-1f82-49e6-b285-b35cccc8353d

But in API docs are all HTTP request > > image.png (view on web) > https://github.com/rsxdalv/tts-generation-webui/assets/26035718/9d50a39a-c82e-4989-a136-ef4d88c98e38 So I would like to ask what I should do if I want to call a tts API that has already been trained on a model. Thank you > > — > Reply to this email directly, view it on GitHub > <#222 https://github.com/rsxdalv/tts-generation-webui/issues/222>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/ABTRXI4VTRZMZ35JNB3ENU3YGSFAZAVCNFSM6AAAAAA737U6GKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTEMRRHEYTEOA . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

I understand what you mean, but my coding skills are limited, and it's difficult for me to find where the front-end and back-end code is for handling this part of the content. Could you please help me point out where the front-end and back-end code is? Thank you.

— Reply to this email directly, view it on GitHub https://github.com/rsxdalv/tts-generation-webui/issues/222#issuecomment-1827842583, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTRXI2ZNY3G3MGIWTNQD7LYGSJC7AVCNFSM6AAAAAA737U6GKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXHA2DENJYGM . You are receiving this because you commented.Message ID: @.***>

rsxdalv commented 5 months ago

Note - avoid editing your responses, I never get notified of edits, only of new comments. With the new UI you have a whole set of new APIs that you can see and also use in the same way that the react UI uses. If there are more questions, please reopen this issue.