Andy RatsirarsonandClaude Sonnet 5 3ea918e84c Add Gemini Omni Flash support and fix stale Veo model listings
- Merge Omni Flash into the existing "gemini" provider: one dropdown
  entry, model list now includes both Veo and Omni Flash ids, each
  revealing its own correct settings (resolution/duration/etc).
- Omni Flash runs through litellm's request/response Interactions API
  (litellm.interactions.acreate) instead of the polling
  avideo_generation/avideo_status/avideo_content trio Veo and the other
  providers use, since it has no status-polling endpoint. Text-to-video
  only for now; image/video-conditioned input and conversational
  editing aren't implemented yet.
- Fix progress reporting for the Omni path: it now ticks up by
  elapsed/timeout while waiting on the single request instead of
  sitting at 0% and jumping straight to done.
- Fix live Veo model listing to filter out models Google's API no
  longer serves for generation (checks supported_actions for
  predictLongRunning) rather than trusting name-matching alone — root
  cause of a live 404 on veo-3.1-fast-generate-001, which is also
  dropped from the static fallback list.
- Bump litellm 1.92.0 -> 1.100.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CVFBqa77Zo9t4ps8wt7YB2
2026-09-07 20:44:24 -07:00
2026-07-14 22:22:41 -07:00
2026-07-14 21:30:29 -07:00
2026-07-14 21:30:29 -07:00

ComfyUI_ExternalAPI

BYOK (bring-your-own-key) ComfyUI nodes for generating video through external providers — Gemini/Veo, OpenAI Sora, Azure, and RunwayML — via LiteLLM. No local GPU-hungry model required; you supply your own provider API key and pay that provider directly.

Status: text-to-video works for all providers; image-to-video (a reference image guiding the animation) works for Gemini/Veo only. Text-to-image is planned as a separate node — see Roadmap.

Features

  • One node, every provider. Pick a provider from a dropdown; the node's fields update to show only that provider's real parameters.
  • BYOK. Your API key never touches this repo or any third party beyond the provider itself. Prefer setting it as a server-side environment variable; an optional in-node override exists for convenience (see Security note).
  • Provider-accurate parameters. Each provider exposes its own supported aspect ratios, resolution tiers, and duration range — no guessing which combination is valid.

Supported providers & models

Provider provider value Models Aspect ratios Resolutions Duration
Google Gemini (Veo + Omni Flash) gemini Fetched live from your account via google-genai; falls back to a built-in list of Veo models (veo-3.1-fast-generate-preview, veo-3.1-fast-generate-001, veo-3.1-generate-preview, veo-3.1-generate-001, veo-3.1-lite-generate-preview, veo-2.0-generate-001) plus Omni Flash models (gemini-omni-1.1-flash, gemini-omni-flash-preview) if that fails Veo: 16:9, 9:16 · Omni: 16:9, 9:16 Veo: 1K, 2K · Omni: 360p, 720p, 1080p, 4k Veo: 4–8s · Omni: 3–10s
OpenAI (Sora) openai sora-2, sora-2-pro, sora-2-pro-high-res 16:9, 9:16 1K, 2K 4–12s*
Azure OpenAI (Sora) azure sora-2, sora-2-pro, sora-2-pro-high-res 16:9, 9:16 1K, 2K 4–12s*
RunwayML runwayml gen3a_turbo, gen4_turbo, gen4_aleph, gen4_image, gen4_image_turbo 16:9, 9:16 1K, 2K 5s or 10s

* OpenAI/Azure's upper duration bound isn't published by the provider; 12s is a conservative default rather than a confirmed hard limit.

Gemini's model list is fetched live from google.genai.Client().models.list() at node-registration time when a Gemini API key is available on the ComfyUI server, so new Veo/Omni releases show up automatically without an update to this package. The single gemini provider's model dropdown lists both families together — picking a Veo model reveals Veo's settings, picking an Omni Flash model reveals Omni's.

Omni Flash is a different API shape than Veo, under the hood. It runs through litellm's request/response Interactions API (litellm.interactions.acreate) instead of the polling avideo_generation/avideo_status/avideo_content calls Veo and the other providers use, so there's no in-progress polling for it — the node just waits on the single call. Only one-shot text-to-video is wired up today; Omni Flash's headline features — image/video-conditioned generation and multi-turn conversational editing — aren't implemented (see Roadmap), so its models don't appear in the image-source provider dropdown. Very large outputs that Google delivers by URI instead of inline base64 aren't downloaded yet and will raise a clear error rather than silently failing.

Image-to-video (a reference image conditioning the result) is currently supported for Gemini/Veo only. The other providers are text-to-video only for now — see Roadmap. The models, aspect ratios, resolutions, and durations in the table above apply to both text- and image-to-video.

Requirements

  • ComfyUI with the V3 node API (comfy_api.latest).
  • Python dependencies (installed automatically, see requirements.txt):
    • litellm==1.100.0
    • google-genai==1.47.0
  • An API key from at least one of the providers above.

Installation

Via ComfyUI Manager: search for ComfyUI_ExternalAPI and install.

Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/andy-ratsirarson/ComfyUI_ExternalAPI.git
cd ComfyUI_ExternalAPI
pip install -r requirements.txt

Restart ComfyUI afterward.

Setup: API keys

Set the environment variable(s) for whichever provider(s) you plan to use on the machine running the ComfyUI server, then restart ComfyUI.

Provider Environment variable(s)
Gemini GEMINI_API_KEY (or GOOGLE_API_KEY)
OpenAI OPENAI_API_KEY
Azure OpenAI AZURE_API_KEY, AZURE_API_BASE (your endpoint), AZURE_API_VERSION (optional)
RunwayML RUNWAYML_API_SECRET (or RUNWAYML_API_KEY)

Security note

The node also has an optional api_key input that overrides the environment variable for that run. Prefer the environment variable. Anything typed into api_key gets saved into the workflow JSON and into output file metadata — so it can leak if you share a workflow or an output file. Only use it for quick one-off testing.

Usage

  1. Add the node: right-click canvas → Add Node → external_api/video → API Video Generate (BYOK).
  2. Enter a text prompt.
  3. Under source, leave it on text for text-to-video (see Image-to-video below for the image option).
  4. Pick a provider — the node reveals that provider's model dropdown.
  5. Pick a model — the node reveals that model's settings: size (aspect ratio), resolution, seconds (duration), and any provider-specific extras (e.g. Gemini's person_generation/negative_prompt, RunwayML's seed).
  6. Run the graph. The node polls the provider until the video finishes, then outputs a VIDEO.

Optional inputs: api_key (see Security note), poll_interval (seconds between status checks, default 10), timeout (max seconds to wait, default 600).

Image-to-video (Gemini/Veo)

To animate a reference image instead of generating from text alone:

  1. Set source to image. The node reveals a provider dropdown that currently lists only gemini.
  2. Pick gemini, then pick a Veo model — same models as text-to-video.
  3. The node reveals: size (aspect ratio: 16:9 or 9:16), resolution (1K/2K), seconds (4–8s), reference_image, person_generation, and an optional negative_prompt.
  4. Connect reference_image — an IMAGE socket, same as any other ComfyUI node that takes an image. Wire in a Load Image node to upload/pick a file, or connect any other node's IMAGE output directly (including an image generated earlier in the same workflow — no need to save it to disk first). This input is technically optional at the graph level, but image-to-video will fail at runtime with a clear error if left unconnected.
  5. Enter a prompt. It's still required with image-to-video — the prompt directs how the reference image is animated.
  6. Run the graph. As with text-to-video, the node polls until the video finishes and outputs a VIDEO.

Note: for image-to-video, person_generation only offers allow_adult (text-to-video also offers allow_all). Google restricts generation to adults when a reference photo is provided, so the broader option isn't available here.

This currently supports exactly one reference image per generation. It does not (yet) support multiple reference images, tagging/naming images for reference within the prompt text, or interpolation/video-extension — see Roadmap.

Roadmap

  • Image generation — a separate APIImageGenerate node, tracked in issue #2.
  • Image-to-video — implemented for Gemini/Veo (set source to image), single reference image only. Support for the other providers (OpenAI/Azure Sora, RunwayML) is future work.
  • Multi-image references — RunwayML supports referencing several images at once (with in-prompt tagging), and Gemini/Veo 3.1 separately supports up to 3 reference images plus last-frame interpolation and video extension. None of this richer, multi-image capability is implemented yet — today's image-to-video is single-image only for both providers that support it at all.
  • Gemini Omni Flash: image/video-conditioned generation and conversational editing — Omni Flash accepts image and video inputs and supports iteratively refining a result across turns via previous_interaction_id. Only one-shot text-to-video is wired up today (gemini_omni provider, source: text); feeding it a reference image/video and chaining edits is not yet implemented.
  • Gemini Omni Flash: large (uri-delivered) outputs — Google delivers big videos by URI instead of inline base64; downloading those isn't implemented yet, so such a response raises a clear error instead of returning a video.

Development

pip install -e ".[dev]"
pytest

Tests fake just enough of comfy_api.latest (see tests/conftest.py) to exercise the nodes outside a real ComfyUI install — no GPU or ComfyUI checkout required.

License

MIT — see LICENSE.

S
Description
No description provided
Readme MIT
75 KiB
Languages
Python 100%