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

Replace Music Section · V4

Surgery on one chorus, not a new song

By felipederosilva·Created 2 months ago·Updated 3 days ago· 3
Replace Music Section · V4
    • 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]\nOriginal lyrics content\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics►
    ◄task_id2fac****9f72►
    ◄audio_ide231****-****-****-****-****8cadc7dc►
    ◄negative_tagsRock►
    ◄lyrics[Chorus]\nModified lyrics for this section►
    ◄variety1►
    ◄vocal_genderm►
    ◄style_weight0.65►
    ◄weirdness_constraint0.65►
    ◄audio_weight0.65►
    ◄persona_idpersona_123►
    ◄persona_modelstyle_persona►
    ◄upload_urlhttps://example.com/audio.mp3►
    ◄timeout_seconds1200►
    ◄callback_url►

    You have a track you like except for eleven seconds of it. Regenerating the whole thing means losing everything else; this node regenerates just that window and hands back a song. It's the most surgical tool in the pack's Suno set, and it's also the most fiddly, because it needs to be told exactly which track and exactly which seconds.

    One caveat up front: the · V4 pins Suno's V4 provider version, and KIE's own model notes list V4 as deprecated. V4 also caps tracks at about four minutes. If you're starting fresh, use the V6 node; open this one when you're repairing a track that was made on V4.

    What it is

    KIE_Next_V4_5f28bf53 is generated by the KIE Next pack from KIE's replace-section operation, one node per documented provider version. The mechanics are infill: you give it a time window inside an existing song, plus the replacement content, and the provider re-renders that stretch in context.

    Why it matters: iteration on AI music is normally a slot machine. You get a great verse and a bad chorus, and rolling again loses the verse. Section replacement is the closest thing to a scalpel the hosted models offer, and it's the reason people keep paying for a text-to-song API at all.

    How it works

    Same pipeline as every node the pack generates - build the documented request, create the task, poll until timeout_seconds (1200 by default), download the first result URL into a ComfyUI AUDIO, report credits spent. What's specific here is that the request has to identify a source:

    • task_id is the parent generation task - "the original task ID (parent task), used to identify the source music for section replacement".
    • audio_id is the specific track within that task, which KIE returns in the callback data after a music generation completes.

    Both are optional in the schema, but leaving them empty means the provider has no source to work from, so treat them as required in practice. The clean path is: your Suno generate node's task_id output → this node's task_id, and the audio ID scraped from that generation's raw_json. The pack's KIE • Task Board lists recent task IDs if you're recovering a job from a previous session.

    The fields that matter

    infill_start_s and infill_end_s are the window, in seconds, two decimal places. The hard rule the tooltip states: start must be less than end, and the gap must be at least 10 seconds. You cannot nudge a four-second phrase - widen to ten seconds or replace a bigger chunk.

    full_lyrics is the complete lyric sheet after the replacement: the modified section plus every untouched line around it. This is the field people fumble. lyrics - optional - is only the replaced segment; full_lyrics is the whole song as it should now read.

    prompt, tags and title are all required. Fair warning on prompt: KIE's tooltip describes it as "the lyrics after replacement," which reads like a doc slip and is why it gets confused with lyrics. Give it a short description of what the section should become and let lyrics/full_lyrics carry the words.

    negative_tags is your "not this" lever - Rock is the default and it's doing something, so clear it if you want the model's discretion back. variety (0–4) trades strict stylistic similarity for exploration, 1 is balanced. vocal_gender is m/f and, per the tooltip, only nudges the odds. style_weight, weirdness_constraint and audio_weight are 0–1 dials defaulting to 0.65.

    Leave persona_id and persona_model alone on this node: KIE documents personas for V5 and newer, so on a V4 pin there's nothing to apply.

    Outputs

    audio is the finished track - Save Audio, or into KIE • Assemble Video + Music if it's scoring a clip. task_id is a new task, so it can seed a further replacement. url, all_urls_json, raw_json, credits_consumed, credits_left as usual. Not an output node: wire the audio somewhere or nothing runs.

    Installing it

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

    Or ComfyUI Manager → "KIE.ai Nodes Next", or comfy node install kie-ai-nodes-next. Restart, then Settings → KIE.ai Nodes Next → Connection and paste your key - validated before saving, masked afterwards, never stored in the workflow. Env vars aren't supported. Dependencies: requests, Pillow, numpy, PyYAML; no weights, no VRAM.

    Where people get burned

    The ten-second minimum is the big one, and it's a documented constraint rather than a bug.

    The second is the lyric sheet: sending only the new chorus in full_lyrics produces a track that thinks the rest of the song is that chorus. Paste the whole thing, edited.

    The third is cost with no undo. This is a paid render every time, and a section that comes back wrong is still billed. Right-click → KIE Next · Check inputs & model controls shows the documented limits locally for free, so window and length mistakes get caught before upload rather than after.

    CategoryKIE Next/Audio/Suno/Music Generation

    Inputs (20)

    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]\nOriginal lyrics content\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore 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****9f72The original task ID (parent task), used to identify the source music for section replacement.
    audio_idoptSTRINGe231****-****-****-****-****8cadc7dcThe unique identifier of the audio track to be replaced. This ID is returned in the callback data after music generation is completed.
    negative_tagsoptSTRINGRockMusic styles to exclude, used to prevent specific stylistic elements from appearing in the replacement section.
    lyricsoptSTRING[Chorus]\nModified 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.
    upload_urloptSTRINGhttps://example.com/audio.mp3The URL of the custom audio uploaded by the user.
    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—