tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Intelligent Human Face Beauty Feature

PDF
聚焦模式
字号
最后更新时间: 2026-01-09 21:32:02

Feature Description

Tencent Cloud CI uses the AIFaceBeauty API to perform intelligent beauty processing on human faces in images, suitable for social media image beautification or repairing and enhancing human faces after face effect processing, then fusing them back into the original image.
Note:
This interface belongs to a GET request, is a synchronous request method, and requires a signature. For specific signature settings, please see Request Signature.

Authorization Description

When using with a sub-account, corresponding permissions must be granted. For COS permissions, please refer to COS action. For CI permissions, please refer to CI action.
Processing during download: In the authorization policy, set action to cos:GetObject, ci:CreateAIFaceBeautifyJob.
Process during upload: Set action to cos:PutObject, ci:CreateAIFaceBeautifyJob in the authorization policy.
Cloud data processing: In the authorization policy, set action to cos:GetObject, cos:PutObject, ci:CreateAIFaceBeautifyJob (Note: GetObject corresponds to the source file resource, and PutObject corresponds to the transferred file resource).

Activating a Service

Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Binding a Bucket.
Use this feature requires enabling the AI Content Recognition service in advance via console or API. For details, see Enabling AI Content Recognition Service.

Use Limits

When using this API, please first confirm the relevant restrictions. For details, see Usage Limits.

Fee Description

This API is a paid service. Generated costs will be charged by Cloud Infinite. For billing details, see Content Recognition.

Solutions

Method One: Processing during Download

Request

Original image stored in COS
GET /<ObjectKey>?ci-process=AIFaceBeauty HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Original image from another link
GET /?ci-process=AIFaceBeauty&detect-url=<detect-url> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>

Processing Parameter Description

Parameter
Meaning
Type
Required or Not
ObjectKey
object filename, for example: folder/document.jpg.
String
Yes
ci-process
Cloud Infinite processing capability, image enhancement fixed as AIFaceBeauty.
String
Yes
strength
Intensity of beauty effects, value range is a floating-point number between 0 and 1, default value is 0.5.
Float
No
detect-url
You can process any publicly accessible image link by filling in detect-url. If detect-url is not specified, the backend will default to processing ObjectKey. If detect-url is filled in, the backend will process the detect-url link, and there is no need to fill in ObjectKey.
http://www.example.com/abc.jpg needs to be url-encoded, and the processed result is http%25253A%25252F%25252Fwww.example.com%25252Fabc.jpg.
String
No
ignore-error
When this parameter is set to 1, for scenarios such as file size being too large that cause processing failure, the original image will be returned directly without reporting an error.
Integer
No

Response

HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 98645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****
[pic-content]
The processed image is returned directly in the response body.


Method Two: Processing Upon Upload

Request Syntax

PUT /<ObjectKey> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations: <PicOperations>
Note:
Authorization: Auth String (See Request Signature for details.)

Request Headers

This API only uses common request headers. For details, see the Common Request Headers document. In addition to the common headers, the following headers need to be provided:
Header Name
Description
Type
Pic-Operations
Parameters for image operations
String
Pic-Operations is a json format string with the following specific parameters:
Parameter Name
Type
Required or Not
Description
is_pic_info
Int
No
Whether to return original image information, 0 for no return, 1 for return, default is 0
rules
Array
No
Processing rules, one rule corresponds to one processing result (currently supports five rules), leave blank to not perform image processing.
Each item in the rules (json array) has the following specific parameters:
Parameter Name
Type
Required or Not
Description
bucket
String
No
The name of the target bucket for storing results, in the format BucketName-AppId. If not specified, it defaults to the current bucket.
fileid
String
Yes
Storage path and name of the processed file. Naming rules description:
For example, the source file path and name are: /p1/test1.jpg
1. An absolute path starts with /. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder.
2. A relative path does not start with /. For example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder.
3. Do not end with /, otherwise an empty filename will occur.
4. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey>.
rule
String
Yes
process parameter, fixed as: ci-process=AIFaceBeauty

Request Body

The request body contains the original image to be super-resolved [Image Content]

Response

Response Headers
This API returns common response headers. For details, see the Common Response Headers document.
Response Body
The response body returns data with a content-type of application/xml, and the specific data content is as follows:
Node Name (Keyword)
Parent Node
Description
Type
UploadResult
None.
Request result.
Container

The content of UploadResult
Node Name (Keyword)
Parent Node
Description
Type
OriginalInfo
UploadResult
Image information
Container
ProcessResults
UploadResult
Request processing result
Container
The content of the OriginalInfo node
Node Name
Parent Node
Description
Type
Key
OriginalInfo
Original image file name
String
Location
OriginalInfo
Original image path
String
ETag
OriginalInfo
Original image ETag value
String
ProcessResults node content:
Node Name (Keyword)
Parent Node
Description
Type
Object
ProcessResults
Processing result of each image
Container
Object node content:
Node Name (Keyword)
Parent Node
Description
Type
Key
Object
Beauty effect image file name
String
Location
Object
Beauty effect image link
String
ETag
Object
Beauty effect image ETag value
String
Size
Object
Beauty effect image size
Int

Example

Request
PUT /<ObjectKey> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations:
{
"is_pic_info": 1,
"rules": [{
"fileid": "exampleobject",
"rule": "ci-process=AIFaceBeauty"
}]
}

Response:
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
Server: tencent-ci
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****

<UploadResult>
<OriginalInfo>
<Key>ObjectKey</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location>
<ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag>
</OriginalInfo>
<ProcessResults>
<Object>
<Key>exampleobject</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location>
<Format/>
<Size>354256</Size>
<ETag>"521451f63c331becf533e466732c1091"</ETag>
</Object>
</ProcessResults>
</UploadResult>



Method Three: Cloud Data Processing

Request Syntax

POST /<ObjectKey> HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Pic-Operations: <PicOperations>

Request

Request header.
This API only uses common request headers. For details, see the Common Request Headers document. In addition to the common headers, the following headers need to be provided:
Header Name
Description
Type
Pic-Operations
Parameters for image operations
String

Pic-Operations is a json format string with the following specific parameters:
Parameter Name
Type
Required or Not
Description
is_pic_info
Int
No
Whether to return original image information, 0 for no return, 1 for return, default is 0
rules
Array
No
Processing rules, one rule corresponds to one processing result (currently supports five rules), leave blank to not perform image processing.

Each item in the rules (json array) has the following specific parameters:
Parameter Name
Type
Required or Not
Description
bucket
String
No
The name of the target bucket for storing results, in the format BucketName-AppId. If not specified, it defaults to the current bucket.
fileid
String
Yes
Storage path and name of the processed file. Naming rules description:
For example, the source file path and name are: /p1/test1.jpg
1. Starts with / is an absolute path. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder.
2. A relative path does not start with /. For example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder.
3. Do not end with /, otherwise an empty filename will occur.
4. If you want the beautified image to overwrite the original image, set the fileid field to <ObjectKey>.
rule
String
Yes
process parameter, fixed as: ci-process=AIFaceBeauty


Request Body

The request body contains the original image to be beautified [Image Content]

Response

Response Headers
This API returns common response headers. For details, see the Common Response Headers document.
Response Body
The response body returns data with a content-type of application/xml, and the specific data content is as follows:
Node Name (Keyword)
Parent Node
Description
Type
UploadResult
None.
Request result.
Container

The content of UploadResult
Node Name (Keyword)
Parent Node
Description
Type
OriginalInfo
UploadResult
Image information
Container
ProcessResults
UploadResult
Request processing result
Container

The content of the OriginalInfo node
Node Name
Parent Node
Description
Type
Key
UploadResult.OriginalInfo
Original image file name
String
Location
UploadResult.OriginalInfo
Original image path
String
ETag
UploadResult.OriginalInfo
Original image ETag value
String

ProcessResults node content:
Node Name (Keyword)
Parent Node
Description
Type
Object
UploadResult.ProcessResults
Processing result of each image
Container

Object node content:
Node Name (Keyword)
Parent Node
Description
Type
Key
UploadResult.ProcessResults.Object
Beauty effect image file name
String
Location
UploadResult.ProcessResults.Object
Beauty effect image link
String
ETag
UploadResult.ProcessResults.Object
Beauty effect image ETag value
String
Size
UploadResult.ProcessResults.Object
image size
Int

Example

Request
POST /<ObjectKey>?image_process HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Content-length: Size
Authorization: Auth String
Pic-Operations:
{
"rules": [{
"fileid": "exampleobject",
"rule": "ci-process=AIFaceBeauty"
}]
}
The processed image is stored in the bucket, and the field value of fileid is used as the object name.
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 645
Date: Tue, 23 Apr 2022 09:06:16 GMT
Status: 200 OK
Server: tencent-ci
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****

<UploadResult>
<OriginalInfo>
<Key>ObjectKey</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location>
<ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag>
</OriginalInfo>
<ProcessResults>
<Object>
<Key>exampleobject</Key>
<Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location>
<Format/>
<Size>354256</Size>
<ETag>"521451f63c331becf533e466732c1091"</ETag>
</Object>
</ProcessResults>
</UploadResult>



帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈