tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Intelligent Human Face Beauty Feature

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-09-09 20:46:29

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>



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백