import gradio as gr from gradio_client import Client import os import csv import numpy as np import scipy.io.wavfile as wavfile import tempfile # try: # client = Client(os.environ['src']) # except: # client = Client("http://localhost:7860/") css = """ .gradio-container input::placeholder, .gradio-container textarea::placeholder { color: #333333 !important; } code { background-color: #ffde9f; padding: 2px 4px; border-radius: 3px; } #settings-accordion summary { justify-content: center; } .examples-holder > .label { color: #b45309 !important; font-weight: 600; } .gr-checkbox label span, .gr-check-radio label span, [data-testid="checkbox"] label span, .checkbox-container span { color: #ECF2F7 !important; } .gr-checkbox label span.selected, .gr-check-radio label span.selected, [data-testid="checkbox"].selected span { color: #FFD700 !important; } #advanced-accordion > button, #advanced-accordion > button span, #advanced-accordion > div > button, #advanced-accordion > div > button span, #advanced-accordion .label-wrap, #advanced-accordion .label-wrap span, #advanced-accordion > .open, #advanced-accordion > .open span { color: #FFD700 !important; } .examples-table { border-collapse: collapse !important; width: 100% !important; } .examples-table tbody tr { background-color: #d4c896 !important; border-bottom: 2px solid #c4b886 !important; } .examples-table tbody tr:hover { background-color: #c9bd8b !important; } .examples-table tbody td { background-color: #d4c896 !important; padding: 12px 16px !important; color: #1a1a1a !important; font-weight: 500 !important; border: none !important; } .examples-table thead th { background-color: #bfb07a !important; color: #1a1a1a !important; font-weight: 600 !important; padding: 10px 16px !important; } .gallery, .gr-examples, .examples { background: transparent !important; } .gallery > div, .gr-examples > div, .examples > div { background: transparent !important; } .gallery button, .gr-examples button, .examples button, .gr-sample-textbox, button.sample { background-color: #d4c896 !important; border: 1px solid #c4b886 !important; color: #1a1a1a !important; font-weight: 500 !important; margin: 4px !important; padding: 10px 14px !important; border-radius: 6px !important; transition: background-color 0.2s ease !important; } .gallery button:hover, .gr-examples button:hover, .examples button:hover, .gr-sample-textbox:hover, button.sample:hover { background-color: #c9bd8b !important; border-color: #b4a876 !important; } #mono-examples-container .gallery button, #mono-examples-container .gr-examples button, #mono-examples-container .examples button, #mono-examples-container button.sample { background-color: #d4c896 !important; border-color: #c4b886 !important; } #stereo-examples-container .gallery button, #stereo-examples-container .gr-examples button, #stereo-examples-container .examples button, #stereo-examples-container button.sample { background-color: #c8d4a6 !important; border-color: #b8c496 !important; } #stereo-examples-container .gallery button:hover, #stereo-examples-container .gr-examples button:hover, #stereo-examples-container .examples button:hover, #stereo-examples-container button.sample:hover { background-color: #bdc9a0 !important; border-color: #a8b486 !important; } .gr-examples table, .examples table, table.examples-table { width: 100% !important; border-collapse: collapse !important; } .gr-examples table tr, .examples table tr { background-color: #d4c896 !important; } .gr-examples table tr:hover, .examples table tr:hover { background-color: #c9bd8b !important; } .gr-examples table td, .examples table td { background-color: inherit !important; padding: 12px 16px !important; color: #1a1a1a !important; font-weight: 500 !important; cursor: pointer !important; } .gr-examples .gr-samples-table, .examples .gr-samples-table { background: transparent !important; } .gr-examples .gr-samples-table tr, .examples .gr-samples-table tr { background-color: #d4c896 !important; margin-bottom: 4px !important; } .gr-examples > div > div, .examples > div > div { background-color: #d4c896 !important; border-radius: 6px !important; margin: 4px !important; padding: 8px 12px !important; } .gr-examples > div > div:hover, .examples > div > div:hover { background-color: #c9bd8b !important; } body { background: none !important; } body::before { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; background: url('https://i.postimg.cc/1smD6GPf/gradio-theme-rin2.png') center center / cover no-repeat; } """ def save_audio_to_temp(audio_data): if audio_data is None: return None sample_rate, audio_array = audio_data if isinstance(audio_array, list): audio_array = np.array(audio_array) if audio_array.dtype == np.float32 or audio_array.dtype == np.float64: audio_array = (audio_array * 32767).astype(np.int16) tmp = tempfile.NamedTemporaryFile(suffix='.wav', delete=False) wavfile.write(tmp.name, sample_rate, audio_array) tmp.close() return tmp.name def cleanup_temp(path): if path is not None: try: os.unlink(path) except: pass def load_examples(csv_path): examples = [] if not os.path.exists(csv_path): return examples try: with open(csv_path, 'r', encoding='utf-8') as f: reader = csv.reader(f, delimiter=',', quotechar='"', doublequote=True) for row in reader: if len(row) >= 2: audio_path = row[0].strip() text = row[1].strip() if text.startswith('"') and text.endswith('"'): text = text[1:-1] elif text.startswith("'") and text.endswith("'"): text = text[1:-1] if text.startswith('\u201c') and text.endswith('\u201d'): text = text[1:-1] if text.startswith('\u300c') and text.endswith('\u300d'): text = text[1:-1] speaker_id = 1 if len(row) >= 3 and row[2].strip(): try: speaker_id = int(row[2].strip()) except ValueError: speaker_id = 1 pregenerated_audio = None if audio_path and audio_path.lower() != "none" and audio_path != "": if not os.path.isabs(audio_path): base_dir = os.path.dirname(csv_path) audio_path = os.path.join(base_dir, audio_path) if os.path.exists(audio_path): pregenerated_audio = audio_path examples.append([text, pregenerated_audio, speaker_id]) except Exception as e: pass return examples def run_generation_pipeline_client( raw_text, audio_prompt, use_stereo, speaker_id, cfg_scale, temperature, min_temp, max_temp, top_k, top_p, min_p, dry_multiplier, max_tokens, pan_idx, width_idx, seed, ): try: audio_path = save_audio_to_temp(audio_prompt) audio_for_api = None if audio_path is not None: audio_for_api = {"path": audio_path, "meta": {"_type": "gradio.FileData"}} result = client.predict( raw_text, audio_for_api, use_stereo, speaker_id, cfg_scale, temperature, min_temp, max_temp, top_k, top_p, min_p, dry_multiplier, max_tokens, pan_idx, width_idx, seed, "", api_name="/run_generation_pipeline" ) cleanup_temp(audio_path) if result is None: return None, "Status: No response from server" if isinstance(result, (list, tuple)) and len(result) == 2: audio_result, status_msg = result if audio_result is not None: if isinstance(audio_result, str) and os.path.exists(audio_result): sr, data = wavfile.read(audio_result) return (sr, data), status_msg elif isinstance(audio_result, (list, tuple)) and len(audio_result) >= 2: sr = audio_result[0] data = audio_result[1] if isinstance(data, list): data = np.array(data) return (sr, data), status_msg return None, status_msg return None, "Status: Unexpected response format from server" except Exception as e: cleanup_temp(audio_path if 'audio_path' in dir() else None) return None, f"Status: Connection error: {str(e)}" def run_alchemy_pipeline_client( raw_text, ref_audio_1, ref_audio_2, mix_ratio, cfg_scale, speaker_cfg_scale, speaker_adaln_scale, temperature, min_temp, max_temp, temp_exponent, top_k, top_p, min_p, dry_multiplier, max_tokens, seed, ): try: ref1_path = save_audio_to_temp(ref_audio_1) ref2_path = save_audio_to_temp(ref_audio_2) ref1_for_api = None if ref1_path is not None: ref1_for_api = {"path": ref1_path, "meta": {"_type": "gradio.FileData"}} ref2_for_api = None if ref2_path is not None: ref2_for_api = {"path": ref2_path, "meta": {"_type": "gradio.FileData"}} result = client.predict( raw_text, ref1_for_api, ref2_for_api, mix_ratio, cfg_scale, speaker_cfg_scale, speaker_adaln_scale, temperature, min_temp, max_temp, temp_exponent, top_k, top_p, min_p, dry_multiplier, max_tokens, seed, "", api_name="/run_alchemy_pipeline" ) cleanup_temp(ref1_path) cleanup_temp(ref2_path) if result is None: return None, "Status: No response from server" if isinstance(result, (list, tuple)) and len(result) == 2: audio_result, status_msg = result if audio_result is not None: if isinstance(audio_result, str) and os.path.exists(audio_result): sr, data = wavfile.read(audio_result) return (sr, data), status_msg elif isinstance(audio_result, (list, tuple)) and len(audio_result) >= 2: sr = audio_result[0] data = audio_result[1] if isinstance(data, list): data = np.array(data) return (sr, data), status_msg return None, status_msg return None, "Status: Unexpected response format from server" except Exception as e: cleanup_temp(ref1_path if 'ref1_path' in dir() else None) cleanup_temp(ref2_path if 'ref2_path' in dir() else None) return None, f"Status: Connection error: {str(e)}" examples_mono_csv_path = "samples/examples_mono.csv" examples_stereo_csv_path = "samples/examples_stereo.csv" example_list_mono = load_examples(examples_mono_csv_path) example_list_stereo = load_examples(examples_stereo_csv_path) with gr.Blocks(theme="Respair/Shiki@10.1.0", css=css) as demo: # gr.Markdown('

🪷 Takane - Mirei 「美嶺」

') # gr.HTML('

🪷 Takane - Mirei 「美嶺」

') # gr.HTML('

🪷 Takane - Mirei 「美嶺」

') # gr.Markdown( # """ #
# 美嶺はゼロショットモデルではなく、話者ID付きで学習しているため、音声プロンプトとの話者類似性はどのみち低めになります。
#
# """ # ) gr.Markdown( """
Demo is closed until further notice; thank you for using it. Feel free to check the pre-generated samples at the Examples tab.
""" ) with gr.Tabs(): with gr.TabItem("Speech Generation"): with gr.Row(): with gr.Column(scale=2): text_input = gr.Textbox( label="Text here", lines=5, max_length=125, placeholder="ここでテキストを入力してください...\n\n" ) use_stereo_checkbox = gr.Checkbox( label="🎧 Use Stereo Mode", value=False, info="⚠️ ステレオ生成は現在無効になっています。" ) with gr.Row(equal_height=False): with gr.Accordion("----------------------------------⭐ 🛠️ ⭐", open=False): audio_prompt_input = gr.Audio( label="Audio Prompt (Optional — Please set Speaker ID to 1)", sources=["upload", "microphone"], type="numpy" ) speaker_id_slider = gr.Slider( label="Speaker ID", minimum=1, maximum=2000, value=1, step=1 ) gr.Markdown('

Common Parameters

') cfg_scale_slider = gr.Slider( label="CFG Scale", minimum=1.0, maximum=3.0, value=1.15, step=0.05 ) temperature_slider = gr.Slider( label="Temperature (Min/Max Temp の両方が 0 に設定されている場合のみ有効です)", minimum=0.0, maximum=2.0, value=1.0, step=0.05 ) min_temp_slider = gr.Slider( label="Min Temperature (0 = off; ignored in stereo mode)", minimum=0.0, maximum=2.0, value=0.25, step=0.05 ) max_temp_slider = gr.Slider( label="Max Temperature (0 = off; ignored in stereo mode)", minimum=0.0, maximum=2.0, value=1.0, step=0.05 ) top_k_slider = gr.Slider( label="Top K (0 = off)", minimum=0, maximum=200, value=0, step=1 ) top_p_slider = gr.Slider( label="Top P", minimum=0.0, maximum=1.0, value=1.0, step=0.01 ) min_p_slider = gr.Slider( label="Min P (0 = off)", minimum=0.0, maximum=1.0, value=0.0, step=0.01 ) max_tokens_slider = gr.Slider( label="Max Tokens", minimum=100, maximum=1500, value=768, step=10 ) dry_multiplier_slider = gr.Slider( label="DRY Multiplier (0 = off)", minimum=0.0, maximum=2.0, value=0.8, step=0.1 ) seed_slider = gr.Slider( label="Seed (-1 for random)", minimum=-1, maximum=2700000000, value=-1, step=1 ) gr.Markdown('

Stereo-Only Parameters

') pan_idx_slider = gr.Slider( label="Pan (0=Left, 5=Center, 10=Right)", minimum=0, maximum=10, value=2, step=1 ) width_idx_slider = gr.Slider( label="Stereo Width (0=Narrow, 10=Wide)", minimum=0, maximum=10, value=5, step=1 ) with gr.Column(scale=1): generate_button = gr.Button("🎤 Generate", variant="primary", size="lg") with gr.Column(scale=1): status_output = gr.Textbox(label="Status", interactive=False) audio_output = gr.Audio( label="Generated Speech", interactive=False ) def on_stereo_toggle(use_stereo): if use_stereo: temp, min_t, max_t, min_p_val = 1.0, 0.0, 0.0, 0.05 if len(example_list_stereo) >= 2: ex = example_list_stereo[1] text = ex[0] sid = ex[2] path = ex[1] if path and os.path.exists(path): sr, data = wavfile.read(path) return (gr.update(value=temp), gr.update(value=min_t), gr.update(value=max_t), gr.update(value=min_p_val), gr.update(value=text), gr.update(value=sid), (sr, data), "Status: Stereo example loaded / ステレオ例を読み込みました") return (gr.update(value=temp), gr.update(value=min_t), gr.update(value=max_t), gr.update(value=min_p_val), gr.update(), gr.update(), gr.update(), gr.update()) else: temp, min_t, max_t, min_p_val = 1.0, 0.25, 1.0, 0.0 if len(example_list_mono) >= 2: ex = example_list_mono[-1] text = ex[0] sid = ex[2] path = ex[1] if path and os.path.exists(path): sr, data = wavfile.read(path) return (gr.update(value=temp), gr.update(value=min_t), gr.update(value=max_t), gr.update(value=min_p_val), gr.update(value=text), gr.update(value=sid), (sr, data), "Status: Mono example loaded / モノラル例を読み込みました") return (gr.update(value=temp), gr.update(value=min_t), gr.update(value=max_t), gr.update(value=min_p_val), gr.update(), gr.update(), gr.update(), gr.update()) use_stereo_checkbox.change( fn=on_stereo_toggle, inputs=[use_stereo_checkbox], outputs=[temperature_slider, min_temp_slider, max_temp_slider, min_p_slider, text_input, speaker_id_slider, audio_output, status_output] ) generate_button.click( fn=run_generation_pipeline_client, inputs=[ text_input, audio_prompt_input, use_stereo_checkbox, speaker_id_slider, cfg_scale_slider, temperature_slider, min_temp_slider, max_temp_slider, top_k_slider, top_p_slider, min_p_slider, dry_multiplier_slider, max_tokens_slider, pan_idx_slider, width_idx_slider, seed_slider, ], outputs=[audio_output, status_output], concurrency_limit=4 ) with gr.TabItem("⚗️ Alchemy ⚗️"): # gr.HTML(""" #
#

# Upload audio references and mix them to create new voices. # Upload two references and adjust the mix ratio, or use a single reference. #

#
# """) with gr.Row(): with gr.Column(scale=2): alch_text_input = gr.Textbox( label="Synthesize", lines=5, placeholder="日本語のテキストを入力してください...\n\n", value="睡眠は、心身の健康を保つために欠かせない大切な時間です。良質な睡眠をとることで、一日の疲れを癒やし、脳内の情報を整理することができます。寝る前にスマートフォンを控えたり、温かい飲み物を飲んでリラックスすることで、より深く眠れるようになります。明日も元気に過ごすために、今夜はゆっくりと体を休めましょうね。" ) alch_mix_ratio = gr.Slider( minimum=0.0, maximum=1.0, value=0.5, step=0.05, label="Mix Ratio", ) with gr.Row(): with gr.Column(): gr.HTML("""

🔊 Reference 1

""") alch_ref_audio_1 = gr.Audio( label="Reference Audio 1", sources=["upload", "microphone"], type="numpy", value="samples/sample_01.mp3" ) with gr.Column(): gr.HTML("""

🔊 Reference 2 (Optional)

""") alch_ref_audio_2 = gr.Audio( label="Reference Audio 2 (Optional)", sources=["upload", "microphone"], type="numpy", value="samples/sample_02.mp3" ) with gr.Row(equal_height=False): with gr.Accordion("----------------------------------⭐ 🛠️ ⭐", open=False): gr.Markdown('

Style Parameters

') alch_cfg_scale = gr.Slider( label="CFG Scale", minimum=0.5, maximum=3.0, value=1.4, step=0.05 ) alch_speaker_cfg_scale = gr.Slider( label="Speaker CFG Scale (Legacy - just rely AdaLN scale)", minimum=0.5, maximum=3.0, value=1., step=0.1 ) alch_speaker_adaln_scale = gr.Slider( label="Speaker AdaLN Scale (値を上げると参照音声に近づきますが、不自然になる可能性があります)", minimum=0.0, maximum=3.0, value=2., step=0.1 ) gr.Markdown('

Sampling Parameters

') alch_temperature = gr.Slider( label="Temperature (Min/Max Temp の両方が 0 に設定されている場合のみ有効です)", minimum=0.0, maximum=2.0, value=0.0, step=0.05 ) alch_min_temp = gr.Slider( label="Min Temperature (0 = off)", minimum=0.0, maximum=1.0, value=0.1, step=0.05 ) alch_max_temp = gr.Slider( label="Max Temperature (0 = off)", minimum=0.0, maximum=2.0, value=1.0, step=0.1 ) alch_temp_exponent = gr.Slider( label="Temperature Exponent", minimum=0.5, maximum=2.0, value=1.0, step=0.1 ) alch_top_k = gr.Slider( label="Top K (0 = off)", minimum=0, maximum=200, value=0, step=5 ) alch_top_p = gr.Slider( label="Top P", minimum=0.0, maximum=1.0, value=1.0, step=0.01 ) alch_min_p = gr.Slider( label="Min P (0 = off)", minimum=0.0, maximum=1.0, value=0.0, step=0.01 ) alch_max_tokens = gr.Slider( label="Max Tokens", minimum=100, maximum=1500, value=1024, step=10 ) alch_dry_multiplier = gr.Slider( label="DRY Multiplier (0 = off)", minimum=0.0, maximum=2.0, value=0.8, step=0.1 ) alch_seed = gr.Slider( label="Seed (-1 for random)", minimum=-1, maximum=2700000000, value=42, step=1 ) with gr.Column(scale=1): alch_generate_button = gr.Button("⚗️ Generate", variant="primary", size="lg") with gr.Column(scale=1): alch_status_output = gr.Textbox(label="Status", interactive=False) alch_audio_output = gr.Audio( label="Transmuted Speech", interactive=False, value="samples/audio_62.wav" ) alch_generate_button.click( fn=run_alchemy_pipeline_client, inputs=[ alch_text_input, alch_ref_audio_1, alch_ref_audio_2, alch_mix_ratio, alch_cfg_scale, alch_speaker_cfg_scale, alch_speaker_adaln_scale, alch_temperature, alch_min_temp, alch_max_temp, alch_temp_exponent, alch_top_k, alch_top_p, alch_min_p, alch_dry_multiplier, alch_max_tokens, alch_seed, ], outputs=[alch_audio_output, alch_status_output], concurrency_limit=4 ) with gr.TabItem("Description Guided *NEW*"): gr.HTML("""

Try it here!

Create the voice you want by describing it with a prompt (gender, tone, characteristic, emotion etc.)

🎨 Open Voice Design Space

こちらで試せます!

このモードでは、性別・口調・感情などをプロンプトで指示するだけで、好みの声を作成できます。

""") with gr.TabItem("Examples"): gr.HTML("""

Click on any example below to load the text and hear the pre-generated audio. / 下の例をクリックすると、テキストが読み込まれ、生成済みの音声を聞くことができます。

""") example_text_holder = gr.Textbox(visible=False) def load_mono_example_fn(text): for ex in example_list_mono: if ex[0] == text: pregenerated_path = ex[1] sid = ex[2] if pregenerated_path and os.path.exists(pregenerated_path): try: sample_rate, audio_data = wavfile.read(pregenerated_path) status = "Status: Mono example loaded / モノラル例を読み込みました" return text, False, sid, (sample_rate, audio_data), status except Exception as e: return text, False, sid, None, f"Status: Error loading audio: {str(e)}" else: return text, False, sid, None, "Status: Mono example loaded (no pre-generated audio)" return text, False, 1, None, "Status: Mono example loaded" def load_stereo_example_fn(text): for ex in example_list_stereo: if ex[0] == text: pregenerated_path = ex[1] sid = ex[2] if pregenerated_path and os.path.exists(pregenerated_path): try: sample_rate, audio_data = wavfile.read(pregenerated_path) status = "Status: Stereo example loaded / ステレオ例を読み込みました" return text, True, sid, (sample_rate, audio_data), status except Exception as e: return text, True, sid, None, f"Status: Error loading audio: {str(e)}" else: return text, True, sid, None, "Status: Stereo example loaded (no pre-generated audio)" return text, True, 1, None, "Status: Stereo example loaded" with gr.Row(): with gr.Column(scale=1, elem_id="mono-examples-container"): gr.HTML("""

🔊 Mono

""") if example_list_mono: mono_example_texts = [[ex[0]] for ex in example_list_mono] gr.Examples( examples=mono_example_texts, inputs=[example_text_holder], outputs=[text_input, use_stereo_checkbox, speaker_id_slider, audio_output, status_output], fn=load_mono_example_fn, label="Click to load a mono example", cache_examples=False, run_on_click=True, examples_per_page=15 ) else: gr.Markdown("*No mono examples available*") with gr.Column(scale=1, elem_id="stereo-examples-container"): gr.HTML("""

🎧 Stereo

""") if example_list_stereo: stereo_example_texts = [[ex[0]] for ex in example_list_stereo] gr.Examples( examples=stereo_example_texts, inputs=[example_text_holder], outputs=[text_input, use_stereo_checkbox, speaker_id_slider, audio_output, status_output], fn=load_stereo_example_fn, label="Click to load a stereo example", cache_examples=False, run_on_click=True, examples_per_page=15 ) else: gr.Markdown("*No stereo examples available*") with gr.TabItem("Guide"): gr.HTML('

🪷 Takane - Mirei 「美嶺」

') with gr.Row(): with gr.Column(scale=1): gr.HTML("""

日本語

⚠️ サーバー負荷を軽くするため、オリジナルのTakaneとは違い、このデモではハルシネーション対策などの安全策を省いています。 そのため、モデルの出力が崩れたり、デモが止まるリスクは通常より高いです。 たまにメンテしますが、あくまでWIPということでご了承ください。

Mirei「美嶺」 は、Takane の系譜に連なる最新モデルであり、高品質なアニメっぽい日本語音声生成のためにゼロから再構築・再設計されたモデルです。より大規模で高速、かつクリーンな音質を実現し、機能も増え、学習コストも大幅に抑えられています。

これは、現代の最高峰の技術を駆使し、究極の日本語音声合成モデルを開発するという私の目標に向けた、新たな一歩です。

初代 Takane との比較:


注意事項:

Prefilling と RyuseiNet についての注記

コーデックベースのモデルにおける Audio prompting のデフォルトモードは Prefilling です。これは、ボイスクリップからオーディオトークンを抽出し、その文字起こしと共に入力に結合する方法です。 問題点はコンテキストを消費してしまうことです。モデルは入力を、プロンプトの自然な続きとして扱うためです。

例えば、モデルが主に30秒のチャンクで学習されている場合、リファレンス+出力の合計長は30秒未満である必要があります。また、安全のためにバッファを持たせることも推奨されます。例えば、出力が約20秒になる場合、オーディオプロンプトは5〜6秒程度に収めるべきです。

RyuseiNet (Alchemy mode) では、この制限はありません。それに話者の類似性がより高く、入力テキストに対してより頑健です。ただし、参考のために両方の手法を残しています。

""") with gr.Column(scale=1): gr.HTML("""

English

Mirei (美嶺) is the continuation of my work from Takane, rebuilt and redesigned from the ground up for high-quality, anime-style Japanese voice generation. It's larger, faster, sounds cleaner, has more features, and is also much cheaper to train.

It is another step toward my goal of developing the ultimate Japanese speech and audio synthesis model, pushing as far as today's best technology can take.

Compared to the base Takane, Mirei adds:


Notes:

A Note about Prefilling vs RyuseiNet

The default mode for audio prompting in any codec-based model is prefilling — where you extract audio tokens from your voice clip and glue them together with the transcription as your input. The problem is it eats up your context, because the model treats your input as if it is a natural continuation of your prompt.

For example, if your model was trained on mostly 30-second chunks, the length of your reference + the output should be less than 30 seconds. It's also recommended to keep a safety buffer. For example, if your output will be roughly 20 seconds, your audio prompt should be around 5–6 seconds to be in the safe zone.

For RyuseiNet (Alchemy mode), we don't have this limitation, it has a better speaker similarity and more robust to your input text. But I am keeping both methods for reference.

""") gr.HTML("""

If you need help or have questions, feel free to contact me on X / Twitter or Discord (@soshyant)

""") def load_default_example(): if len(example_list_stereo) >= 2: return load_stereo_example_fn(example_list_stereo[1][0]) return gr.update(), gr.update(), gr.update(), None, "" # def load_default_example(): # if len(example_list_mono) >= 2: # return load_mono_example_fn(example_list_mono[-1][0]) # return gr.update(), gr.update(), gr.update(), None, "" demo.load( fn=load_default_example, inputs=None, outputs=[text_input, use_stereo_checkbox, speaker_id_slider, audio_output, status_output] ) if __name__ == "__main__": demo.queue(api_open=False, max_size=15).launch()