forked from riffusion/riffusion-hobby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade playground app to Streamlit 1.18+
The first change was using the new non-experimental cache decorators, but then I decided to refactor to get rid of using the streamlit pages feature and instead have my own dropdown. This allows for more control to fix a page layout issue that popped up with this version.
- Loading branch information
Showing
13 changed files
with
85 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3.1 | ||
0.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ pysoundfile | |
scipy | ||
soundfile | ||
sox | ||
streamlit>=1.10.0 | ||
streamlit>=1.18.0 | ||
torch | ||
torchaudio | ||
torchvision | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,29 @@ | ||
import streamlit as st | ||
|
||
|
||
def render_main(): | ||
st.set_page_config(layout="wide", page_icon="🎸") | ||
|
||
st.title(":guitar: Riffusion Playground") | ||
|
||
left, right = st.columns(2) | ||
|
||
with left: | ||
create_link(":pencil2: Text to Audio", "/text_to_audio") | ||
st.write("Generate audio clips from text prompts.") | ||
|
||
create_link(":wave: Audio to Audio", "/audio_to_audio") | ||
st.write("Upload audio and modify with text prompt (interpolation supported).") | ||
|
||
create_link(":performing_arts: Interpolation", "/interpolation") | ||
st.write("Interpolate between prompts in the latent space.") | ||
|
||
create_link(":scissors: Audio Splitter", "/split_audio") | ||
st.write("Split audio into stems like vocals, bass, drums, guitar, etc.") | ||
|
||
with right: | ||
create_link(":scroll: Text to Audio Batch", "/text_to_audio_batch") | ||
st.write("Generate audio in batch from a JSON file of text prompts.") | ||
|
||
create_link(":paperclip: Sample Clips", "/sample_clips") | ||
st.write("Export short clips from an audio file.") | ||
|
||
create_link(":musical_keyboard: Image to Audio", "/image_to_audio") | ||
st.write("Reconstruct audio from spectrogram images.") | ||
|
||
|
||
def create_link(name: str, url: str) -> None: | ||
st.markdown( | ||
f"### <a href='{url}' target='_self' style='text-decoration: none;'>{name}</a>", | ||
unsafe_allow_html=True, | ||
PAGES = { | ||
"🎛️ Home": "tasks.home", | ||
"🌊 Text to Audio": "tasks.text_to_audio", | ||
"✨ Audio to Audio": "tasks.audio_to_audio", | ||
"🎭 Interpolation": "tasks.interpolation", | ||
"✂️ Audio Splitter": "tasks.split_audio", | ||
"📜 Text to Audio Batch": "tasks.text_to_audio_batch", | ||
"📎 Sample Clips": "tasks.sample_clips", | ||
"⏈ Spectrogram to Audio": "tasks.image_to_audio", | ||
} | ||
|
||
|
||
def main() -> None: | ||
st.set_page_config( | ||
page_title="Riffusion Playground", | ||
page_icon="🎸", | ||
layout="wide", | ||
) | ||
|
||
page = st.sidebar.selectbox("Page", list(PAGES.keys())) | ||
assert page is not None | ||
module = __import__(PAGES[page], fromlist=["render"]) | ||
module.render() | ||
|
||
|
||
if __name__ == "__main__": | ||
render_main() | ||
main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import streamlit as st | ||
|
||
|
||
def render(): | ||
st.title("✨🎸 Riffusion Playground 🎸✨") | ||
|
||
st.write("Select a task from the sidebar to get started!") | ||
|
||
left, right = st.columns(2) | ||
|
||
with left: | ||
st.subheader("🌊 Text to Audio") | ||
st.write("Generate audio clips from text prompts.") | ||
|
||
st.subheader("✨ Audio to Audio") | ||
st.write("Upload audio and modify with text prompt (interpolation supported).") | ||
|
||
st.subheader("🎭 Interpolation") | ||
st.write("Interpolate between prompts in the latent space.") | ||
|
||
st.subheader("✂️ Audio Splitter") | ||
st.write("Split audio into stems like vocals, bass, drums, guitar, etc.") | ||
|
||
with right: | ||
st.subheader("📜 Text to Audio Batch") | ||
st.write("Generate audio in batch from a JSON file of text prompts.") | ||
|
||
st.subheader("📎 Sample Clips") | ||
st.write("Export short clips from an audio file.") | ||
|
||
st.subheader("⏈ Spectrogram to Audio") | ||
st.write("Reconstruct audio from spectrogram images.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters