Nodes/ComfyUI-Qwen3-TTS/Qwen3-TTS Data Prep
ComfyUI Node

Qwen3-TTS Data Prep

The tokenization step that makes Qwen3-TTS fine-tuning tractable — and it caches

By DarioFT·Created 7 months ago·Updated 7 months ago· 299
Qwen3-TTS Data Prep
    • processed_jsonl_path
    jsonl_path
    tokenizer_repoQwen/Qwen3-TTS-Tokenizer-12Hz
    sourceHuggingFace
    batch_size16

    Qwen3-TTS Data Prep is the middle stage of the pack's fine-tuning pipeline - the node that actually does the heavy lifting between "here's my dataset" and "here's something trainable." You feed it the dataset.jsonl from Qwen3-TTS Dataset Maker, it tokenizes every audio file into the model's internal code representation, and it writes a *_codes.jsonl that Qwen3-TTS Finetune can consume. If you skip this node and try to train directly on raw audio, training fails with a missing-audio_codes error. It's not skippable.

    How it works

    The key to understanding it: Qwen3-TTS doesn't train on waveforms. Its tokenizer (the Qwen/Qwen3-TTS-Tokenizer-12Hz repo, downloaded on first use into ComfyUI/models/Qwen3-TTS/) compresses each audio clip into a sequence of discrete audio codes - the "12Hz" in the model name refers to this tokenization rate. Data Prep loads that tokenizer, runs every clip through it in batches, and appends the resulting audio_codes to each JSONL entry. The output is the exact thing the training loop needs, and it's also a big part of why training is tractable on a consumer card: the audio is pre-compressed once instead of during every epoch.

    Four inputs, and only two you'll touch:

    • jsonl_path - the dataset from the Dataset Maker node. Output is the same path with _codes.jsonl appended.
    • batch_size - how many audio files are tokenized at once, default 16. This is your VRAM dial: lower it if you hit OOM during this step. The node even clears GPU cache between batches.
    • tokenizer_repo and source - fixed to the Qwen tokenizer and your download source (HuggingFace/ModelScope). Leave them alone.

    The nicest feature is the cache. The node hashes your input file (SHA256), stores metadata, and if you re-run it on unchanged data it returns the existing _codes.jsonl instantly instead of re-tokenizing. Combined with the progress text it pushes to the ComfyUI UI, it's a well-behaved node for something that can take a few minutes on a large dataset.

    The inputs and outputs that matter

    jsonl_path in, processed_jsonl_path out (a string path, wired to Finetune's train_jsonl). The batch_size tooltip is the author's own guidance: "Number of audio files to process at once. Lower values use less VRAM." Default 16 is fine on most GPUs; if you're on an 8GB card or below and see OOM, drop to 4–8.

    Installing & troubleshooting

    Same pack install: ComfyUI Manager (search "ComfyUI-Qwen3-TTS") or git clone https://github.com/DarioFT/ComfyUI-Qwen3-TTS into custom_nodes, then pip install -r requirements.txt manually - ComfyUI won't auto-install it, and qwen-tts pinning transformers==4.57.3 can downgrade your environment.

    Two things to know: first run downloads the tokenizer (a few hundred MB, one time). And "No valid cache metadata, reprocessing" isn't an error - it's the cache telling you the input changed, which is correct behavior. Out-of-memory during processing is the one real failure mode, and the fix is the batch_size input you already have.

    CategoryQwen3-TTS/FineTuning

    Inputs (4)

    NameTypeDefaultDescription
    jsonl_pathSTRING
    tokenizer_repoCOMBOQwen/Qwen3-TTS-Tokenizer-12Hz1 options: Qwen/Qwen3-TTS-Tokenizer-12Hz
    sourceCOMBOHuggingFace2 options: HuggingFace, ModelScope
    batch_sizeINT161–32Number of audio files to process at once. Lower values use less VRAM.

    Outputs (1)

    NameTypeDescription
    processed_jsonl_pathSTRING