MaaS-MJ
Common Information
Parameter | Description | Example |
---|---|---|
basePath | The base path for calling the mass API, includes the fixed path/v1/ai | https://genaiapi.cloudsway.net/v2/ai |
endpointPath | A randomly generated path segment for calling the mass API | |
AccessKey | The access key for calling the mass API | RWxxxxxxxx0Gd |
taskId | The task ID for asynchronous image processing tasks | 1234abcd |
Create raw image task
The raw image task is completed asynchronously.
Request method
POST
Request path
{basePath}/{endpointPath}/tob/diffusion
Request header
Parameters | Description | Example |
---|---|---|
Authorization | The AK (Access Key) created in the console. AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request body
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
text | string | Yes | Text Information, Length [1-8192] | A beautiful and youthful... |
Response value
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
audits | Array of strings | Image review results, empty indicates approval | ["approved"] | |
comment | string | Task status detailed description. | Task completed successfully. | |
id | string | Job ID | 3374b3b0-d069-4831-a76b-ebab4df14457 | |
seed | integer | Seed value | 123456 | |
status | integer | Task status Default:"0" Enum: 0: Newly created 1:In progress 2:Successfully completed 3:Failed |
0 | |
text | string | Text,length[1-8192] | A beautiful and youthful... | |
urls | Array of strings | Image URL or empty | ["http://example.com/image1.jpg"] |
Example
Request
curl --request POST \
--url https://genaiapi.cloudsway.net/v1/ai/eljciTfuqTxBSjXl/tob/diffusion \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "一辆炫酷的赛车,在山路上飞驰"
}'
Response
{
"audits": [],
"comment": "执行中",
"id": "67a99aa1f674346b1d1c010f",
"seed": 0,
"status": 1,
"text": "一辆炫酷的赛车,在山路上飞驰",
"urls": []
}
Region Redraw
Request method
POST
Request path
{basePath}/{endpointPath}/tob/inpaint
Request header
Parameters | Description | Example |
---|---|---|
Authorization | The AK (Access Key) created in the console. AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request body
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
imageNo | int | Yes | image number(0/1/2/3) | 0 |
jobId | string | Yes | job ID | 1234567890 |
mask | object | Yes | Lightweight region mask, supports multiple region redraws. | {...} |
remixPrompt | string | No | Redraw keyword prompt, length[1-8192] | A new artistic style |
area
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
height | int | Yes | Image pixel height(500-4096) | 1024 |
points | Array | Yes | Polygon region coordinates | [169,673,561,687,607,847,186,847] |
width | int | Yes | Image pixel width(500-4096) | 1024 |
Response value
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
audits | Array of strings | Image review results | ||
comment | string | Task status detailed description | In progress | |
id | string | Job ID | 3374b3b0-d069-4831-a76b-ebab4df14457 | |
seed | integer | Seed value | 123456 | |
status | integer | Task status Default:"0" Enum: 0: Newly created 1:In progress 2:Successfully completed 3:Failed |
0 | |
text | string | Text | A beautiful and youthful... | |
urls | Array of strings | Image URL or empty | ["http://example.com/image1.jpg"] |
Example
Request
curl --request POST 'https://genaiapi.cloudsway.net/v1/ai/eljciTfuqTxBSjXl/tob/inpaint' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'content-type: application/json' \
--header 'Accept: */*' \
--data-raw '{
"imageNo": 0,
"jobId": "67a96a41fc0b6392b58e4285",
"mask": {
"areas": [
{
"height": 500,
"points": [
169,673,561,687,607,847,186,847
],
"width": 500
}
]
}
}''
Response
{
"audits": [],
"comment": "执行中",
"id": "67a99bbff674346b1d1c015c",
"seed": 0,
"status": 1,
"text": "一辆炫酷的赛车,在山路上飞驰",
"urls": []
}
High definition
Request method
POST
Request path
{basePath}/{endpointPath}/tob/upscale
Request header
Parameters | Description | Example |
---|---|---|
Authorization | The AK (Access Key) created in the console. AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request body
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
imageNo | int | Yes | Image number(0/1/2/3) | 0 |
jobId | string | Yes | Job ID | 1234567890 |
type | int | Yes | HD Type | 0 |
type Parameters
- Default: "0"
- Enum: "0" "1" "2" "3"
- 0: v6/niji6/v6.1 subtle HD
- 1: v6/niji6/v6.1 creative HD
Response value
Field Name | Type | Required | Description | Example |
---|---|---|---|---|
audits | Array of strings | Image review results | ||
comment | string | Task status detailed description | In progress | |
id | string | Job ID | 3374b3b0-d069-4831-a76b-ebab4df14457 | |
seed | integer | Seed value | 123456 | |
status | integer | Task status Default:"0" Enum: 0: Newly created 1:In progress 2:Successfully completed 3:Failed |
0 | |
text | string | Text | A beautiful and youthful... | |
urls | Array of strings | Image URL or empty | ["http://example.com/image1.jpg"] |
Example
Request
curl --request POST 'https://genaiapi.cloudsway.net/v1/ai/eljciTfuqTxBSjXl/tob/upscale' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'content-type: application/json' \
--header 'Accept: */*' \
--data-raw '{
"imageNo": 0,
"jobId": "67a99bbff674346b1d1c015c",
"type": 1
}'
Response
{
"audits": [],
"comment": "执行中",
"id": "67a9ae7cfc0b6392b58e4ff6",
"seed": 0,
"status": 1,
"text": "一辆炫酷的赛车,在山路上飞驰",
"urls": []
}
Query task information.
Request method
GET
Request path
{basePath}/{endpointPath}/tob/job/{jobId}
Path parameters
Parameters | Type | Required | Description |
---|---|---|---|
jobId | string | Yes | Job ID |
Response Value
Field Name | Type | Description |
---|---|---|
audits | Array of strings | Image review results;corresponds to the index in the URLs array, empty indicates approval. |
comment | string | Task status detailed description |
id | string | Job ID |
seed | integer | Seed value |
status | integer | Task status |
text | string | Text,length[1-8192] |
urls | Array of strings | Image URL array, a single empty URL indicates disapproval. |
status Parameters
- 0: Task creation
- 1: In progress
- 2: Successfully completed
- 3: Failed
Example
Request
curl --request GET 'https://genaiapi.cloudsway.net/v1/ai/eljciTfuqTxBSjXl/tob/job/67a99aa1f674346b1d1c010f' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'content-type: application/json' \
Response
{
"audits": ["approved"],
"comment": "成功",
"id": "3374b3b0-d069-4831-a76b-ebab4df14457",
"seed": 123456,
"status": 2,
"text": "A beautiful and youthful high school girl is sitting in the classroom, with a bright smile on her face.",
"urls": ["http://example.com/image1.jpg"]
}