Nodes/ACE-Step-ComfyUI/ACE-Step Audio Codes
ComfyUI Node

ACE-Step Audio Codes

A clipboard for ACE-Step's internal audio tokens — why you'd ever want those

By ace-step·Created 7 months ago·Updated 6 months ago· 78
ACE-Step Audio Codes
    • audio_codes
    audio_codes
    audio_codes_in

    ACE-Step doesn't just produce audio - it produces a text representation of that audio: a string of <|audio_code_N|> tokens that the model can read back in. ACE-Step Audio Codes is the node that holds those tokens so you can look at them, edit them, or feed them back in as a source. It's an editable passthrough, and it exists because "keep the codes" is genuinely useful even though the workflow doesn't strictly need it.

    You'll typically grab the audio_codes output from the Text2music Server node and wire it into this node's audio_codes_in input. The node forwards it as its audio_codes output. From there it plugs into the Gen Params node's audio_codes input - and now you can use that generation as the source for a follow-up cover or remix without ever loading a WAV file. That's the real trick: audio codes are the compact, lossless-ish handoff between generations. The server converts raw audio to codes internally when needed, so this node is how you short-circuit that by keeping the codes yourself.

    The two inputs are simple:

    • audio_codes - a big multiline text box. Paste tokens in by hand, or use it as the display/editor. Empty by default.
    • audio_codes_in - optional, and it wins. If this is connected and non-empty, its value is what passes through; the manual box only counts if the input is empty. So think of the box as the fallback.

    The output is a single STRING, also named audio_codes. One node, one passthrough - that's the whole job. It's marked as an output node, meaning it can sit at the end of the graph and render its content in the UI so you can read the codes without digging into the API response.

    Why would you care about the tokens at all? A few honest reasons: you want to keep a generation's source representation for a session without holding the audio file; you're iterating on a cover and want the exact same internal source each time; or you're curious and want to eyeball what the model actually "heard." For the plain use case of "generate a song and save it," you can skip this node entirely. It earns its place when you start chaining generations.

    Install & gotchas

    Same pack as everything else - ACE-Step-ComfyUI:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ace-step/ACE-Step-ComfyUI.git
    cd ACE-Step-ComfyUI
    pip install -r requirements.txt
    

    Restart ComfyUI. Only torch, numpy, and requests are needed, so no install friction here.

    The one thing that trips people up: when both the manual box and audio_codes_in have content, the connected input silently wins and the box's text is ignored. If you're editing codes in the box and they're not taking effect, check whether a wire is still attached to audio_codes_in. And note these tokens are just text - there's no validation, so a mistyped paste produces an error at the server, not here.

    Categoryapi node/audio/ACE-Step

    Inputs (2)

    NameTypeDefaultDescription
    audio_codesSTRINGAudio codes (<|audio_code_N|> tokens). Edit manually or receive from audio_codes_in.
    audio_codes_inoptSTRINGAuto-fill from Text2Music Server output or paste manually

    Outputs (1)

    NameTypeDescription
    audio_codesSTRING