Skip to content

Vega Image โ€‹

Updated

Endpoint: POST https://vod.intl.tencentcloudapi.comAction: CreateAigcImageTask

Vega Image is WAND's in-house image generation model, supporting text-to-image and reference-image editing. It comes in Pro / Flash / Lite, and results can be checked with DescribeTaskDetail or the completion event.

Basic information โ€‹

ItemValue
ModelNamewand-vega-image
ModelVersion1.0-pro / 1.0-flash / 1.0-lite
InputText / reference image
Result lookupDescribeTaskDetail
Disable guardrails supportSupported

Supported specs by version โ€‹

VersionResolutionRatioReference images
1.0-pro1K / 2K / 4K1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 9:16 / 16:9 / 21:9Up to 6
1.0-flash1K / 2K / 4K1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 9:16 / 16:9 / 21:9Up to 6
1.0-lite1K / 2K / 4K1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 9:16 / 16:9 / 21:9Up to 3

The output size of Resolution=2K and AspectRatio=16:9 is 2560ร—1440.

Reference image specification โ€‹

VersionReference image countSize per fileFormat
1.0-proUp to 610MB or lessPNG / JPEG
1.0-flashUp to 610MB or lessPNG / JPEG
1.0-liteUp to 310MB or lessPNG / JPEG

Reference images are passed in FileInfos.Url. The size limit per file and the image count limit each apply. The reference URL must be downloadable by the generation service; for private objects, use a valid signed URL.

Generation examples โ€‹

A person riding a bicycle on a summer country road, with rice paddies and sunflowers

An illustration of a summer country road

A cyber robot wearing a gat and hanbok-style armor appearing in a Joseon-era palace

A cyber robot appearing in the Joseon era / Pro / 2K

Request parameters โ€‹

ParameterRequiredTypeDescription
SubAppIdRequiredIntegerVOD application ID
ModelNameRequiredStringwand-vega-image
ModelVersionRequiredString1.0-pro / 1.0-flash / 1.0-lite
PromptConditionally requiredStringGeneration or editing instruction. Required if FileInfos is absent
FileInfos.NOptionalArrayReference images. Type=Url / File / Base64
FileInfos.N.UrlConditionally requiredStringImage URL when Type=Url
FileInfos.N.FileIdConditionally requiredStringWhen Type=File, the VOD media ID
FileInfos.N.Base64Conditionally requiredStringWhen Type=Base64, the image's Base64 string
OutputConfig.
Resolution
OptionalStringOutput resolution
OutputConfig.
AspectRatio
OptionalStringOutput ratio
OutputConfig.
StorageMode
OptionalStringTemporary / Permanent
OutputConfig.
LogoAdd
OptionalStringLogo watermark. Enabled / Disabled
OutputConfig.
OutputImageCount
OptionalIntegerSets the number of output images for Flash / Pro. The example uses 1
InputRegionOptionalStringInput region. Overseas requests are Oversea

Request examples โ€‹

Text-based generation โ€‹

json
{
  "SubAppId": 123456789,
  "ModelName": "wand-vega-image",
  "ModelVersion": "1.0-pro",
  "Prompt": "A cybernetic robot wearing hanbok-inspired armor and a gat in a Joseon palace courtyard, rain and lantern light, cinematic realism.",
  "OutputConfig": {
    "StorageMode": "Temporary",
    "Resolution": "2K",
    "AspectRatio": "16:9",
    "LogoAdd": "Disabled"
  }
}

Reference image editing โ€‹

json
{
  "SubAppId": 123456789,
  "ModelName": "wand-vega-image",
  "ModelVersion": "1.0-pro",
  "Prompt": "Keep the person and bicycle. Change the season to autumn with warm orange foliage.",
  "OutputConfig": {
    "StorageMode": "Temporary",
    "Resolution": "2K",
    "AspectRatio": "16:9",
    "LogoAdd": "Disabled",
    "OutputImageCount": 1
  },
  "FileInfos": [
    {
      "Type": "Url",
      "Url": ""
    }
  ]
}

Python SDK โ€‹

python
import json
import os
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.vod.v20180717 import vod_client, models

profile = ClientProfile
profile.httpProfile = HttpProfile
profile.httpProfile.endpoint = "vod.intl.tencentcloudapi.com"
client = vod_client.VodClient(
    credential.Credential(
        os.environ["TENCENTCLOUD_SECRET_ID"],
        os.environ["TENCENTCLOUD_SECRET_KEY"],
    ),
    "ap-singapore",
    profile,
)
params = {
    "SubAppId": 123456789,
    "ModelName": "wand-vega-image",
    "ModelVersion": "1.0-pro",
    "Prompt": "A cybernetic robot in a Joseon palace courtyard, cinematic light",
    "OutputConfig": {
        "StorageMode": "Temporary",
        "Resolution": "2K",
        "AspectRatio": "16:9",
        "LogoAdd": "Disabled",
    },
}
request = models.CreateAigcImageTaskRequest
request.from_json_string(json.dumps(params))
response = client.CreateAigcImageTask(request)
print(response.to_json_string)

Response and result lookup โ€‹

The generation request returns TaskId.

json
{
  "TaskId": "1500033704-AigcImageTask-b988f28b31d06c2ba1fc9ad1428c02e8t",
  "RequestId": "52ee718a-4423-409e-a96c-a7797d6879b6"
}

To DescribeTaskDetail, pass the same SubAppId and TaskId.

json
{
  "SubAppId": 123456789,
  "TaskId": "1500033704-AigcImageTask-b988f28b31d06c2ba1fc9ad1428c02e8t"
}

When AigcImageTask.Status=FINISH and ErrCode=0, generation is complete. The image address is returned in AigcImageTask.Output.FileInfos.FileUrl.

json
{
  "AigcImageTask": {
    "Status": "FINISH",
    "ErrCode": 0,
    "Progress": 100,
    "Output": {
      "FileInfos": [
        {
          "FileUrl": "",
          "MetaData": {
            "Width": 2560,
            "Height": 1440
          }
        }
      ]
    }
  }
}

Special settings โ€‹

Base64 reference images โ€‹

Use the Type=Base64 and Base64 fields. JPEG / JPG / PNG / WEBP are supported, and the combined file size before encoding must be 7MB or less. The data:image/...;base64, prefix is not included.

python
import base64

with open("reference.png", "rb") as image:
    params["FileInfos"] = [{
        "Type": "Base64",
        "Base64": base64.b64encode(image.read).decode("ascii"),
    }]

Result retention and completion events โ€‹

StorageMode=Temporary returns a temporary result URL. To keep it as VOD media, use Permanent. Completion notifications can use either a normal callback or a trusted event notification. For the common authentication and callback specification, see API Reference.

Built with VitePress ยท Deployed on Tencent EdgeOne Pages