Skip to main content
Use veo/veo-3.1-generate-001 with the Comfy Router API. Veo provides the model; Router gives it the shared authentication and request route below.

Quick start

Create a key at platform.comfy.org/profile/api-keys and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: veo/veo-3.1-generate-001 Endpoint: POST https://api.comfy.org/v2/models/veo/veo-3.1-generate-001

Schema

Input

object[]
string
Camera motion type. Requires image to be provided.Possible values: fixed, pan_left, pan_right, tilt_up, tilt_down, truck_left, truck_right, pedestal_up, pedestal_down, push_in, pull_out
object | object
Optional first frame image to guide video generation
string (byte)
Base64-encoded image dataFormat: byte
string
Cloud Storage URI of the image
string
MIME type of the image (image/jpeg or image/png)Possible values: image/jpeg, image/png
object | object
Optional last frame image. Used with image to generate video between first and last frames. Supported by Veo 3.0+ models.
string (byte)
Base64-encoded image dataFormat: byte
string
Cloud Storage URI of the image
string
MIME type of the image (image/jpeg or image/png)Possible values: image/jpeg, image/png
object | object
Optional mask for video editing. Applies to input video.
string (byte)
Base64-encoded mask bytesFormat: byte
string
Cloud Storage URI to mask file
string
How the mask is appliedPossible values: insert, remove, remove_static, outpaint
string
MIME type of the mask (image/png, image/jpeg, image/webp, or video formats)
string
required
Text description of the video to generate
object[]
Optional reference images to guide video generation. Supports up to 3 asset images or 1 style image. Supported by Veo 3.1 models (preview).
object | object
required
string (byte)
Base64-encoded image dataFormat: byte
string
Cloud Storage URI of the image
string
MIME type of the image (image/jpeg or image/png)Possible values: image/jpeg, image/png
string
Optional identifier for the reference image
string
required
Type of reference imagePossible values: asset, style
object | object
Optional input video for video extension or editing. Incompatible with image and referenceImages.
string (byte)
Base64-encoded video bytesFormat: byte
string
Cloud Storage URI of the input video
string
MIME type of the videoPossible values: video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/x-flv
object
string
Aspect ratio of the generated video. Default: 16:9Possible values: 16:9, 9:16
string
Video compression quality. Default: optimizedPossible values: optimized, lossless
number
Target duration of the generated video in seconds. Veo 2: 5-8. Veo 3/3.1: 4, 6, or 8. Default: 8
boolean
Automatically improve prompt for higher quality. Defaults to true.
integer
Frame rate of generated videos in frames per second
boolean
Whether to generate audio along with the video. Defaults to true. Supported by Veo 3.0+ models.
string
Text describing what to avoid in the generated video
string
Controls people in generated videos. Default: allow_adultPossible values: dont_allow, allow_adult, allowAll
string
Cloud Pub/Sub topic for progress updates (projects/{project}/topics/{topic})
string
Resize approach for input image. Default: padPossible values: pad, crop
string
Output video resolution. Supported by Veo 3.0+ models. Default: 720pPossible values: 720p, 1080p, 4k
integer
Number of videos to generate. If not specified, 1 video is generated.Range: 1 to 4
integer
Random seed for deterministic output. Different seeds used per video if sampleCount > 1.Format: uint32
string
Cloud Storage URI (gs://) for saving generated videos
string
Operation type for the video generation requestPossible values: textToVideo, imageToVideo, referenceToVideo, edit, extend, upscale
Generated from the schema Router serves at GET /v2/models/veo/veo-3.1-generate-001/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

boolean
Whether the operation has completed
object
Error details, present if the operation failed
integer
gRPC error code
string
Error message
string
Operation resource name
object
The prediction response, present when done is true
string
integer
Number of videos filtered by responsible AI policies
string[]
Reasons why videos were filtered by responsible AI policies
object[]
string
Base64-encoded video content
string
Cloud Storage URI of the generated video
string
Video MIME type (video/mp4)

Examples

Input

Output

Before you ship

Save one Idempotency-Key for each call and reuse it for retries. Router can hold the connection for up to 10 minutes. The SDKs handle authentication; raw HTTP clients send the headers themselves. Use X-Comfy-Error-Type to classify a failure. A 422 means Router rejected the input before calling the provider. Download generated assets promptly because result URLs can expire.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Using the Router API

Find models, inspect schemas, and retry safely.

Limitations

What Router does not do today, and what to use instead.