fix(ui): preserve src_audio for text2music + flow_edit_morph (#1156)

Root cause of the user's "Flow-edit morph requires a source audio"
error chain.  In ``generation_progress.generate_with_progress`` (the
layer right above ``GenerationParams``):

    if task_type == "text2music":
        src_audio = None

This pre-overlay defensive guard zeroed ``src_audio`` for every
Custom-mode run.  When flow_edit_morph was enabled the backend then
saw ``src_audio=None`` and bailed via the morph guard ("Flow-edit
morph requires a source audio").  Earlier debug rounds — soundfile /
torchaudio / ffmpeg checks, label disambiguation, validation
non-clearing, inference's own ``src_audio`` ternary — were all
chasing downstream symptoms.  This wrapper-level zeroing was the
real source.

Gate the zeroing on ``not flow_edit_morph`` so the morph path keeps
``src_audio`` and Custom-mode without morph still drops it (no
behaviour change for that case).

Also remove the now-stale wrapper-level debug log added while
hunting; the src_audio guard log in the request layer is enough.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gong Junmin 2026-04-30 21:36:01 +08:00
parent 8398eabca6
commit 1b0a95c573

View file

@ -116,7 +116,12 @@ def generate_with_progress(
task_type = resolve_no_fsq_task_type(task_type, bool(no_fsq))
if task_type == "text2music":
# text2music never uses src_audio EXCEPT when flow_edit_morph is on:
# the morph overlay needs the source audio for ``zt_src``/``zt_tar``
# formation in the V_delta integration. Without this guard the UI
# silently zeroed src_audio for Custom mode and the backend's morph
# check then errored with "Flow-edit morph requires a source audio".
if task_type == "text2music" and not flow_edit_morph:
src_audio = None
# Defensive guard: cover/repaint/extract/lego tasks should never use