LTX-GapFill Prompt (LTX Video Bridge)
Two Clips, an Awkward Gap, and a Gemini That Writes the Bridge Prompt
- clip_before_last_frame
- clip_after_first_frame
- suggested_prompt
- report
LTX Desktop users got a feature ComfyUI never had: "Fill with Video." You've got two clips on a timeline with empty space between them, and instead of staring at a frozen frame and hand-wrestling a prompt for the missing shot, the app just suggests one. This node - GeminiFillPrompt, shown in the node browser as LTX-GapFill Prompt (LTX Video Bridge) - is a faithful port of that exact feature. Give it the last frame of clip A and the first frame of clip B, and Google Gemini 2.5 Flash writes the prompt for the clip that bridges them. Wire that into any LTX sampler and the gap fills itself.
This matters for LTX specifically because LTX lives or dies on its prompt. The model famously needs long, detailed descriptions - "the secret sauce for LTX seems to be long prompts" has been community gospel since the 0.9.x days. People have been piping frames into local VLM models just to get a decent paragraph, and this node automates the same trick with the actual system prompt Lightricks ships in LTX Desktop (reproduced verbatim from suggest_gap_prompt_handler.py). Same thinking as running minicpm-v over your input image, except you don't have to babysit a second model.
How it works
Under the hood it's a single HTTPS call, not a model load. The node grabs the last frame from whatever's plugged into clip_before_last_frame (the first frame from clip_after_first_frame), converts it to a base64 JPEG, assembles a Gemini generateContent payload with the LTX Desktop system prompt, and POSTs it to Google with your API key in the header. It's honest about the mechanics: seed is a ComfyUI cache-buster only and is not sent to Gemini - Gemini has no seed concept, and the tooltip says so flat out. Change it to force a re-run, or pair it with a Randomize seed node to get fresh suggestions automatically.
A genuinely clever detail: plug in a full video batch (say from VHS LoadVideo) and it auto-selects the right frame - last frame for the clip before the gap, first for the one after. No frame-picking nodes needed.
Inputs that matter
gemini_api_key- the one thing you must supply. Free from aistudio.google.com/app/apikey, no card required.prompt_style- picks the system prompt flavor.LTX Desktop system prompt(2–4 sentences, verbatim from the app), ordetailed,cinematic,narrative(5–10 sentences, up to 1024 tokens). For the faithful-app-experience start with the LTX Desktop option.gap_duration- how long the missing clip should be, in seconds. Defaults to 5.resize_before_send/max_size_px- frames are resized to keep the payload under Gemini's ~20MB inline limit. Leave both alone unless you need Gemini to read fine text in a frame.clip_before_last_frame/clip_after_first_frame- wire your two clips here. Works one-sided too: feed only one and it'll suggest something that leads into or out of your single shot (handy for opening and closing shots).prompt_before/prompt_after- optional text descriptions of each clip. Gemini combines frames and words, so feeding both gives notably better continuity.
It outputs a single suggested_prompt STRING that goes straight into CLIP Text Encode → your LTX sampler, plus a report STRING for a Show Text node showing exactly what was sent and what came back.
Installing it
No model downloads, no heavy deps - requirements.txt is just requests, Pillow, numpy, which a standard ComfyUI install already has. Easiest path is ComfyUI Manager: search "ComfyUI-LTX-GapFill" and install. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/PixWizardry/ComfyUI-LTX-GapFill
Restart ComfyUI and the nodes appear under LTX → Gap Fill. The only real setup step is pasting your free Gemini key into the node.
Where people get burned
- It's SFW only. Google's content policy sits between you and the API, so NSFW frames or prompts get rejected outright. The README is unambiguous about this.
- Missing or wrong key → the node throws a boxed error with the aistudio link. A 400
API_KEY_INVALIDgets the same treatment. - Quota exceeded (429) → the free tier is genuinely enough (one call per generation), but the daily reset is roughly midnight PT. The error message tells you exactly when to come back or how to enable billing.
- Everything cached? ComfyUI skips unchanged nodes, so your "new" generation won't fire. That's what
seedis for. - Timeout after 30s → the error suggests dropping
max_size_px, which is solid advice.
It's a small pack from a small author (PixWizardry, an LTX-focused r/comfyui workflow builder) - the code is clean, honest about the Lightricks credit, and does exactly one thing well. If you're stitching together multi-shot LTX videos, it's the difference between guessing the bridge and having a plan.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | ComfyUI workflow helper only — this value is NOT sent to Gemini. Gemini has no seed concept. Change this value to force the node to re-run when all other inputs are unchanged. |
| gemini_api_key | STRING | Google Gemini API key. Free at https://aistudio.google.com/ | |
| model | COMBO | gemini-2.5-flash | Gemini model to use. All listed models are available on the free tier with limitations. |
| custom_model | STRING | Override the model dropdown with any Gemini model ID (e.g. gemini-3.2-flash). Leave blank to use the dropdown selection. | |
| prompt_style | COMBO | LTX Desktop system prompt | LTX Desktop system prompt — verbatim LTX Desktop prompt, 2-4 sentences. detailed — 6-10 sentences, full camera/lighting/motion description. cinematic — 5-8 sentences, cinematographer framing and lighting language. narrative — 5-8 sentences, story-driven with emotional arc and character action. |
| gap_duration | FLOAT | 5.00.5–120 | Duration of the gap to fill, in seconds. |
| resize_before_send | BOOLEAN | true | Resize images before sending to Gemini. Recommended — prevents hitting the 20 MB inline payload limit and speeds up the request. Gemini only needs scene-level detail. |
| max_size_px | INT | 512128–2048 | Longest edge in pixels when resize_before_send is enabled. |
| clip_before_last_frameopt | IMAGE | Connect the clip BEFORE the gap here. The node automatically uses the last frame. Single image or full VHS video batch — last frame auto-selected. | |
| clip_after_first_frameopt | IMAGE | Connect the clip AFTER the gap here. The node automatically uses the first frame. Single image or full VHS video batch — first frame auto-selected. | |
| prompt_beforeopt | STRING | Prompt or description of the clip before the gap. | |
| prompt_afteropt | STRING | Prompt or description of the clip after the gap. | |
| custom_system_promptopt | STRING | WARNING: Overrides the prompt_style dropdown entirely with your own system prompt. Use with caution — a poorly written system prompt can produce vague or unusable results, wasting API tokens and counting against your daily quota. Leave blank to use the prompt_style dropdown (recommended). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| suggested_prompt | STRING | — |
| report | STRING | — |