Nodes/ComfyUI-AV-FunASR/AV Save Subtitles
ComfyUI Node

AV Save Subtitles

The node that finally writes your .srt — AV Save Subtitles

By avenstack·Created about a year ago·Updated about a year ago· 24
AV Save Subtitles
      subtitles
      filename_prefixsubtitles

      Every other node in this pack produces text: transcripts, timestamped JSON, a subtitle string. AV Save Subtitles is the one that takes that text and turns it into a real .srt file sitting on your disk, ready to drag into a video editor. It's the least glamorous node in the pack and the one you can't finish a workflow without.

      You probably found it by searching the pack title, ComfyUI-AV-FunASR - a Chinese-authored pack that does local speech recognition with Alibaba's FunASR toolkit and ModelScope models. The flow is always the same: feed audio to AV ASR Timestamp (or AV Speech Timestamp), run the result through AV Format to Subtitle, then land the SRT with this node. No API, no key, no cloud - the whole thing runs on your GPU or CPU.

      What it does

      It's an output node with exactly two inputs and no outputs:

      • subtitles - the SRT text to save. In practice you wire this from AV Format to Subtitle's subtitle output. Any string works, so you could also dump raw transcript text here, but then you'd get a .srt that's just plain text with no timing - don't do that.
      • filename_prefix - default subtitles. This is the prefix, not the full filename; the node appends a counter, so your file lands as something like subtitles_00001_.srt.

      That counter is the standard ComfyUI save convention, and it's a small mercy: you can run the workflow ten times and never overwrite an earlier take. The file goes into ComfyUI/output (the same folder your images land in), written in UTF-8. The 1.0.1 update of the pack made UTF-8 the default encoding specifically for the subtitle output - relevant if you're sharing subtitles with Chinese text, where a wrong encoding turns everything into mojibake.

      The node does zero validation. Feed it a malformed string and it writes a malformed file, happily. So if you want to eyeball the SRT before committing it to disk, stick a text preview node in between - worth it the first time, because the alignment logic in the formatting node is more "clever heuristic" than "guaranteed."

      Installing and getting it running

      Same story as every other node in this pack:

      cd ComfyUI/custom_nodes
      git clone https://github.com/avenstack/ComfyUI-AV-FunASR.git
      cd ComfyUI-AV-FunASR
      pip install -r requirements.txt
      

      then restart ComfyUI. ComfyUI Manager will find it if you search for "ComfyUI-AV-FunASR". The gotcha: the model files don't auto-download. You have to grab them from modelscope.cn (the README links them) and drop them under ComfyUI/models/ASR/FunASR/iic/, matching the names exactly - the node only creates the directory, it won't fetch the model.

      Troubleshooting

      • ModuleNotFoundError: funasr (or torchaudio) - neither requirements.txt nor the registry metadata declares funasr or torchaudio, but the code imports both. Fix: pip install funasr torchaudio. This bites a lot of people on a fresh install.
      • File isn't in the output folder - check ComfyUI/output, not the pack's own directory. The counter suffix means there may already be a subtitles_00001_.srt; look at the newest.
      • You never saw the node run because the ASR node before it errored - this node is the last link in the chain, so nearly every failure upstream shows up here first. The two ASR nodes are the heavy ones (multi-GB models); this one is trivial.

      It's boring on purpose. That's the job - one node, two inputs, file on disk.

      CategoryAven/AV-FunASR

      Inputs (2)

      NameTypeDefaultDescription
      subtitlesSTRINGThe subtitles to save.
      filename_prefixSTRINGsubtitlesThe prefix for the file to save.

      Outputs (0)

      No outputs