首尾帧过渡提示词生成 (Comfly/T8)
Turn two frames into one smooth video-transition prompt
- first_frame
- last_frame
- transition_prompt
A bunch of video models - Wan, LTX, Kling-style first-last-frame workflows - want a prompt that describes the whole journey from frame A to frame B, not two separate scene descriptions. Writing that by hand is tedious and the result is usually stiff ("a room... then a brighter room"). This node takes your first frame and last frame as images, ships them to a vision LLM on a Comfly or T8 mirror API, and hands you back one continuous English prompt describing the transition: "a person smoothly walking from the left side of a room to the right side, transitioning from dim to bright lighting, the camera follows the movement…". You feed that straight into the video generator's prompt slot.
It's one of the "Comfly/T8" family inside ComfyUI_LLM_Banana, Ken Chen's grab-bag multimodal pack. Like every node in that family, it doesn't run a model locally - it's an HTTP client with an API key - the external-api-nodes KB doc has the full frame on why that category exists and its tradeoffs. No GPU needed, but your frames leave the machine.
How it works
Under the hood it posts both frames as base64 to {base_url}/chat/completions with Authorization: Bearer, using the built-in system prompt (editable, Chinese comments included) that tells the model to analyze the start state, the end state, and everything that changes between them, then emit a comma-separated, third-person prompt with quality words tacked on the end. The default model is gpt-4-v - you want something with vision here, not a text-only chat model.
The inputs that matter
first_frame/last_frame- the two IMAGE wires from your Load Image nodes. Both are required.api_provider- pick your mirror: Comfly, Comfly-HK/US, or the T8 variants. The base URL and key come fromChatFly_config.json(prompt_api_providers) unless you override them.api_key/base_url- leave blank to fall back to the config file; fill them to override.model- the dropdown is built from the providers in the config, so yours may differ from the default list.system_prompt- you can swap the built-in expert prompt for your own if you want a different flavor.user_requirement- extra instructions in plain language ("keep the camera static").
Output is a single transition_prompt STRING. Wire it into whatever video node you use.
Install
ComfyUI Manager, search ComfyUI_LLM_Banana. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/ComfyUI_LLM_Banana
cd ComfyUI_LLM_Banana
pip install -r requirements.txt
then restart ComfyUI. The pack pulls a chunky dependency list (google-genai, transformers, opencv-python, openai, httpx…), so give the install a minute.
Where people get burned
The node is polite about failure: if no API key or base URL resolves, it returns an error as the output string instead of throwing, so you'll see "未检测到API Key或Base URL…" in your prompt field rather than a red node. That's the signal to check ChatFly_config.json or fill the node fields. Also: pick a vision model. Ask gpt-4 (text-only) to describe two images and you get nothing useful back, just a refusal or filler. And remember these mirror services charge per call - a video project generating a transition prompt every frame pair adds up fast.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| api_provider | COMBO | Comfly | 7 options: Comfly, Comfly-HK, Comfly-US, T8的贞贞AI工坊, T8-Comfly, T8-HK, +1 |
| base_url | STRING | — | |
| api_key | STRING | — | |
| model | COMBO | gpt-4-v | 28 options: gpt-4-v, gpt-4o-all, gpt-4-all, gpt-4o, gpt-4o-mini, gpt-4o-mini-2024-07-18, +22 |
| first_frame | IMAGE | — | |
| last_frame | IMAGE | — | |
| system_prompt | STRING | 你是一个专业的视频过渡分析和提示词生成专家。你的任务是分析视频的首帧和尾帧图片,生成一个高质量的英文提示词,用于描述从首帧到尾帧的整个过渡过程和动态变化。 【核心任务】 根据首帧(初始状态)和尾帧(最终状态)两张图片,生成一个单一的、连贯的、描述整个过渡过程的提示词。这个提示词将用于视频生成模型,生成从首帧平滑过渡到尾帧的连续性视频。 【首帧分析】 首帧是视频的开始画面,代表初始状态。请分析: - 主体对象的初始状态、位置、姿态和外观 - 场景的初始环境、背景、光线和氛围 - 色彩方案和视觉风格 - 相机角度和构图 - 所有关键的视觉元素 【尾帧分析】 尾帧是视频的结束画面,代表最终状态。请分析: - 主体对象的最终状态、位置、姿态和外观 - 场景的最终环境、背景、光线和氛围 - 色彩方案和视觉风格 - 相机角度和构图 - 所有关键的视觉元素 【过渡分析】 比较首帧和尾帧,识别所有的变化和过渡: - 主体对象的运动方向和轨迹 - 主体对象的形态、大小或外观的变化 - 场景背景的变化 - 光线、色彩、氛围的演变 - 相机的运动(平移、缩放、旋转等) - 整个视频的动态节奏和流畅性 【提示词生成规则】 1. 语言:严格使用英文 2. 格式:使用逗号(,)连接不同的短语,形成一个连贯的、流畅的提示词 3. 时间性:使用动词和动作词汇来描述过程和变化,例如: - "transitioning from ... to ..." - "gradually changing from ... to ..." - "smoothly moving from ... to ..." - "evolving from ... to ..." 4. 连贯性:确保提示词描述的是一个连续的、平滑的过渡过程,而不是两个独立的状态 5. 细节:详细描绘: - 主体对象的运动和变化 - 背景和环境的演变 - 光线、色彩、氛围的过渡 - 相机的运动(如果有) - 整个过程的节奏和流畅性 6. 人物描述:使用第三人称(如 'a woman', 'the man', 'a person') 7. 质量词:在提示词末尾,务必添加以下质量增强词: ', best quality, high resolution, 4k, high quality, masterpiece, photorealistic, smooth transition, seamless motion' 【输出格式】 生成一个单一的、完整的、高质量的英文提示词,用于描述从首帧到尾帧的整个过渡过程。这个提示词应该能够指导视频生成模型生成平滑、连贯的过渡视频。 【示例】 首帧:一个人站在房间的左边,光线昏暗 尾帧:同一个人站在房间的右边,光线明亮 输出提示词:a person smoothly walking from the left side to the right side of a room, transitioning from dim lighting to bright lighting, the camera follows the movement, the background gradually becomes brighter, best quality, high resolution, 4k, high quality, masterpiece, photorealistic, smooth transition, seamless motion | — |
| user_requirement | STRING | — | |
| temperature | FLOAT | 0.700–1 | — |
| seed | INT | 00–18446744073709550000 | — |
| top_popt | FLOAT | 0.800–1 | — |
| max_tokensopt | INT | 8001–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| transition_prompt | STRING | — |