1. 腾讯云 VOD
梧柏API使用文档
WHBAI · 腾讯云 VOD
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • 腾讯云 VOD
    • AIGC 生图
      POST
    • AIGC 生视频
      POST
    • 查询任务
      GET
    • 模板特效
      POST
  • 数据模型
    • TencentVodSampleRequest
    • PostTencentVodV1AigcVideoRequest
    • PostTencentVodV1TemplateEffectRequest
    • TencentVodSampleResponse
    • NewApiError
  1. 腾讯云 VOD

AIGC 生图

POST
/tencent-vod/v1/aigc-image
腾讯云点播图像生成。
官方文档:https://cloud.tencent.com/document/product/266/126240

网站中的模型与调用示例#

创建任务#

官方文档:https://cloud.tencent.com/document/product/266/126240

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "enhance_prompt": {
      "description": "是否自动优化提示词。开启时将自动优化传入的 Prompt,以提升生成质量。取值有:\nEnabled:开启;\nDisabled:关闭;",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Whether to automatically optimize prompt words. When turned on, incoming prompts will be automatically optimized to improve build quality. The values are:\nEnabled: turned on;\nDisabled: closed;"
        }
      }
    },
    "ext_info": {
      "description": "保留字段,特殊用途时使用。\n示例值:myextinfo",
      "properties": {},
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Reserved fields, used for special purposes.\nExample value: myextinfo"
        }
      }
    },
    "file_infos": {
      "items": {
        "properties": {
          "file_id": {
            "description": "图片文件的媒体文件 ID,即该文件在云点播上的全局唯一标识符,在上传成功后由云点播后台分配。可以在 视频上传完成事件通知 或 云点播控制台 获取该字段。当 Type 取值为 File 时,本参数有效。\n说明:\n1. 推荐使用小于7M的图片;\n2. 图片格式的取值为:jpeg,jpg, png, webp。\n示例值:3704211***509819",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "The media file ID of the image file, which is the globally unique identifier of the file on the cloud on demand, is assigned by the cloud on demand background after the upload is successful. This field can be obtained in the video upload completion event notification or cloud on-demand console. This parameter is valid when the value of Type is File.\nDescription:\n1. It is recommended to use pictures smaller than 7M;\n2. The value of the image format is: jpeg, jpg, png, webp.\nExample value: 3704211***509819"
              }
            }
          },
          "text": {
            "description": "输入图片的描述信息,用于帮助模型理解图片。仅GEM 2.5、GEM 3.0 有效。\n示例值:任务背景:这是需要翻新的主建筑(图1),不得改变其几何结构。",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Enter the description information of the image to help the model understand the image. Only valid for GEM 2.5 and GEM 3.0.\nExample values: Task context: This is the main building that needs renovation (Fig. 1), its geometry must not be changed."
              }
            }
          },
          "type": {
            "description": "输入的视频文件类型。取值有:\nFile:点播媒体文件;\nUrl:可访问的 URL;\n\n示例值:File",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Input video file type. The values are:\nFile: on-demand media files;\nUrl: accessible URL;\n\nExample value: File"
              }
            }
          },
          "url": {
            "description": "可访问的文件 URL。当 Type 取值为 Url 时,本参数有效。\n说明:\n1. 推荐使用小于7M的图片;\n2. 图片格式的取值为:jpeg,jpg, png, webp。\n示例值:https://test.com/1.png",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Accessible file URL. This parameter is valid when the value of Type is Url.\nDescription:\n1. It is recommended to use pictures smaller than 7M;\n2. The value of the image format is: jpeg, jpg, png, webp.\nExample value: https://test.com/1.png"
              }
            }
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model_name": {
      "description": "模型名称。取值:\nGEM:Gemini;\nQwen:千问。\nHunyuan:混元。\n\n示例值:GEM",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Model name. Value:\nGEM: Gemini;\nQwen: Qianwen.\nHunyuan: Hunyuan.\n\nExample value: GEM"
        }
      }
    },
    "model_version": {
      "description": "模型版本。取值:\n当 ModelName 是 GEM,可选值为 2.5、3.0;\n当 ModelName 是 Qwen,可选值为 0925;\n当 ModelName 是 Hunyuan,可选值为 3.0;\n\n示例值:2.5",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "model version. Value:\nWhen ModelName is GEM, the optional values are 2.5 and 3.0;\nWhen ModelName is Qwen, the optional value is 0925;\nWhen ModelName is Hunyuan, the optional value is 3.0;\n\nExample value: 2.5"
        }
      }
    },
    "negative_prompt": {
      "description": "要阻止模型生成图片的提示词。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Prompt word to prevent the model from generating images."
        }
      }
    },
    "output_config": {
      "description": "生图任务的输出媒体文件配置。",
      "properties": {
        "aspect_ratio": {
          "description": "指定所生成图片的宽高比。\n当 ModelName 是 GEM,可选值是 1:1、3:2、2:3、3:4、4:3、4:5、5:4、9:16、16:9 和 21:9;\n当 ModelName 是 Qwen、Jimeng,则暂不支持,其中 Jimeng 会结合 Prompt意图、参考图片尺寸,由模型智能判断输出图片的宽高比。\n\n示例值:16:9",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Specifies the aspect ratio of the generated image.\nWhen ModelName is GEM, the optional values are 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9 and 21:9;\nWhen the ModelName is Qwen or Jimeng, it is not supported for the time being. Jimeng will combine the Prompt intention and the reference image size, and the model will intelligently determine the aspect ratio of the output image.\n\nExample value: 16:9"
            }
          }
        },
        "input_compliance_check": {
          "description": "是否开启输入内容的合规性检查。取值有:\nEnabled:开启;\nDisabled:关闭;\n\n示例值:Enabled",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Whether to enable compliance checking of input content. The values are:\nEnabled: turned on;\nDisabled: closed;\n\nExample value: Enabled"
            }
          }
        },
        "output_compliance_check": {
          "description": "是否开启输出内容的合规性检查。取值有:\nEnabled:开启;\nDisabled:关闭;\n\n示例值:Enabled",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Whether to enable compliance checking of output content. The values are:\nEnabled: turned on;\nDisabled: closed;\n\nExample value: Enabled"
            }
          }
        },
        "person_generation": {
          "description": "是否允许人物或人脸生成。取值有:\nAllowAdult:允许生成成人;\nDisallowed:禁止在图片中包含人物或人脸;\n\n示例值:AllowAdult",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Whether to allow character or face generation. The values are:\nAllowAdult: Allows adults to be generated;\nDisallowed: It is prohibited to include people or faces in images;\n\nExample value: AllowAdult"
            }
          }
        },
        "resolution": {
          "description": "生成图片的分辨率。可选值为 720P、1080P、2K、4K、1024x1024、2048x2048、2304x1728、2496x1664、2560x1440、3024x1296、4096x4096、4694x3520、4992x3328、5404x3040、6198x2656,其中使用模型 Jimeng 时,推荐通过 Prompt 指定图片分辨率和宽高比。\n示例值:1024x1024",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "The resolution of the generated image. Optional values are 720P, 1080P, 2K, 4K, 1024x1024, 2048x2048, 2304x1728, 2496x1664, 2560x1440 , 3024x1296, 4096x4096, 4694x3520, 4992x3328, 5404x3040, 6198x2656, where the model is used When Jimeng, it is recommended to specify the image resolution and aspect ratio through Prompt.\nExample value: 1024x1024"
            }
          }
        },
        "storage_mode": {
          "description": "存储模式。取值有:\nPermanent:永久存储,生成的图片文件将存储到云点播,可在事件通知中获取到 FileId;\nTemporary:临时存储,生成的图片文件不会存储到云点播,可在事件通知中获取到临时访问的 URL;\n\n默认值:Temporary",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Storage mode. The values are:\nPermanent: Permanent storage, the generated image files will be stored in the cloud on demand, and the FileId can be obtained in the event notification;\nTemporary: Temporary storage. The generated image files will not be stored in the cloud on demand. The URL for temporary access can be obtained in the event notification;\n\nDefault value: Temporary"
            }
          }
        }
      },
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Output media file configuration of the image generation task."
        }
      }
    },
    "prompt": {
      "description": "提示词",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Prompt"
        }
      }
    },
    "session_context": {
      "description": "来源上下文,用于透传用户请求信息,音画质重生完成回调将返回该字段值,最长 1000 个字符。\n示例值:mySessionContext",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Source context, used to transparently transmit user request information. The audio and video quality regeneration completion callback will return the value of this field, with a maximum length of 1000 characters.\nExample value: mySessionContext"
        }
      }
    },
    "session_id": {
      "description": "用于去重的识别码,如果三天内曾有过相同的识别码的请求,则本次的请求会返回错误。最长 50 个字符,不带或者带空字符串表示不做去重。\n示例值:mysession",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The identification code used for deduplication. If there is a request for the same identification code within three days, this request will return an error. The maximum length is 50 characters, without or with an empty string to indicate no deduplication.\nExample value: mysession"
        }
      }
    },
    "tasks_priority": {
      "description": "任务的优先级,数值越大优先级越高,取值范围是 -10 到 10,不填代表 0。\n示例值:10",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The priority of the task. The larger the value, the higher the priority. The value range is -10 to 10. If left blank, it means 0.\nExample value: 10"
        }
      }
    }
  },
  "required": [
    "model_name",
    "prompt",
    "model_version"
  ]
}

请求示例 · 示例 1#

{
  "enhance_prompt": "Enabled",
  "ext_info": "",
  "file_infos": [
    {
      "file_id": "387702299774574677",
      "text": "原始图片的描述信息",
      "type": "file",
      "url": ""
    }
  ],
  "model_name": "GEM",
  "model_version": "3.0",
  "negative_prompt": "blur, distorted",
  "output_config": {
    "aspect_ratio": "1:1",
    "input_compliance_check": "Enabled",
    "output_compliance_check": "Enabled",
    "person_generation": "AllowAdult",
    "resolution": "1080P",
    "storage_mode": "Temporary"
  },
  "prompt": "convert this image to anime style",
  "session_context": "{\"user_id\": \"123\", \"scene\": \"profile_picture\"}",
  "session_id": "image-task-67890",
  "tasks_priority": 10
}

响应示例 · 成功示例#

{
  "Response": {
    "RequestId": "f50d7667-72d8-46bb-a7e3-0613588971b6",
    "TaskId": "251007502-AigcImage***2782aff1e896673f1ft"
  }
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Body 参数application/json必填

示例
{
    "model_name": "GEM",
    "model_version": "3.0",
    "file_infos": [
        {
            "type": "file",
            "file_id": "387702299774574677",
            "url": "",
            "text": "原始图片的描述信息"
        }
    ],
    "prompt": "convert this image to anime style",
    "negative_prompt": "blur, distorted",
    "enhance_prompt": "Enabled",
    "output_config": {
        "storage_mode": "Temporary",
        "resolution": "1080P",
        "aspect_ratio": "1:1",
        "person_generation": "AllowAdult",
        "input_compliance_check": "Enabled",
        "output_compliance_check": "Enabled"
    },
    "session_id": "image-task-67890",
    "session_context": "{\"user_id\": \"123\", \"scene\": \"profile_picture\"}",
    "tasks_priority": 10,
    "ext_info": ""
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/tencent-vod/v1/aigc-image' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model_name": "GEM",
    "model_version": "3.0",
    "file_infos": [
        {
            "type": "file",
            "file_id": "387702299774574677",
            "url": "",
            "text": "原始图片的描述信息"
        }
    ],
    "prompt": "convert this image to anime style",
    "negative_prompt": "blur, distorted",
    "enhance_prompt": "Enabled",
    "output_config": {
        "storage_mode": "Temporary",
        "resolution": "1080P",
        "aspect_ratio": "1:1",
        "person_generation": "AllowAdult",
        "input_compliance_check": "Enabled",
        "output_compliance_check": "Enabled"
    },
    "session_id": "image-task-67890",
    "session_context": "{\"user_id\": \"123\", \"scene\": \"profile_picture\"}",
    "tasks_priority": 10,
    "ext_info": ""
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "Response": {
        "TaskId": "251007502-AigcImage***2782aff1e896673f1ft",
        "RequestId": "f50d7667-72d8-46bb-a7e3-0613588971b6"
    }
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:21
下一页
AIGC 生视频
Built with