Wan 2.7 Reference to Video Serverless API

Character-consistent multi-subject videos from reference images.

POST /v2/wan2.7-r2v · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
 4
 5# Async (v2) — recommended for long-running / video models.
 6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
 7# deadline and keeps the request_id so you can re-poll later.
 8client = SegmindClient()                      # reads SEGMIND_API_KEY
 9payload = {
10    "reference_images": ["https://segmind-resources.s3.amazonaws.com/input/wan2.7-r2v-ref-image.jpg"],
11    "prompt": "Image1 walks through a lush green garden with blooming flowers, smiling warmly at the camera, golden hour lighting",
12    "duration": 5,
13    "negative_prompt": "blurry, low quality, distorted, watermark",
14    "resolution": "720P",
15    "seed": 42,
16}
17job = client.submit_async("wan2.7-r2v", **payload)
18print(job.request_id)                         # available immediately
19try:
20    result = job.wait(timeout=900, interval=2.0)
21    print(result["status"])                  # COMPLETED
22    print(result.get("output"))              # model output (e.g. video URL)
23except InferenceTimeout as e:
24    print("still running:", e.request_id)    # re-poll later with this id
25except InferenceFailed as e:
26    print("failed:", e.detail)
27
28# Fast models (<=600s) can use the one-liner instead:
29# result = segmind.run("wan2.7-r2v", **payload)

API Endpoint

POSThttps://api.segmind.com/v1/wan2.7-r2v

Parameters

promptrequired
string

Describe the scene and action. Reference your inputs as Image 1, Video 1, etc.

Default: "Image1 walks through a lush green garden with blooming flowers, smiling warmly at the camera, golden hour lighting"
durationoptional
integer

Length of the generated video. 2–15s, but capped at 10s when a reference video is supplied.

Default: 5Range: 2 - 15
first_frameoptional
string (uri)

Optional opening frame. The video starts from this exact image and adopts its aspect ratio — which overrides the Aspect ratio setting below.

negative_promptoptional
string

Describe what to keep out of the video.

Default: "blurry, low quality, distorted, watermark"
prompt_extendoptional
boolean

Let the model rewrite short prompts for better results. Adds some latency.

Default: true
ratiooptional
string

Aspect ratio of the output video. Ignored when a first frame is supplied.

Default: "16:9"
Allowed values :
16:9 — landscape"16:9"
9:16 — portrait"9:16"
1:1 — square"1:1"
"4:3""3:4"
reference_imagesoptional
string[]

Character/object reference images. Refer to them in the prompt as Image 1, Image 2… Max 5 reference images and videos combined.

Default: ["https://segmind-resources.s3.amazonaws.com/input/wan2.7-r2v-ref-image.jpg"]
reference_videosoptional
string[]

Motion/character reference videos. Max 5 reference images and videos combined. Supplying a video caps duration at 10s.

resolutionoptional
string

Output resolution tier. 720P is faster and cheaper; 1080P for final deliverables.

Default: "720P"
Allowed values :
"720P""1080P"
seedoptional
integer

Controls randomness. Fix it for reproducible results.

Default: 42Range: 0 - 2147483647
watermarkoptional
boolean

Add an 'AI Generated' watermark in the lower-right corner.

Default: false

Response Type

Returns: Video

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/wan2.7-r2v

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out