Nodes/DIGIT Nodes/DIGIT SRT From Video
ComfyUI Node

DIGIT SRT From Video

Subtitles from any video, transcribed by Gemini and burned in if you want

By thedepartmentofexternalservices·Created 6 months ago·Updated 26 days ago· 0
DIGIT SRT From Video
    • srt_filepath
    • srt_text
    video_path
    modelgemini-2.5-flash
    subtitle_outputsrt_only
    extra_instructions
    projekts_root
    project
    filenametranscription
    gcp_project_id
    gcp_region
    identify_speakerstrue
    pad_frames0
    frame_rate23.976
    snap_to_framesfalse
    max_chars_per_line42
    max_lines2
    remove_hallucinationstrue
    output_formatsrt
    languageauto
    translate_tonone
    font_nameArial
    font_size24
    font_colorwhite
    outline_colorblack
    outline_width2
    shadow_depth1
    positionbottom_center
    margin_v30

    If you've ever transcribed a video, you know the usual path is Whisper or a web tool, then a lot of manual SRT cleanup. DIGIT SRT From Video skips most of that: point it at a video file, and it extracts the audio, sends it to Gemini for transcription with timestamps, runs a proper subtitle post-processing pipeline, and hands you broadcast-ready SRT (or VTT, ASS, TXT - or burned straight into the video). It's from the same DIGIT pack as SRT Maker, but where Maker builds captions from a script, this one works from the audio. Two different jobs, complementary.

    The appeal is the post-processing. Raw LLM transcription is messy - repeated hallucinated lines, 200-character entries, timestamps that land mid-frame. This node fixes those before you ever see the file: hallucination removal, line-length enforcement, frame padding, and snapping timestamps to frame boundaries. That last one matters more than it sounds on frame-accurate systems like Flame, where a subtitle that flickers between frames is a delivery failure.

    The inputs that matter

    • video_path - the file. Browse button in the UI, or paste a path.
    • model - gemini-2.5-flash by default; you can step up to Pro or the Gemini 3 previews if accuracy on hard audio matters more than speed.
    • subtitle_output - srt_only (sidecar files), burn_in_only (hardcode subs into the video), or both.
    • extra_instructions - free text like "ignore background music" or "this is a commercial". Genuinely worth filling in; it's cheap accuracy.
    • language - auto works, but specifying the language improves timestamps. translate_to adds a translation pass that preserves timing.
    • The post-processing knobs: max_chars_per_line (42 = Netflix/broadcast standard), max_lines (2), pad_frames (breathing room), snap_to_frames, remove_hallucinations (on by default).
    • Burn-in styling, only when you're hardcoding: font_name, font_size, font_color, outline_width, shadow_depth, position, margin_v. If you're just saving sidecars, ignore all of them.

    Outputs: srt_filepath (where it saved) and srt_text (the raw content, handy for piping into SRT Preview or SRT Tools for more QA).

    How it works

    Under the hood: ffmpeg extracts the audio to a small mono 16kHz WAV, Gemini transcribes with precise timestamps, and the post-processing pipeline runs in order. If you chose burn_in_only or both, it re-encodes the video with the subtitles overlaid - if an ASS file was produced it uses that for full styling, otherwise it applies force_style to the SRT. Files land in PROJEKTS/project/assets/auto_srt/ following the pack's VFX folder convention.

    Setup

    Same pack install as everything else here - ComfyUI Manager, search comfyui-digit, restart. Two environment prerequisites:

    # Gemini needs GCP Vertex auth
    gcloud auth application-default login
    # ffmpeg must be on PATH or nothing works
    ffmpeg -version
    

    The GCP setup is the standard DIGIT one: enable aiplatform.googleapis.com, set gcp_project_id on the node (or rely on auto-detect), leave gcp_region at global. If you see a "File not found" that's the ffmpeg check or the path being wrong - and if audio extraction fails, ffmpeg isn't finding the codec, which is a system-level problem, not a node bug.

    CategoryDIGIT

    Inputs (27)

    NameTypeDefaultDescription
    video_pathSTRING
    modelCOMBOgemini-2.5-flash9 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-3.1-pro-preview, +3
    subtitle_outputCOMBOsrt_onlysrt_only: sidecar file(s). burn_in_only: hardcode subs into video. both: file(s) + burned-in video.
    extra_instructionsSTRING
    projekts_rootCOMBO1 options: /root/PROJEKTS
    projectCOMBO1 options: (no projects found)
    filenameSTRINGtranscription
    gcp_project_idSTRINGGCP project ID.
    gcp_regionSTRINGGCP region.
    identify_speakersoptBOOLEANtrueTry to identify and label different speakers.
    pad_framesoptINT00–120Extend each subtitle by this many frames on both sides (head and tail).
    frame_rateoptFLOAT23.9761–120Frame rate of the video. Used for pad_frames and snap-to-frame.
    snap_to_framesoptBOOLEANfalseSnap all timestamps to nearest frame boundary. Prevents subtitle flicker on frame-accurate systems.
    max_chars_per_lineoptINT420–80Max characters per subtitle line. 42 = Netflix/broadcast standard. 0 = no enforcement.
    max_linesoptINT21–4Max lines per subtitle entry. Entries exceeding this get split.
    remove_hallucinationsoptBOOLEANtrueDetect and remove repeated/hallucinated subtitle entries.
    output_formatoptCOMBOsrtOutput format(s). 'all' saves SRT + VTT + ASS + TXT.
    languageoptCOMBOautoLanguage of the audio. 'auto' lets Gemini detect. Improves accuracy when specified.
    translate_tooptCOMBOnoneTranslate subtitles to this language after transcription. 'none' = no translation.
    font_nameoptSTRINGArialFont family for burn-in subtitles.
    font_sizeoptINT248–120Font size for burn-in subtitles.
    font_coloroptCOMBOwhiteSubtitle text color.
    outline_coloroptCOMBOblackSubtitle outline/border color.
    outline_widthoptINT20–8Outline thickness around subtitle text.
    shadow_depthoptINT10–8Shadow depth behind subtitle text.
    positionoptCOMBObottom_centerWhere to place subtitles on screen.
    margin_voptINT300–200Vertical margin from screen edge (pixels at 1080p).

    Outputs (2)

    NameTypeDescription
    srt_filepathSTRING
    srt_textSTRING