Nodes/KIE.ai Nodes Next/Get MIDI Generation Details
ComfyUI Node

Get MIDI Generation Details

Get MIDI Generation Details

By felipederosilva·Created about a month ago·Updated about 22 hours ago· 3
Get MIDI Generation Details
    • audio
    • url
    • all_urls_json
    • task_id
    • raw_json
    • credits_consumed
    • credits_left
    ◄timeout_seconds1200►
    ◄expert_override_json{}►

    What it's for

    MIDI generation is the most DAW-shaped thing in this pack. You have a sung performance, and you want the notes: pitches and timings you can drop into a piano roll, quantise, reassign to a synth, or hand to a session musician. That's what this endpoint does - it transcribes musical content out of the audio, and this node reads the resulting task record.

    The workflow it belongs to is the deep end of the Suno chain: generate a song, separate the vocals, transcribe to MIDI, then take the result somewhere that isn't ComfyUI at all. Comfy has no piano roll. The honest use case is a one-way door out of the graph and into a DAW, or an intermediate step where you re-voice the melody with something you control.

    Also worth knowing the naming: it sits under the Vocal Removal group in the node menu, because the pack organises these Suno utilities by function and MIDI extraction is a downstream sibling of vocal separation rather than a top-level category of its own. Look there, not under a MIDI folder that doesn't exist.

    It's a read. Nothing is transcribed on this node's account, nothing is charged, nothing is uploaded.

    How it works

    The node queries the MIDI task's record through the pack's shared KIE client and your saved key. The pack's status reader follows the Suno conventions: a status field on the response data, SUCCESS means done, and terminal failure states raise a KIE API error with the provider's own message (CREATE_TASK_FAILED, GENERATE_AUDIO_FAILED, CALLBACK_EXCEPTION, SENSITIVE_WORD_ERROR, FAILED). You'll see the audio-flavoured failure codes because this is the audio API family.

    One structural note, because it explains several oddities in this group: a Suno task is a container holding multiple artifacts, each with its own ID. That's why the lyric and separation neighbours ask for more than a task ID. For a MIDI extraction you're typically pointing at a derived artifact - so grab the identifiers from the run that produced them rather than reconstructing them from memory.

    Inputs and outputs

    No required inputs. KIE's documentation page for this record endpoint had no machine-readable request schema at catalog-build time, so this node was generated through the pack's fallback path - which, for this family, means no required fields at all rather than a placeholder prompt.

    Optional:

    • timeout_seconds - INT, default 1200, min 30, max 7200, step 30. The wait budget for the request itself.
    • expert_override_json - STRING, default {}, the pack's escape hatch "for APIs whose documentation has no request schema yet." On a GET-shaped node the pack sends those keys as query parameters, so your task and track identifiers go here. An empty override asks nothing.

    The pack re-fetches unresolved documentation on demand, so a reload can upgrade these fields to real documented parameters. Take them if they show up.

    Outputs: audio (AUDIO), url, all_urls_json, task_id, raw_json (STRING), credits_consumed, credits_left (FLOAT). Yes, audio - the pack derives the output signature from the API family, and this is the audio family. What you actually want for a MIDI artifact is the link, so read url, and if the payload has more than one URL, all_urls_json is your list. raw_json is the whole record.

    Installing

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

    Restart ComfyUI, then save your key at Settings → KIE.ai Nodes Next → Connection. The pack checks the key against KIE before replacing a working one, then displays a masked fingerprint; the full key stays in ComfyUI's user config directory and never lands in the workflow. That's the behaviour you want when sharing graphs. On a server, KIE_API_KEY overrides the saved value.

    Requirements: requests, Pillow, numpy, PyYAML. Nothing model-shaped gets installed and nothing is downloaded, because every node in this pack is an HTTP client. The Windows one-click installer in dist/ is the README's recommended route for desktop users.

    Where people get burned

    The chain-order trap. MIDI extraction depends on a prior step having produced the right source artifact, and if you point it at the wrong ID - or at a task that only ever produced a mixed track - you get either an error or an empty-looking record. Point at the derived artifact, not the parent song.

    Second, timing. Transcription is real work on a server; querying immediately gives you an in-progress record.

    Third, and this is the one that wastes people's afternoons: ComfyUI is not where you edit MIDI. If you're expecting to nudge notes around in the graph, you'll be disappointed - export it, open your DAW, do the musical work there. This node's job ends the moment the file exists.

    And the general caveat that applies to the whole pack: it's a metered reseller API, so the audio you submit leaves your machine, the provider's own filters still apply, and costs are per call. Fine for iterating on a hook; less fine as a bulk loop you forgot to bound.

    CategoryKIE Next/Audio/Suno/Vocal Removal

    Inputs (2)

    NameTypeDefaultDescription
    timeout_secondsoptINT120030–7200—
    expert_override_jsonoptSTRING{}Expert-only payload overrides for APIs whose documentation has no request schema yet.

    Outputs (7)

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