APNext QwenVL Next Scene
What happens next? A local QwenVL scene-transition writer for storyboards
- images
- next_scene_prompt
- short_description
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, includingThinkingandFP8variants. 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 installedflash-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_loadedstops the load from repeating. - Out of memory - drop to a 2B or an FP8 variant, and don't enable flash attention without the
flash-attnpackage actually installed. - Next scene ignores your frames - confirm the frames are a batch (use QwenVL Frame Prep to build one) and that
max_framesisn't set lower than what you connected. - Custom template not in the dropdown - the
prompt_filelist is read at startup; drop your.txtintodata/custom_prompts/and restart ComfyUI.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| original_prompt | STRING | — | |
| qwen_model | COMBO | Qwen3-VL-2B-Instruct | 23 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_file | COMBO | next_scene.txt | 44 options: (none), cloner.txt, cloner_concept_blender.txt, extractor.txt, follow.txt, gemini.txt, +38 |
| max_frames | INT | 31–5 | — |
| seed | INT | -1-1–18446744073709550000 | — |
| randomize_each_run | BOOLEAN | true | — |
| add_scene_prefix | BOOLEAN | true | — |
| keep_model_loaded | BOOLEAN | true | — |
| use_flash_attention | BOOLEAN | false | — |
| custom_promptopt | STRING | — | |
| scene_prefix_textopt | STRING | NEW SCENE: | — |
| focus_onopt | COMBO | Automatic | 5 options: Automatic, Camera Movement, Framing Evolution, Environmental Reveals, Atmospheric Shifts |
| transition_intensityopt | COMBO | Moderate | 3 options: Subtle, Moderate, Dramatic |
| max_tokensopt | INT | 1024256–4096 | — |
| temperatureopt | FLOAT | 0.700.1–1.5 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| next_scene_prompt | STRING | — |
| short_description | STRING | — |