diff --git a/README.md b/README.md index fef56b23..01813662 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,10 @@ Google Colab demo: [![Open In Colab](https://colab.research.google.com/assets/co ## Screenshots -| ![musicgen](./screenshots/v2/musicgen.png) | ![rvc](./screenshots/v2/rvc.png) | ![history](./screenshots/v2/history.jpg) | -| :---------------------------------------------------: | :---------------------------------------------------: | :--------------------------------------: | -| ![Screenshot 1](<./screenshots/screenshot%20(1).png>) | ![Screenshot 5](<./screenshots/screenshot%20(5).png>) | ![cloning](./screenshots/v2/cloning.png) | +| ![react](./screenshots/v2/react.png) | ![musicgen](./screenshots/v2/musicgen.png) | ![rvc](./screenshots/v2/rvc.png) | +| :-----------------------------------------: | :-----------------------------------------: | :-------------------------------: | +| ![history](./screenshots/v2/history.jpg) | ![Screenshot 1](<./screenshots/screenshot%20(1).png>) | ![Screenshot 5](<./screenshots/screenshot%20(5).png>) | + ## Examples @@ -40,6 +41,14 @@ https://rsxdalv.github.io/bark-speaker-directory/ https://github.com/rsxdalv/tts-generation-webui/discussions/186#discussioncomment-7291274 ## Changelog +Jan 9: +* React UI + * Fix 404 handler for Wavesurfer + * Group Bark tabs together + +Jan 8: +* Release React UI + Oct 26: * Improve model selection UX for Musicgen diff --git a/react-ui/src/components/AudioComponents.tsx b/react-ui/src/components/AudioComponents.tsx index a8e9d4a3..1c7ccb16 100644 --- a/react-ui/src/components/AudioComponents.tsx +++ b/react-ui/src/components/AudioComponents.tsx @@ -137,7 +137,8 @@ const DownloadButton = ({ url }: { url?: string }) => { .then((blob) => { const blobURL = URL.createObjectURL(blob); setDownloadURL(blobURL); - }); + }) + .catch((e) => console.log("=== Error downloading", e)); }; download(url); }, [url]); diff --git a/react-ui/src/components/Header.tsx b/react-ui/src/components/Header.tsx index 77e5627f..d5d2874e 100644 --- a/react-ui/src/components/Header.tsx +++ b/react-ui/src/components/Header.tsx @@ -2,7 +2,14 @@ import React from "react"; import Link from "next/link"; import { useRouter } from "next/router"; -const routes = [ +type Route = { + href: string; + text: string | React.ReactNode; + target?: string; + subroutes?: Route[]; +}; + +const routes: Route[] = [ { href: "/", text: "Home", @@ -10,6 +17,52 @@ const routes = [ { href: "/bark", text: "Bark", + subroutes: [ + { + href: "/bark", + text: "Generation", + }, + // { + // href: "/bark_voice_generation", + // text: "Voice Generation", + // }, + // { + // href: "/voices", + // text: "Voices", + // }, + // { + // href: "/bark_settings", + // text: "Settings", + // }, + // { + // href: "/vocos_wav", + // text: "Vocos Wav", + // }, + // { + // href: "/vocos_npz", + // text: "Vocos NPZ", + // }, + { + href: "/bark/bark_voice_generation", + text: "Voice Generation", + }, + { + href: "/bark/voices", + text: "Voices", + }, + { + href: "/bark/bark_settings", + text: "Settings", + }, + { + href: "/bark/vocos_wav", + text: "Vocos Wav", + }, + { + href: "/bark/vocos_npz", + text: "Vocos NPZ", + }, + ], }, { href: "/tortoise", @@ -19,25 +72,13 @@ const routes = [ href: "/musicgen", text: "Musicgen", }, - { - href: "/rvc", - text: "RVC", - }, { href: "/demucs", text: "Demucs", }, { - href: "/vocos_wav", - text: "Vocos Wav", - }, - { - href: "/vocos_npz", - text: "Vocos NPZ", - }, - { - href: "/bark_voice_generation", - text: "Bark Voice Generation", + href: "/rvc", + text: "RVC", }, { href: "/history/outputs", @@ -47,14 +88,6 @@ const routes = [ href: "/history/favorites", text: "Favorites", }, - { - href: "/voices", - text: "Bark Voices", - }, - { - href: "/bark_settings", - text: "Bark Settings", - }, // { // href: "/history/collections", // text: "History Collections", @@ -69,11 +102,7 @@ const routes = [ // }, { href: "https://echo.ps.ai/?utm_source=bark_speaker_directory", - text: ( - - More Voices{" "}↗ - - ), + text: More Voices ↗, target: "_blank", }, ]; @@ -82,26 +111,55 @@ export const Header = ({}) => { const router = useRouter(); const route = router.asPath.replace("/", ""); + const currentRoute = + routes.find((r) => r.href.slice(1) === route) || + routes.find( + (r) => r.href.slice(1) === route.slice(0, route.lastIndexOf("/")) + ); + + const subroutes = currentRoute?.subroutes; + return ( -
- {routes.map(({ href, text, target }, i) => (
-
+ {routes.map(({ href, text, target, subroutes }, i) => (
+
+ {currentRoute?.text} {"> "}
+ {subroutes.map(({ href, text, target }, i) => (
+