Nodes/KIE.ai Nodes Next/Replace Music Section
ComfyUI Node

Replace Music Section

Surgery on One Chorus, Not a Whole New Song

By felipederosilva·Created about a month ago·Updated a day ago· 3
Replace Music Section
    • audio
    • url
    • all_urls_json
    • task_id
    • raw_json
    • credits_consumed
    • credits_left
    ◄promptA calm and relaxing piano track.►
    ◄tagsJazz►
    ◄titleRelaxing Piano►
    ◄infill_start_s10.50►
    ◄infill_end_s20.75►
    ◄full_lyrics[Verse 1] Original lyrics here [Chorus] Modified lyrics for this section [Verse 2] More original lyrics►
    ◄task_id2fac****9f72►
    ◄audio_ide231****-****-****-****-****8cadc7dc►
    ◄negative_tagsRock►
    ◄lyrics[Chorus] Modified lyrics for this section►
    ◄variety1►
    ◄vocal_genderm►
    ◄style_weight0.65►
    ◄weirdness_constraint0.65►
    ◄audio_weight0.65►
    ◄persona_idpersona_123►
    ◄persona_modelstyle_persona►
    ◄timeout_seconds1200►
    ◄callback_url►

    The one thing local music generation still can't do

    ACE-Step is the real story in local music: it generates minutes of audio in seconds, runs on a 4 GB card, is permissively licensed, and treats LoRAs like the image side does. If you want to make music on your own machine, that's the answer, full stop. Its weak suit - and Suno's, for the record - is vocals and lyrics.

    What's genuinely hard either way is surgical editing. You have a song. Nineteen seconds in, the second verse is flat and you want it replaced with different lyrics in the same key, same singer, same production. That's not generation, it's infilling into someone else's take, and it's the job this node exists for.

    It wraps KIE's Suno replace-section endpoint. You give it the original track's identity, a time window in seconds, and the replacement lyrics, and it returns audio. No retraining, no stem-splitting-and-reassembling in a DAW.

    The inputs, in the order they'll trip you up

    The origin. task_id and audio_id are optional in the schema, which is misleading - they're how the endpoint knows which song to operate on. Pull them off the task_id and raw_json outputs of your music-generation node. If you're guessing, you're wasting credits.

    The window. infill_start_s and infill_end_s are required floats, rounded to two decimals, and the docs are explicit that the window must be at least 10 seconds long. infill_start_s must be less than infill_end_s. Ten seconds is the floor for a reason - you're replacing a musical phrase, not a syllable.

    The lyrics. prompt is required and is, per the tooltip, "the lyrics after replacement." full_lyrics is also required and is the complete song text with your new section pasted into the structure - verse markers included. lyrics (optional) is just the replaced segment. Three text fields for one job sounds redundant until you get it wrong once: the endpoint rebuilds the whole song with your section swapped, so it needs the whole song.

    The style controls. tags (required, style tags), title (required), then a long optional tail: negative_tags, variety (0–4, default 1 - the tooltip explains 0 as "fully off, strictly the same style" through to experimental), vocal_gender (m/f, and the docs admit this "can only increase the probability"), style_weight, weirdness_constraint, audio_weight, persona_id, and persona_model (style_persona or voice_persona). Plus timeout_seconds and a callback_url to leave alone.

    Outputs: audio, url, all_urls_json, task_id, raw_json, credits_consumed, credits_left.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
    pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
    

    Restart, then set the key once under Settings → KIE.ai Nodes Next → Connection. The saved key is validated before it replaces a working one, and it never enters workflow JSON.

    Practical advice

    Do the maths before you run. A 10-second minimum window means you cannot fix a two-second vocal flub with this - for that, you're in a DAW. Work at the song-section scale: a verse, a chorus, a bridge. And keep the original task_id from generation, because both this node and Recovery Audio need it. Cheap habit, saves a re-render.

    Suno via a reseller is cloud generation with the usual terms: your lyrics and any reference audio go to someone else's server, and the provider's own moderation applies. For hobby tracks that's fine. For a client deliverable, read the licensing story first - Suno's model has been through enough versions that "which model name did I actually get" is a real question, and the raw_json output is where you'll find it.

    CategoryKIE Next/Audio/Suno/Music Generation

    Inputs (19)

    NameTypeDefaultDescription
    promptSTRINGA calm and relaxing piano track.The lyrics after replacement. Required.
    tagsSTRINGJazzStyle tags for the music, such as jazz or electronic. Required.
    titleSTRINGRelaxing PianoThe title of the music. Required.
    infill_start_sFLOAT10.500–10000The point in time, in seconds, at which replacement starts, rounded to 2 decimal places. Required. Must be less than infill_end_s, and the difference between infill_end_s and infill_start_s must be at least 10 seconds.
    infill_end_sFLOAT20.750–10000The point in time, in seconds, at which replacement ends, rounded to 2 decimal places. Required. Must be greater than infill_start_s, and the difference between infill_end_s and infill_start_s must be at least 10 seconds.
    full_lyricsSTRING[Verse 1] Original lyrics here [Chorus] Modified lyrics for this section [Verse 2] More original lyricsThe complete modified lyrics, combining the modified and unmodified lyrics. Required. This parameter contains the complete lyrics text that will be used for the entire song after section replacement.
    task_idoptSTRING2fac****9f72—
    audio_idoptSTRINGe231****-****-****-****-****8cadc7dc—
    negative_tagsoptSTRINGRockMusic styles to exclude, used to prevent specific stylistic elements from appearing in the replacement section.
    lyricsoptSTRING[Chorus] Modified lyrics for this sectionLyrics for the replaced segment. Optional. - V6, V6_MINI, and V6_WILD: Maximum 5000 characters.
    varietyoptINT10–4Controls the diversity and stylistic variation of generated results. Optional. Integer range 0–4, default 1. - **`0`**: off (exact style) — fully off, strictly the same style - **`1`**: normal (balanced variety) — default, balances stability and diversity - **`2`**: high (distinct styles) — produces results with clearly different styles - **`3`**: extra (bold exploration) — higher variation, encourages bold exploration of different styles - **`4`**: max (unreasonably varied) — maximum diversity; results may differ in style very significantly
    vocal_genderoptCOMBOmVocal gender preference. Optional. 'm' for male, 'f' for female. Based on practice, this parameter can only increase the probability but cannot guarantee adherence to male/female voice instructions.
    style_weightoptFLOAT0.650–1Adherence strength to specified style. Optional. Range 0–1, up to 2 decimal places.
    weirdness_constraintoptFLOAT0.650–1Controls experimental/creative deviation level. Optional. Range 0–1, up to 2 decimal places.
    audio_weightoptFLOAT0.650–1Relative weight of audio elements. Optional. Range 0–1, up to 2 decimal places.
    persona_idoptSTRINGpersona_123Persona ID or Voice ID to apply to the generated music. Optional. Use this to apply a specific persona style to your music generation. To generate a Persona ID, use the [Generate Persona](https://docs.kie.ai/suno-api/generate-persona) endpoint to create a personalized music Persona based on generated music. To generate a Voice ID, use the [Generate Voice](https://docs.kie.ai/suno-api/suno-voice-generate) endpoint.
    persona_modeloptCOMBOstyle_personaPersona model. Optional. Use `style_persona` for Generate Persona IDs, or `voice_persona` for Suno Voice IDs. Default: `style_persona`. Available for V5 (Discontinued), V5_5 (Discontinued), V6, V6_MINI, and V6_WILD.
    timeout_secondsoptINT120030–7200—
    callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

    Outputs (7)

    NameTypeDescription
    audioAUDIO—
    urlSTRING—
    all_urls_jsonSTRING—
    task_idSTRING—
    raw_jsonSTRING—
    credits_consumedFLOAT—
    credits_leftFLOAT—