(
text2music_json_data,
edit_input_params_json,
edit_source,
edit_source_audio_upload,
prompt,
lyrics,
edit_prompt,
edit_lyrics,
edit_n_min,
edit_n_max,
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,
retake_seeds,
)
| 586 | edit_outputs, edit_input_params_json = create_output_ui("Edit") |
| 587 | |
| 588 | def edit_process_func( |
| 589 | text2music_json_data, |
| 590 | edit_input_params_json, |
| 591 | edit_source, |
| 592 | edit_source_audio_upload, |
| 593 | prompt, |
| 594 | lyrics, |
| 595 | edit_prompt, |
| 596 | edit_lyrics, |
| 597 | edit_n_min, |
| 598 | edit_n_max, |
| 599 | infer_step, |
| 600 | guidance_scale, |
| 601 | scheduler_type, |
| 602 | cfg_type, |
| 603 | omega_scale, |
| 604 | manual_seeds, |
| 605 | guidance_interval, |
| 606 | guidance_interval_decay, |
| 607 | min_guidance_scale, |
| 608 | use_erg_tag, |
| 609 | use_erg_lyric, |
| 610 | use_erg_diffusion, |
| 611 | oss_steps, |
| 612 | guidance_scale_text, |
| 613 | guidance_scale_lyric, |
| 614 | retake_seeds, |
| 615 | ): |
| 616 | if edit_source == "upload": |
| 617 | src_audio_path = edit_source_audio_upload |
| 618 | audio_duration = librosa.get_duration(filename=src_audio_path) |
| 619 | json_data = {"audio_duration": audio_duration} |
| 620 | elif edit_source == "text2music": |
| 621 | json_data = text2music_json_data |
| 622 | src_audio_path = json_data["audio_path"] |
| 623 | elif edit_source == "last_edit": |
| 624 | json_data = edit_input_params_json |
| 625 | src_audio_path = json_data["audio_path"] |
| 626 | |
| 627 | if not edit_prompt: |
| 628 | edit_prompt = prompt |
| 629 | if not edit_lyrics: |
| 630 | edit_lyrics = lyrics |
| 631 | |
| 632 | return text2music_process_func( |
| 633 | format.value, |
| 634 | json_data["audio_duration"], |
| 635 | prompt, |
| 636 | lyrics, |
| 637 | infer_step, |
| 638 | guidance_scale, |
| 639 | scheduler_type, |
| 640 | cfg_type, |
| 641 | omega_scale, |
| 642 | manual_seeds, |
| 643 | guidance_interval, |
| 644 | guidance_interval_decay, |
| 645 | min_guidance_scale, |
nothing calls this directly
no outgoing calls
no test coverage detected