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/v1/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 |
Parameter List
| Parameter | Parameter Format | Description | Supplement |
|---|---|---|---|
| Aspect Ratio | --aspect or --ar |
|
The default aspect ratio is 1:1 |
| Chaos | --chaos 或 --c | is used to adjust the degree of randomness in the image generation process, directly affecting the diversity performance of the generated results. Value range: 0-100 |
|
| Character Reference | --cref | Character reference allows you to recreate a specific character across multiple images. | None |
| Role Weight | --cw | Used in conjunction with character references to specify the weight of the character in the generated image | None |
| Negative Prompt | --no | is used to specify elements or features that need to be excluded when generating an image. This parameter is implemented through a negative weighting mechanism, equivalent to setting a weight value of -0.5 for the specified elements. |
|
| Personalization | --profile 或 --p | Create custom image styles using personalized profiles and mood boards | None |
| Quality | --quality 或 --q | Use quality parameters to control image details and processing time | In version v7, the quality parameters have been optimized:
|
| Repeat | --repeat 或 --r | The repeat parameter allows users to generate multiple image variants through a single prompt request. This feature is particularly suitable for:
|
None |
| Seed | --seed | Seed parameters are used to set the initial random state for image generation, similar to the random number seed in Computer Graphics. By specifying the same seed value, similar initial generation results can be obtained under the same prompt. | None |
| Stop | --stop | The stop parameter is used to prematurely terminate rendering during the image generation process, allowing users to obtain different visual effects by controlling the completion level of generation. This parameter is similar to the pause function in video playback, enabling users to freeze the image generation process at specific stages. | Default Value: 100 (Fully Generated) Value Range: 1-100 (Integer) |
| Original Mode | --raw | Use the original mode to gain more control over the image | None |
| Stylization | --stylize 或 --s | Use stylization parameters to control the artistic style in the image | Stylization parameters are used to adjust the balance between realism and artistry in image generation:
|
| Style Reference | --sref | Style reference is a method that captures the visual atmosphere of an existing image and applies it to your new creation. It does not copy objects or figures, but only the overall style—such as color, medium, texture, or lighting—to help you achieve a consistent visual theme. | |
| Style Weight | --sw | Style Weight Parameter --sw allows you to control the degree to which the style of the reference image influences the new image. You can set this parameter to any value between 0 and 1000, with the default value being --sw 100 . |
|
| Style Version | --sv |
Used in conjunction with sref to specify the version of the style | --sv 1 Original style reference algorithm, more "atmospheric"
--sv 2 Second iteration of style reference
--sv 3 --sv 1 Updated version, more "atmospheric"
--sv 4 --sv 2 Updated version |
| Tile | --tile | The tiling parameter is used to generate images that can be seamlessly repeated, making it particularly suitable for creating repeating patterns and textures. This parameter ensures that the edges of the image can be perfectly matched through a special algorithm, achieving seamless connection in both horizontal and vertical directions. | |
| Model Version | --version 或 --v | Explore and switch model versions using version parameters | |
| Sketch | --draft | Generate sketch images in V7 with half the GPU cost | This feature is only compatible with version 7 |
| Weird | --weird or --w | Use weird parameters to make your images strange and unconventional |
|
| Image Weight | --iw | Control the influence of image prompts |
|
| Fast Mode | --fast | Switch your GPU speed to fast mode | |
| Slow Mode | --relax | Switch your GPU speed to slow mode | |
| Turbo Mode | --turbo | Switch your GPU speed to extreme mode | |
| Niji | --niji | Use our model focused on anime and Oriental aesthetics | |
| Enumeration | {} | Generate multiple prompts in batches and generate images | |
| Experimental Parameters | --exp | Control the aesthetic effects of image generation | |
| Stealth/Public Mode | --stealth/--public | Not currently supported | |
| Repeat Parameter | --repeat | Not currently supported | |
| Batch Quantity | --bs 或 --batchsize | Only supports video tasks | |
| Dynamic Mode | --motion | Control the speed of video dynamics (only supports video tasks) | |
| Universal Reference | --oref | Use the object in the image (upgrade of cref) | |
| Universal Reference Weight | --ow | Specifies the reference weight of the object in the image generation task, used together with oref | |
| Video end frame | --end | For video tasks only | |
| Video Loop | --loop | For video tasks only | |
| Other video-related parameters | - | - |
Currently does not support repeat, personalize, {} arrangement prompts, public/stealth.
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"
- 0: v6/niji6/v6.1/v7 subtle HD
- 1: v6/niji6/v6.1/v7 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"]
}
Path parameters
| Parameters | parameter format | Description |
|---|---|---|
| Model Version | --version or -v |
Use the version parameter to explore and switch between different model versions of MidJourney |
| Draft | --draft |
Generate draft images at half the GPU cost in Version 7 |
| Fast Mode | --fast |
Switch your GPU speed to Fast mode |
| Turbo Mode | --turbo |
Switch your GPU speed to Turbo mode |
Example
Request
curl 'https://genaiapi.cloudsway.net/v1/ai/{{endpointPath}}/tob/diffusion' \
-H 'Authorization: Bearer {Your AK}' \
-H 'Content-Type: application/json' \
-d '{
"text": "A beautiful and youthful high school girl is sitting in the classroom, with a bright smile on her face. --v 7 --aspect 2:1 --draft --turbo"
}'