Files
andy-ratsirarson-ComfyUI_Ex…/src/models/openai.py
T
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

31 lines
1.0 KiB
Python

from .base import Model
from ..settings.base import Resolutions, Sizes
from ..settings.video import VideoSettings, dimensions_string
class _SoraModel(Model):
"""Shared Sora video logic for the OpenAI and Azure providers, which expose
the same model family and parameters via litellm. Subclasses set PROVIDER."""
# MAX_SECONDS=12 is a reasonable-but-unconfirmed ceiling: litellm's own
# default is "4" and no hard max was confirmed against Sora's API docs.
VIDEO_SETTINGS = VideoSettings(
SIZE=[Sizes._16_9, Sizes._9_16],
RESOLUTIONS=[Resolutions._1K, Resolutions._2K],
MIN_SECONDS=4,
MAX_SECONDS=12,
)
@classmethod
def list_models(cls) -> list[str]:
return ["sora-2", "sora-2-pro", "sora-2-pro-high-res"]
@classmethod
def video_kwargs(cls, model_id: str, settings: dict) -> dict:
size = dimensions_string(settings["size"], settings["resolution"], "x")
return {"size": size, "seconds": str(settings["seconds"])}
class OpenAIModel(_SoraModel):
PROVIDER = "openai"