yuvraj108c / ComfyUI-Whisper

Transcribe audio and add subtitles to videos using Whisper in ComfyUI
Other
64 stars 8 forks source link

Proposal: use whisper-ts instead of the original whisper #2

Open Quasimondo opened 3 months ago

Quasimondo commented 3 months ago

Given that whisper-ts has some very nice improvements regarding the precision of timestamp alignments you might want to consider to replace the current whisper with whisper-ts - I tested it and it only requires a few lines of code to change:

import stable_whisper as whisper

[...]
#old:
#result = model.transcribe(audio_save_path,word_timestamps=True)

#new:
result = model.transcribe_minimal(audio_save_path,word_timestamps=True)
result = model.align(audio_save_path, result, language=result.language).to_dict()
yuvraj108c commented 3 months ago

Thanks. Make a PR and I'll merge it.