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

APNext QwenVL Next Scene

What happens next? A local QwenVL scene-transition writer for storyboards

By dagthomas·Created 3 years ago·Updated about 18 hours ago· 285
APNext QwenVL Next Scene
  • images
  • next_scene_prompt
  • short_description
original_prompt
qwen_modelQwen3-VL-2B-Instruct
prompt_filenext_scene.txt
max_frames3
seed-1
randomize_each_runtrue
add_scene_prefixtrue
keep_model_loadedtrue
use_flash_attentionfalse
custom_prompt
scene_prefix_textNEW SCENE:
focus_onAutomatic
transition_intensityModerate
max_tokens1024
temperature0.70

If you're building a visual narrative shot by shot - storyboarding, iterating an image-to-video sequence, planning a scene-by-scene animation - the endless question is "what comes next?" This node answers it locally: feed it up to five frames of where you are plus a description of the previous scene, and a QwenVL vision model writes the next scene's prompt - with camera movement, framing evolution, environmental reveals or atmospheric shifts, tuned to how dramatic you want the transition.

The whole thing runs on your own GPU. No API key, no cloud bill, no uploads - which for iterative creative work is a genuinely nice property; you can re-roll scene ideas all afternoon for free. And because it's a vision model looking at actual frames, it doesn't rely on your description being complete: it can see the composition, the light, the props, and carry that forward into the next beat. Multiple frames help it understand motion and progression - that's the 1–5 frame input, and it's the reason the QwenVL Frame Prep node exists to feed it.

How it works

The mechanism is simple under the hood: your frames plus original_prompt (the previous scene description) go into a prompt template, the QwenVL model generates the next scene, and the node splits the result into a full next_scene_prompt and a punchy short_description. Templates live in data/custom_prompts/ - the default next_scene.txt is a detailed cinematography template, with qwen_next_scene_simple.txt and qwen_next_scene_video.txt (optimized for AI video generation) also included - and you can add your own with ##ORIGINAL_PROMPT## as the placeholder.

The knobs that actually matter:

  • qwen_model - Qwen3-VL from 2B up to 8B, including Thinking and FP8 variants. Start with 4B Instruct as a sweet spot; drop to 2B if VRAM is tight, or use an FP8 build to halve memory at a small quality cost.
  • focus_on - Camera Movement, Framing Evolution, Environmental Reveals, Atmospheric Shifts, or Automatic. Picks what the transition emphasizes.
  • transition_intensity - Subtle, Moderate or Dramatic.
  • max_frames - how many of the batch to actually use (1–5).
  • prompt_file / custom_prompt - the template, or an inline override.
  • keep_model_loaded (on by default) - caches the model so your next run doesn't reload it.
  • use_flash_attention - off unless you've installed flash-attn; it's faster and lighter on memory, but it's an extra package.

Outputs are next_scene_prompt (wire this into your video model or the next step) and short_description. The add_scene_prefix toggle (default on) prepends NEW SCENE: - or your own scene_prefix_text - to keep chained generations easy to tell apart.

Install

Pack install is standard - ComfyUI Manager (search "comfyui_dagthomas") or:

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

Restart. Then the real requirement: the QwenVL model downloads itself on first use to ComfyUI/models/LLM/Qwen-VL/ - the 2B Instruct is a modest download, 8B is chunky. You can also drop model files in there manually, and the dropdown includes Thinking variants for deeper reasoning (slower) and FP8 variants for smaller VRAM footprints.

Common issues

  • First run takes forever - that's the model downloading, then loading. The download only happens once; keep_model_loaded stops the load from repeating.
  • Out of memory - drop to a 2B or an FP8 variant, and don't enable flash attention without the flash-attn package actually installed.
  • Next scene ignores your frames - confirm the frames are a batch (use QwenVL Frame Prep to build one) and that max_frames isn't set lower than what you connected.
  • Custom template not in the dropdown - the prompt_file list is read at startup; drop your .txt into data/custom_prompts/ and restart ComfyUI.
Categorycomfyui_dagthomas/LLM

Inputs (16)

NameTypeDefaultDescription
imagesIMAGE
original_promptSTRING
qwen_modelCOMBOQwen3-VL-2B-Instruct23 options: Qwen3-VL-2B-Instruct, Qwen3-VL-2B-Thinking, Qwen3-VL-2B-Instruct-FP8, Qwen3-VL-2B-Thinking-FP8, Qwen3-VL-4B-Instruct, Qwen3-VL-4B-Thinking, +17
prompt_fileCOMBOnext_scene.txt44 options: (none), cloner.txt, cloner_concept_blender.txt, extractor.txt, follow.txt, gemini.txt, +38
max_framesINT31–5
seedINT-1-1–18446744073709550000
randomize_each_runBOOLEANtrue
add_scene_prefixBOOLEANtrue
keep_model_loadedBOOLEANtrue
use_flash_attentionBOOLEANfalse
custom_promptoptSTRING
scene_prefix_textoptSTRINGNEW SCENE:
focus_onoptCOMBOAutomatic5 options: Automatic, Camera Movement, Framing Evolution, Environmental Reveals, Atmospheric Shifts
transition_intensityoptCOMBOModerate3 options: Subtle, Moderate, Dramatic
max_tokensoptINT1024256–4096
temperatureoptFLOAT0.700.1–1.5

Outputs (2)

NameTypeDescription
next_scene_promptSTRING
short_descriptionSTRING