FSL Gemini Chat (Unified SDK)
FSL Gemini Chat — the 'creative director' that decides image vs video for you
- image_input
- LATEST_REPLY
- IMAGE_PROMPT
- VIDEO_PROMPT
- CONVERSATION_HISTORY
The whole Gemini & Veo half of Fred LeFevre's FSL pack is built around this node. FSLGeminiChat is the "Creative Director": a chat agent with memory that doubles as a prompt-engineering router. You talk to it, and it decides - via a hidden text hook - whether your request means "make an image," "make a video," or "just answer me." The idea is you stop hand-crafting prompts and let the model write the technical prompt for the generator downstream.
How it works
The node keeps a per-session_id conversation in memory (CHAT_SESSIONS), so it behaves like a chatbot with context, not a stateless API call. When enhance_hook is on, the system instruction gives Gemini a dual role: chat normally, but if you ask for a static image it emits a block starting with IMG_HOOK:, and if you ask for video or animation it emits VID_HOOK:. If you're just chatting, it emits neither.
The node then parses those hooks into separate outputs. That split is the clever bit - it prevents the double-generation problem where a workflow would trigger both the image generator and the Veo generator for one request. The IMAGE_PROMPT output only fills when the reply contains an image hook; VIDEO_PROMPT only fills for video. Wire them to the respective generators, and only one ever gets a non-empty prompt.
There's also vision: connect an image to the optional image_input and it's sent alongside your text, which is how the "animate this person" image-to-video workflows get the model to describe the subject.
The outputs
LATEST_REPLY- the clean chat text (hooks stripped out).IMAGE_PROMPT- the technical prompt to feedFSLGeminiImageGeneratororFSLGeminiGenerateImage.VIDEO_PROMPT- the prompt to feedFSLVeoGenerator.CONVERSATION_HISTORY- a formatted text log of the session, handy for display.
Inputs worth setting
session_id- your chat's memory bucket. Different IDs = separate conversations.reset_chat- flip to true to wipe that session's memory (it clears it, so remember to flip back).enhance_hook- Agent Mode on by default. Turn it off for "Raw Mode," where Gemini only adds hooks when told to generate.model_name- defaults togemini-1.5-flash, cheap and fast;gemini-3-pro-previewis in the list if you want the smart one.debug_models- prints hook detection to the console. Leave on while you're building the workflow.
Install & key
Same as the rest of the pack: Manager → "ComfyUI FSL Nodes", or clone into custom_nodes and pip install google-genai. No local models - this is a cloud node, and it needs a Gemini API key (widget or GEMINI_API_KEY/GOOGLE_API_KEY env var).
Where people get burned
The common failure is an empty IMAGE_PROMPT/VIDEO_PROMPT and you can't figure out why. That's the gatekeeper working as designed: if Gemini decided you were just chatting, the hooks never fire and the outputs stay empty - the downstream generators then "sleep" (return blank/None, zero cost). If you expected a hook and didn't get one, rephrase the request as an explicit command ("create an image of…"). And if you're getting "Gemini API Error" text in LATEST_REPLY, that's a caught exception flowing through the STRING output - check the key first, then your billing, and look at the console for the real message.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | Hello, Gemini. | — |
| session_id | STRING | chat_01 | — |
| model_name | COMBO | gemini-1.5-flash | 4 options: gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash-exp, gemini-3-pro-preview |
| reset_chat | BOOLEAN | false | — |
| enhance_hook | BOOLEAN | true | — |
| debug_models | BOOLEAN | false | — |
| image_inputopt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| LATEST_REPLY | STRING | — |
| IMAGE_PROMPT | STRING | — |
| VIDEO_PROMPT | STRING | — |
| CONVERSATION_HISTORY | STRING | — |