Vidu Reference To Image Q2

Vidu Reference To Image Q2

Playground

Try it on WaveSpeedAI!

Vidu Reference-to-Image Q2 generates high-quality images from 1–7 reference images plus a text prompt, preserving style and composition while allowing controlled changes to subjects, backgrounds, and fine details. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.

Features

vidu/reference-to-image-q2 is the reference-guided sibling of vidu’s text-to-image model. It takes one or more reference images (up to 7) plus a prompt, and generates new, high-resolution images that keep the subject and composition while adjusting style, lighting, or scene details.


What it’s good for

  • Keeping product, character, or actor identity consistent across many shots
  • Creating new scenes from a small set of reference stills or keyframes
  • Generating campaign variations while locking in pose, outfit, or layout
  • Up-res, clean re-renders of storyboard / concept frames with cinematic quality

Key features

• Up to 7 reference images

Upload 1–7 images in images to steer identity, pose, outfit, or composition. The model blends information across them while following your text prompt.

• Cinematic aspect ratios

aspect_ratio supports:

  • 1:1, 4:3, 3:4, 2:3, 3:2 – square and classic photo ratios
  • 16:9, 21:9 – widescreen and banner formats
  • 9:16 – vertical / mobile content
  • auto – let the model choose a ratio that best matches the references + prompt

• High resolutions (1080p → 4K)

resolution lets you pick:

  • 1080p – fast preview / web use
  • 2K – more detail and better crop flexibility
  • 4K – maximum sharpness for key visuals and print-adjacent work

• Prompt-driven control

Combine references with a rich prompt (“dramatic studio lighting, cinematic close-up, 85mm lens, shallow depth of field”) to re-style while keeping the same subject.

• Seed-based reproducibility

seed set to -1 gives random variation; using a fixed integer lets you rerun the same combination of prompt + references for consistent outputs.


How to use (Playground)

  1. prompt* – Describe what you want to change or keep: style, lighting, mood, background, camera angle, etc.
  2. images* – Click “Add Item” and upload 1–7 reference images (subject, pose, layout, or mood).
  3. aspect_ratio – Choose a ratio, or leave as auto and let the model decide.
  4. resolution – Select 1080p, 2K, or 4K depending on detail vs. speed needs.
  5. seed – Use -1 for randomness or a fixed integer for reproducible results.
  6. Run the job, inspect the result, then iterate on prompt / references as needed.

Pricing

Pricing depends on resolution and how many reference images you use. Base rate is $0.04 per 1k compute units, applied via the internal formula:

Up to 3 reference images (1–3 refs)

ResolutionPrice per image
1080p$0.04
2K$0.06
4K$0.07

4–7 reference images

ResolutionPrice per image
1080p$0.05
2K$0.10
4K$0.15

Tips for best quality

  • Use clean, well-lit reference images; avoid heavy motion blur or extreme compression.
  • Keep references stylistically consistent when possible (similar lighting / medium).
  • In the prompt, clearly state both what must stay the same (“same person and outfit”) and what should change (“different background, golden-hour lighting”).
  • For hero shots, generate at 2K or 4K, then downscale slightly for extra sharpness.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "prompt": "A cinematic ocean wave at sunrise, highly detailed",
  "images": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/painted-hand-298-332.jpg"
  ],
  "aspect_ratio": "auto",
  "resolution": "1080p",
  "seed": -1
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/vidu/reference-to-image-q2" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL=$(printf '%s' "${TASK}" | jq -r '.urls.get // empty')
if [ -z "${RESULT_URL}" ]; then RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"; fi

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    created|processing) sleep 2 ;;
    *) printf 'Unexpected status: %s
' "${STATUS}" >&2; exit 1 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-The text prompt for generating the image.
imagesarray<string>Yes-1 ~ 7 itemsThe reference image to guide the generation.
aspect_ratiostringNoautoauto, 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 2:3, 3:2The aspect ratio for the generated image. 'auto' Generated image aspect ratio is consistent with the first input images.
resolutionstringNo1080p1080p, 2K, 4KThe output resolution quality: 1080p (1920x1080), 2K (2560x1440), or 4K (3840x2160).
seedintegerNo-1-The random seed to use for the generation. -1 means a random seed will be used.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to poll for the prediction result
data.statusstringStatus: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.