Nodes/Music Production Toolkit/YuE2 Cover Studio · 2 transform score
ComfyUI Node

YuE2 Cover Studio · 2 transform score

The node that only builds a prompt

By jplenio·Created 19 days ago·Updated a day ago· 55
YuE2 Cover Studio · 2 transform score
    • system_prompt
    • user_prompt
    • studio_json
    studio_json
    plan_text
    enabledtrue

    Three nodes in this studio, and the middle one looks nearly empty on the canvas: one required input, two optional ones, three outputs, no model. If you're the kind of person who deletes nodes that "do nothing", don't delete this one - it's the hinge between the plan and the actual score rewrite.

    What it does is fold the planner's answer into the studio state and write the transformation prompt. That's it. It makes no model call, it touches no score. Understanding that saves you a debugging session or two, because when the rewrite goes wrong, it usually isn't this node.

    What it puts in the prompt

    When an LLM is asked to rewrite a musical score, the prompt quality is the task. So this node assembles, in a fixed order:

    • the transformer role text - kept in a file, resources/yue2/abc-transformer.txt, read fresh on each call. Edit it and re-queue; no Python changes needed. (It deliberately isn't in prompts/system/, which is the user-facing template library that shows up in the prompt dropdowns.)
    • the explicit local ABC reference for the YuE2 dialect, injected automatically rather than left to the model's memory of notation.
    • the interpretation profile from step 1.
    • the cover plan, plus a plan summary appended to the system prompt.
    • the requested vocal range, when it isn't auto, with the instruction to move a phrase by an octave rather than rewrite its rhythm.
    • the structured request with the source score.

    This is the same instinct that shows up all over ComfyUI's LLM nodes: a chat model with no constraint hands you its conversational habits as literal output, so the prompt does the constraining up front.

    Inputs

    studio_json is required - the state from the plan step, carrying the profile, the analysed score, the original ABC and any accumulated warnings.

    plan_text is the planner's answer. Optional, and useful in a way people don't expect: leave it unconnected and you can inspect the exact transformation prompt without spending a model call, which is how you tune the role file.

    enabled off passes the score through unchanged - off means off, byte for byte.

    What "contradiction" means here

    The interesting logic is in the middle. The planner is an LLM, and an LLM plan will happily promise to rework an element the profile pins - say, "I'll rewrite the melody" when the profile says melody is preserved at this freedom level.

    The node doesn't average that away or quietly drop it. It records the contradiction into the state's warnings, and keeps the plan only for the elements it doesn't contradict. So you end up with a plan you can trust partially, and a report that says exactly which part to distrust. Given that the whole point of this studio is that the slider means something, that's the right call - silently reconciling the two would make the slider a suggestion.

    A missing or unusable plan is not fatal. If plan_text is prose rather than JSON, you get a warning ("the planner answer was not a usable JSON plan; the profile alone is used") and the transformation proceeds on the profile. One bad stage of a two-stage LLM pipeline shouldn't lose you a render.

    Outputs and wiring

    system_prompt and user_prompt go into a second LLM Chat node - this one is the transform call. studio_json goes on to step 3, validate & apply, along with the transform node's text answer.

    The answer contract is one JSON object:

    {"abc": "...", "changes": [], "warnings": []}
    

    Prose and code fences wrapped around it are tolerated and stripped. That tolerance doesn't extend to the score itself: this node doesn't validate anything, so a score that fails validation is caught (and rejected) one step later, never used. At most two model calls happen across the whole studio - one plan, one transform - plus one optional repair.

    Install

    Nothing extra beyond the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jplenio/ComfyUI-MiniMax-Music-Production-Toolkit.git
    cd ComfyUI-MiniMax-Music-Production-Toolkit
    python -m pip install -r requirements.txt
    

    Restart ComfyUI and reload the browser, then reopen the bundled Music_Production_Toolkit.json - the studio isn't in a saved personal workflow unless you put it there. The transform LLM can be a GGUF inside ComfyUI, a local server, or a cloud provider; the studio doesn't care which, it just needs two chat nodes it can hand prompts to.

    Troubleshooting

    If the score comes out unchanged, that's usually not this node - check step 3's warnings output and its report, which name the rejected change and why.

    If you want to work with the untouched score again, bypass nodes 1 and 2 with Ctrl+B; the chain degrades to the original score rather than breaking, because step 3 also takes the score directly as a safety-net input.

    And if the rewrite is bland, edit abc-transformer.txt. It's a plain text file, it's read on every call, and it's the single highest-leverage thing in this part of the graph - far more so than re-rolling the plan.

    CategoryMiniMax Music Production Toolkit/generation

    Inputs (3)

    NameTypeDefaultDescription
    studio_jsonSTRINGCover Studio state passed between the studio nodes. It carries the profile, the plan, the source score and the warnings so each step stays inspectable.
    plan_textoptSTRINGAnswer of the planning LLM call. A missing or unusable plan is not fatal: the studio then follows the interpretation profile alone.
    enabledoptBOOLEANtrueTurn the whole Cover Studio path on or off. Disabled, the incoming score is passed through byte for byte, so an existing workflow keeps behaving exactly as before.

    Outputs (3)

    NameTypeDescription
    system_promptSTRING
    user_promptSTRING
    studio_jsonSTRING