Nodes/ComfyUI_CSM/CSM Dialog Run
ComfyUI Node

CSM Dialog Run

Two cloned voices, one script, no API key

By billwuhao·Created about a year ago·Updated about a year ago· 7
CSM Dialog Run
  • audio_s1
  • audio_s2
  • audio
modelmodel.safetensors
text
prompt
max_audio_length_ms2000
temperature0.90
top_k50
save_speakerstrue
speakers_idA_and_B
unload_modeltrue

CSM Dialog Run is the reason this pack exists. It takes two reference audio clips - one voice per speaker - plus a script marked up with [S1] and [S2] lines, and generates a spoken two-person conversation locally, on your own GPU. No cloud service, no API key, nothing sent anywhere. It's a wrapper around Sesame AI Labs' open-source CSM (Conversational Speech Model), the 1B-parameter model that got attention in 2025 for sounding startlingly natural. The name is a lie in the good way: it doesn't call any API. "Dialog run" is just what it does - it runs the dialog through the model on your machine.

How it works

Under the hood it's a compact stack, and worth knowing what it drags in - that's most of the setup pain. The model is a two-part transformer from Sesame's csm repo: a Llama-3.2-1B backbone that handles text + audio tokens, plus a small decoder. Reference audio gets tokenized by Mimi, a 24kHz neural audio codec (the moshiko-pytorch-bf16 download), then generated frame by frame - 80ms per frame, up to max_audio_length_ms per line - and decoded back to a waveform. "Voice cloning" isn't a separate step: the model conditions on the reference clips in the context and follows them. The pack reimplements the core dialogue function (per the May 2025 changelog), which is why it runs inside ComfyUI at all.

The inputs that matter

Only a few, honestly:

  • text - your script in [S1] / [S2] format, one line each. It's forceInput, so wire it from a text node - the pack's Multi Line Text is the intended source. Plain prose with no markers raises an error.
  • prompt - the reference dialog, same [S1]/[S2] format, typed in the widget. It pairs each line with one of your reference clips so the model knows which voice belongs to whom.
  • audio_s1 / audio_s2 - two AUDIO clips (from LoadAudio or any source). These are your cloned voices - a few seconds of clean speech each.
  • max_audio_length_ms (default 2000) - cap per line, 500ms–120s. 2 seconds is fine for short lines; raise it if your lines are long.
  • temperature (0.9) and top_k (50) - standard sampling knobs. Lower temperature, more stable; raise it, more expressive. The defaults are sane.
  • save_speakers / speakers_id - if on (default), saves your reference clips and prompt to ComfyUI/models/TTS/speakers/dialogue_speakers/ under A_and_B_1.wav, A_and_B_2.wav, and A_and_B.txt. That's what the pack's Speakers Preview node reads.
  • unload_model (default on) - frees VRAM after each run. Leave it on unless you're chaining runs.

Output: one audio (AUDIO) - the whole generated conversation, both voices concatenated. Wire it into PreviewAudio or whatever you use to listen/save.

Install

Two paths, same destination:

  • ComfyUI Manager - search for ComfyUI_CSM and install it.
  • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/billwuhao/ComfyUI_CSM.git
    cd ComfyUI_CSM
    pip install -r requirements.txt   # or ./python_embeded/python.exe -m pip ...

Then the real work: three model downloads. csm-1b (config.json + model.safetensors) goes in ComfyUI/models/TTS/csm-1b; the Mimi codec tokenizer-e351c8d8-checkpoint125.safetensors from moshiko-pytorch-bf16 goes in ComfyUI/models/TTS/moshiko-pytorch-bf16; and Llama-3.2-1B (everything except the original folder) goes in ComfyUI/models/LLM/Llama-3.2-1B. The last one is a gated Meta repo - you must accept the license and be logged into Hugging Face to download it. Where people get burned: they clone the pack, pip install succeeds, then the node errors because one of these three trees is missing or in the wrong folder.

Dependencies are the other trap. requirements.txt pulls in moshi, torchtune, torchao, and silentcipher (installed straight from a GitHub URL), plus librosa and transformers. That's a chunky, conflict-prone install - version clashes with your existing torch are the top support question for this author's packs.

Gotchas

  • The model dropdown has six entries - model.safetensors is the only one the README tells you to download. model_bf16, model_int8, etc. only work if you obtained those exact files yourself; picking them with a stock install throws a load error. Default is model.safetensors and that's the right answer.
  • Long scripts get skipped, not truncated. The model has a 2048-token window, and with a big max_audio_length_ms most of it is reserved for audio frames, so very long prompts start printing "Input ... is too long and will be skipped." Keep each line reasonably short.
  • It's two speakers, full stop. The regex parses only [S1]/[S2]; a third marker isn't supported yet.
  • VRAM is fine. At 1B params it runs on modest GPUs (8GB is comfortable), which is exactly why unload_model defaults to on - it can sit next to your image/video workflow if it frees the memory after.

If a run returns empty audio, check the console: the model warns when it skips a line. And if it raises "Prompt can't empty" or a speaker/text count mismatch, your [S1]/[S2] markup is malformed.

Category🎤MW/MW-CSM

Inputs (11)

NameTypeDefaultDescription
modelCOMBOmodel.safetensors6 options: model.safetensors, chinese_model.safetensors, model_bf16.safetensors, model_fp16.safetensors, model_int8.safetensors, model_uint8.safetensors
textSTRING
promptSTRING
audio_s1AUDIO
audio_s2AUDIO
max_audio_length_msINT2000500–120000
temperatureFLOAT0.900–1
top_kINT501–100
save_speakersBOOLEANtrue
speakers_idSTRINGA_and_B
unload_modelBOOLEANtrueUnload model from memory after use

Outputs (1)

NameTypeDescription
audioAUDIO