|
import streamlit as st |
|
import tempfile |
|
st.title('DIFF-SVC Render') |
|
|
|
|
|
|
|
ckpt = st.file_uploader("Choose your CKPT", type= 'ckpt') |
|
|
|
|
|
if ckpt is not None: |
|
|
|
with tempfile.NamedTemporaryFile(mode="wb", suffix='.ckpt', delete=False) as temp: |
|
|
|
bytes_data = ckpt.getvalue() |
|
|
|
temp.write(bytes_data) |
|
ckpt_temp_file = temp.name |
|
|
|
print(temp.name) |
|
|
|
|
|
if "ckpt_temp_file" in locals(): |
|
st.success("File saved to: {}".format(ckpt_temp_file)) |
|
|
|
|
|
config = st.file_uploader("Choose your config", type= 'yaml') |
|
|
|
|
|
if config is not None: |
|
|
|
with tempfile.NamedTemporaryFile(mode="wb", suffix='.yaml', delete=False) as temp: |
|
|
|
bytes_data = config.getvalue() |
|
|
|
temp.write(bytes_data) |
|
config_temp_file = temp.name |
|
|
|
print(temp.name) |
|
|
|
|
|
if "config_temp_file" in locals(): |
|
st.success("File saved to: {}".format(config_temp_file)) |
|
|
|
|
|
audio = st.file_uploader("Choose your audio", type=["wav", "mp3"]) |
|
|
|
|
|
if audio is not None: |
|
|
|
with tempfile.NamedTemporaryFile(mode="wb", suffix='.wav', delete=False) as temp: |
|
|
|
bytes_data = audio.getvalue() |
|
|
|
temp.write(bytes_data) |
|
audio_temp_file = temp.name |
|
|
|
title = st.text_input("Key", value="0") |
|
|
|
if st.button("Render audio"): |
|
print("done") |
|
|