Nodes/SDXL Auto Prompter/APNext Gemini Next Scene
ComfyUI Node

APNext Gemini Next Scene

Generate the next shot for a video sequence with Gemini

By dagthomas·Created 3 years ago·Updated 12 days ago· 283
APNext Gemini Next Scene
  • image
  • next_scene_prompt
  • short_description
original_prompt
gemini_modelgemini-2.5-flash
seed-1
randomize_each_runtrue
add_scene_prefixtrue
scene_prefix_textNEW SCENE:
focus_onAutomatic
transition_intensityModerate

This one's a clever niche tool. You give it the current frame of a sequence and the prompt that produced it, and Gemini writes the prompt for the next shot - a natural continuation with a camera move, a framing change, or an atmospheric shift. It's built for storyboarding and image-to-video work, where the hard part isn't any single frame but making one shot flow believably into the next. Instead of hand-writing "and now push in slightly and let the fog roll in," you let a vision model that can actually see the current frame propose the transition.

It fits a real, growing workflow. As people chain image and video models to build sequences, "what's the next scene" becomes a prompt-writing problem, and having Gemini look at the frame and continue the story is a smart way to keep continuity without babysitting every step. It's a specialist node - you won't use it for one-off images - but for sequential/I2V work it earns its slot.

How it works

The node sends your current image plus the original_prompt (the previous scene's description) to Gemini, which analyzes the frame and writes a continuation prompt. You steer the kind of continuation with focus_on (Camera Movement, Framing Evolution, Environmental Reveals, Atmospheric Shifts, or Automatic) and how big a jump it is with transition_intensity (Subtle, Moderate, Dramatic). It can prepend a scene marker so downstream video models know a cut is happening.

The inputs and outputs that matter

  • image - the current frame. Gemini looks at this to ground the continuation.
  • original_prompt - the previous scene's description; the "where we are now" the model builds from.
  • focus_on (optional) - what changes in the next shot. Automatic lets Gemini decide; the others force a camera move, a reframe, a reveal, or a mood shift.
  • transition_intensity (optional) - Subtle for a gentle continuation, Dramatic for a hard change.
  • gemini_model - the model dropdown; Flash is the cheap default.
  • add_scene_prefix + scene_prefix_text (default NEW SCENE:) - prepend a marker to the output.
  • seed + randomize_each_run - vary the proposed transitions.

Two outputs: next_scene_prompt (the full continuation prompt to feed your next generation) and short_description (a compact summary of the transition).

How to install it

ComfyUI Manager: search comfyui_dagthomas, install, restart. Manual:

cd ComfyUI/custom_nodes && git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas && pip install -r requirements.txt

then restart. Needs google-generativeai (in requirements.txt) and a GEMINI_API_KEY set in the environment before launching ComfyUI.

Where people get burned

  • Key missing or set too late. Export GEMINI_API_KEY before starting ComfyUI.
  • Hosted ComfyUI blocks it. It's a cloud call; serverless instances usually can't make it. For a fully local sequence pipeline, the pack's QwenVL Next Scene node does the same job with a local model.
  • Garbage in, garbage out on continuity. If original_prompt doesn't actually match the frame you passed, the continuation drifts. Keep the previous prompt and the current image in sync.
  • Dramatic can break coherence. A big transition intensity is great for a real cut, bad if you wanted a smooth pan. Match the intensity to the edit you actually want.
  • It writes prompts, not video. This node only produces the next prompt - you still feed that into your image/video model to render the shot.
Categorycomfyui_dagthomas

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
original_promptSTRING
gemini_modelCOMBOgemini-2.5-flash5 options: gemini-2.5-pro, gemini-flash-latest, gemini-2.5-flash, gemini-flash-lite-latest, gemini-2.5-flash-lite
seedINT-1-1–18446744073709550000
randomize_each_runBOOLEANtrue
add_scene_prefixBOOLEANtrue
scene_prefix_textoptSTRINGNEW SCENE:
focus_onoptCOMBOAutomatic5 options: Automatic, Camera Movement, Framing Evolution, Environmental Reveals, Atmospheric Shifts
transition_intensityoptCOMBOModerate3 options: Subtle, Moderate, Dramatic

Outputs (2)

NameTypeDescription
next_scene_promptSTRING
short_descriptionSTRING