Nodes/ComfyUI MIDI Edit/MIDI Merge Repeated Chars
ComfyUI Node

MIDI Merge Repeated Chars

The tiny cleanup node that fixes ASR's stuck-syllable doubles

By ahkimkoo·Created 3 months ago·Updated about a month ago· 5
MIDI Merge Repeated Chars
    • text
    text

    This one is a utility node, and it's honest about it. One input, one output: text in, text out, with consecutive repeated characters collapsed to a single one. 向向往 becomes 向往. That's the entire job description.

    Why it exists

    Transcription produces duplicated characters for a couple of reasons. Held notes and melisma - one syllable sung across several notes - make the transcriber repeat the character, so you get 天天天 where the song has one long . And when you're stitching lyric edits together, repeats can sneak in at the seams. The transcribe node has its own smarter merge that knows real reduplication words like 哥哥 should stay as two, but this node is the blunt instrument: collapse everything consecutive, no questions asked.

    What you actually do with it

    Realistically, you'll use it in cleanup chains rather than by itself. Drop it after MIDI Extract Lyrics to tidy up held-note doubles before you read or reuse the text - though note that Extract already merges internally when its resegment switch is on, so this only matters on the default path. It's also handy for scrubbing any text you're about to feed into MIDI Edit Lyrics or MIDI Lyrics Alignment, since the edit nodes expand repeats on their own and clean input gives them less to un-tangle.

    Input is text (STRING, multiline). Output is text. Nothing else - no knobs, no models, no hidden downloads. It's pure Python string processing, which makes it the least dangerous node in the pack to run.

    Install

    Shared with the whole pack: ComfyUI Manager (search "ComfyUI MIDI Edit"), or the manual route:

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/ahkimkoo/ComfyUI-MIDI-Edit.git
    pip install -r requirements.txt
    

    The --recursive matters even though this node touches none of the heavy stuff: the pack vendors the SoulX-Singer engine as a git submodule, and without --recursive that directory comes up empty, which breaks the pack's import entirely. If you cloned without it, git submodule update --init --recursive inside the folder is the fix. And since this node needs no SoulX models, you can install the pack and use just the lyric-editing utilities without downloading a single multi-gigabyte file.

    CategoryMIDI-Edit

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING