(
text2music_json_data,
extend_input_params_json,
extend_seeds,
left_extend_length,
right_extend_length,
extend_source,
extend_source_audio_upload,
prompt,
lyrics,
infer_step,
guidance_scale,
scheduler_type,
cfg_type,
omega_scale,
manual_seeds,
guidance_interval,
guidance_interval_decay,
min_guidance_scale,
use_erg_tag,
use_erg_lyric,
use_erg_diffusion,
oss_steps,
guidance_scale_text,
guidance_scale_lyric,
)
| 738 | extend_outputs, extend_input_params_json = create_output_ui("Extend") |
| 739 | |
| 740 | def extend_process_func( |
| 741 | text2music_json_data, |
| 742 | extend_input_params_json, |
| 743 | extend_seeds, |
| 744 | left_extend_length, |
| 745 | right_extend_length, |
| 746 | extend_source, |
| 747 | extend_source_audio_upload, |
| 748 | prompt, |
| 749 | lyrics, |
| 750 | infer_step, |
| 751 | guidance_scale, |
| 752 | scheduler_type, |
| 753 | cfg_type, |
| 754 | omega_scale, |
| 755 | manual_seeds, |
| 756 | guidance_interval, |
| 757 | guidance_interval_decay, |
| 758 | min_guidance_scale, |
| 759 | use_erg_tag, |
| 760 | use_erg_lyric, |
| 761 | use_erg_diffusion, |
| 762 | oss_steps, |
| 763 | guidance_scale_text, |
| 764 | guidance_scale_lyric, |
| 765 | ): |
| 766 | if extend_source == "upload": |
| 767 | src_audio_path = extend_source_audio_upload |
| 768 | # get audio duration |
| 769 | audio_duration = librosa.get_duration(filename=src_audio_path) |
| 770 | json_data = {"audio_duration": audio_duration} |
| 771 | elif extend_source == "text2music": |
| 772 | json_data = text2music_json_data |
| 773 | src_audio_path = json_data["audio_path"] |
| 774 | elif extend_source == "last_extend": |
| 775 | json_data = extend_input_params_json |
| 776 | src_audio_path = json_data["audio_path"] |
| 777 | |
| 778 | repaint_start = -left_extend_length |
| 779 | repaint_end = json_data["audio_duration"] + right_extend_length |
| 780 | return text2music_process_func( |
| 781 | format.value, |
| 782 | json_data["audio_duration"], |
| 783 | prompt, |
| 784 | lyrics, |
| 785 | infer_step, |
| 786 | guidance_scale, |
| 787 | scheduler_type, |
| 788 | cfg_type, |
| 789 | omega_scale, |
| 790 | manual_seeds, |
| 791 | guidance_interval, |
| 792 | guidance_interval_decay, |
| 793 | min_guidance_scale, |
| 794 | use_erg_tag, |
| 795 | use_erg_lyric, |
| 796 | use_erg_diffusion, |
| 797 | oss_steps, |
nothing calls this directly
no outgoing calls
no test coverage detected