AI Agents
Lasted Updated:2024-06-18
Overview
AI agent is a core concept in WeShop AI, representing different agents and tools we have that tailored to your needs. Please refer to https://www.weshop.ai/agent (opens in a new tab) if you need more information. In WeShop AI, users need to select the appropriate agent(s) to start the task. Each agent includes detailed instructions to help users precisely choose the right agent.
Relevant interfaces of AI agents, please refer to AI Agents Reference Interface,Below is an introduction to the generic interfaces for different AI agents. For detailed usage methods of different agents, please visit the specific agent for more information.
AI Model
Showcase clothing with a variety of models that aligns with your brand’s aesthetic
Basic Information
AgentName
aimodel
AgentVersion
- v1.0
Note
-
When executing the task, please select at least one or more parameters from fashionModelId, locationId, and textDescription to execute.
- If you prefer to use the template, you can provide the locationId and fashionModelId parameters. You can query the valid locationId and fashionModelId values through the AI entity's info API.
- If you want to describe the image you want to generate with words/phrases/sentences, you can assign a value to the textDescription parameter.
- Mask settings:
-
If you only need to keep the clothing on the model unchanged, please set maskType to "autoApparelSegment" when executing the task. The AI entity will use automatic apparel segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.
-
If you only need to change the background without replacing the model's face, please set maskType to "autoSubjectSegment" when executing the task. The AI entity will use automatic subject segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.
-
If you need to select the areas to keep unchanged on your own instead of using automatic segmentation, please prepare the mask image before the operation and set maskType to "custom" when executing the task. In this case, you need to provide either customMask or customMaskUrl parameter.
-
Tasks
Create Task
Request Parameters
- initParams
Parameters Sample:
{
"initParams": {
"taskName": "Create Task Api Test",
"originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
}
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskName | No | string | Task name | Do not exceed 20 characters |
originalImage | Yes | string | Original image | When using an external image link, you must ensure that the image link is publicly accessible on the internet. |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskId | Yes | string | Task ID - Unique Identifier | / |
Task Execution
Request Parameters
- params
Parameters Sample
// Automatic Apparel Segmentation
{
"params": {
"generatedContent": "referToOrigin",
"maskType": "autoApparelSegment",
"locationId": 2002093,
"fashionModelId": 4020053,
"textDescription": "A young caucasian female, highly detailed skin, realistic detailed eyes, natural skin texture, confident expression, standing on the street, sunny day, bright, summer afternoon, sharp focus, high quality, taken with iPhone, hyper-realistic.",
"negTextDescription": "dark clouds",
}
}
// Automatic Subject Segmentation
{
"params": {
"generatedContent": "freeCreation",
"maskType": "autoSubjectSegment",
"locationId": 2002093
}
}
// Upload Custom Mask
{
"params": {
"generatedContent": "freeCreation",
"maskType": "custom",
"customMask": "<mask image base64 encoded>",
"textDescription": "A young caucasian female, highly detailed skin, realistic detailed eyes, natural skin texture, confident expression, standing on the street, sunny day, bright, summer afternoon, sharp focus, high quality, taken with iPhone, hyper-realistic.",
"negTextDescription": "dark clouds",
}
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
generatedContent | Yes | string | Select algorithm preference: "freeCreation":Free creation "referToOrigin":Refer to the original image | 1. FreeCreation free creation will make the resulting image more free, without being constrained by the style of the uploaded original image. 2. referToOrigin reference original image will make the resulting image refer to the style of the uploaded original image during the generation process. |
maskType | Yes | string | Select mask type: "autoApparelSegment": Automatic apparel segmentation "autoSubjectSegment": Automatic subject segmentation "autoHumanSegment":Auto human segment "custom": Manually upload mask information | 1. autoApparelSegment automatic apparel segmentation is consistent with the 'change BG & face' on the web page. 2. autoSubjectSegment automatically segments the subejct and background , consistent with the 'change BG' on the web page. When executing this mask type, the provided fashionModelId will not take effect. 3.autoHumanSegment automatically segments the human figure, consistent with the 'change face' on the web page. When executing this mask type, the provided locationId will not take effect. 4. For manual upload, ensure the uploaded mask image has the same dimensions as the original image. |
customMask | No | string | Upload the base64 encoded mask image | 1. When the mask type is "custom", this parameter must be uploaded, otherwise no need to upload. 2. The area outside the mask region is transparent. 3. Use base64 encoding, without the prefix "data:image/png;base64". 4. Must have the same dimensions as the original image. |
customMaskUrl | No | string | URL of the uploaded mask image | When using an external image link, you must ensure that the image link is publicly accessible on the internet. The image format requirements are the same as customMask. |
locationId | No | int | Location | Optional |
locationTagIds | No | array[int] | Location tags | Optional, please refer to Locations |
fashionModelId | No | int | Model | Optional |
fashionModelTagIds | No | array[int] | Model tags | Optional, please refer to FashionModels |
textDescription | No | string | Text description of the content (optional) | Optional |
negTextDescription | No | string | Description of content you don't want to appear (optional) | Optional |
resultImageFormat | No | string | Select the format of the generated result image, options: "jpg" "png" (default is png) | Default is png |
resizeToOriginalImage | No | bool | Whether to resize the generated result image to the original image dimensions | Default is false |
batchCount | No | int | Set the number of images to generate in this execution, minimum is 1, maximum is 16 | Default is 4, values out of range will use the default |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | Yes | string | Execution ID - the unique identifier | / |
Query Task
Request Parameters
- json format, parameters sample
{
"executionId":"<execution id>"
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | No | string | Execution ID | / |
taskId | No | string | Task ID | If the taskId parameter is passed, at most the last 20 execution records will be returned. |
Response Parameters
- initParams
Current task's initial information
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskName | Yes | string | Task name | / |
originalImage | Yes | string | Original image | / |
- executions
Execution information
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | Yes | string | Execution ID | / |
status | Yes | string | Execution Status: Segmenting:In automatic segmentation Pending:Queuing Running :In progress Success:Completed | / |
params | Yes | object | Task execution related parameters | / |
executionTime | Yes | string | Task execution timestamp | / |
results | Yes | array[object] | Task execution result information | / |
- result
Execution result
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
status | Yes | string | Execution results Running Success Failed Pending | / |
image | Yes | string | The generated final image | / |
progress | No | string | Processing progress, e.g. 0.71 means 71% has been processed | / |
error | No | string | Information if processing failed | When the status is "Failed", this field will definitely be returned. |
Information Query
Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.
Request Parameters
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
agentName | Yes | string | agent name: "aimodel" | / |
agentVersion | Yes | string | agent version: "v1.0" | / |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
locations | Yes | array[object] | Location information | 1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info) 2. Please refer to the Locations data structure for details.Locations |
fashionModels | Yes | array[object] | Model information | 1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info) 2. Please refer to the Locations data structure for details.FashionModels |
agentVersion | Yes | string | Agent version | / |
Locations
- location data structure
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
id | Yes | int | Location Id | / |
image | Yes | string | Location Image | / |
name | Yes | string | Location Name | / |
categories | Yes | array[string] | Location Category | / |
tags | No | array[object] | Location Tags | / |
- tag data structure
Parameter Name | Required | Type | Description | Note |
---|---|---|---|---|
id | Yes | int | Location Id(locationTagIds) | / |
name | Yes | string | Location Name | / |
[
{
"id": 2002113,
"image": "https://ai-global-image.weshop.com/3e3fe7db-4cac-4c2d-8530-c4d9973b75ae_1024x1024.png_256x256.jpeg",
"name": "Shopping Mall",
"categories": ["Commercial Complex"],
"tags": [
{
"id": 1002004,
"name": "Spring"
},
......
{
"id": 1002036,
"name": "Spot light"
}
]
},
......
{
"id": 2002371,
"image": "https://ai-global-image.weshop.com/9cba7891-dd9f-43ca-875d-1411cf9fd5ed_1024x1024.png_256x256.jpeg",
"name": "Grocery Store",
"categories": ["Store"],
"tags": [
{
"id": 1002035,
"name": "Film grain"
},
......
{
"id": 1002036,
"name": "Spot light"
}
]
}
]
FashionModels
- fashionModel data structure
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
id | Yes | int | Model Id | / |
image | Yes | string | Model image | / |
name | Yes | string | Model name | / |
profile | No | object | Model informatoin, including country, style etc | / |
type | Yes | string | Model Type: AI: Provided by WeShop AI Yours: Created by users, you may create your own AI model on the site | / |
tags | No | array[object] | Model tags | / |
- profile data structure
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
nationality | No | int | Nationality of model | / |
style | No | string | Style of model | / |
priceDescription | No | string | Pricing of model | / |
- tag data structure
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
id | Yes | int | Model tag Id(fashionModelTagIds) | / |
name | Yes | string | Model tags | / |
[
{
"id": 4020082,
"image": "https://ai-global-image.weshop.com/ebcdbdcf-be9c-463b-bcd9-bebcf058b112_763x763.png_crop512.jpeg",
"name": "Letitia",
"profile": {
"nationality": "Spain",
"priceDescription": "Additional cost of 5 points / image",
"style": "Chic, Sexy, Sophisticated"
},
"tags": [
{
"id": 1002003,
"name": "Smiling"
},
......
{
"id": 1002032,
"name": "Lying"
}
],
"type": "AI"
},
......
{
"id": 4020095,
"image": "https://ai-global-image.weshop.com/a20ec42f-08b6-4b81-a4ea-36ce4a37fd2f_680x1024.png_crop512.jpeg",
"name": "Eve",
"profile": {
"nationality": "Poland",
"priceDescription": "Additional cost of 5 points / image",
"style": "Sweet, Cute"
},
"tags": [
{
"id": 1002003,
"name": "Smiling"
},
......
{
"id": 1002020,
"name": "Fashionable"
}
],
"type": "AI"
},
]
AI Product
Create stunning product images with few clicks from anywhere
Basic Information
AgentName
aiproduct
AgentVersion
- v1.0
Note
- When executing the task, please select at least one or more parameters from locationId , textDescription to execute.
- If you prefer to use the template, you can provide the locationId parameter. You can query the valid locationId values through the AI entity's info API.
- If you want to describe the image you want to generate with words/phrases/sentences, you can assign a value to the textDescription parameter.
- Mask settings:
- If you only need to change the background without replacing the model's face, please set maskType to "autoSubjectSegment" when executing the task. The AI entity will use automatic subject segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.
- If you need to select the areas to keep unchanged on your own instead of using automatic segmentation, please prepare the mask image before the operation and set maskType to "custom" when executing the task. In this case, you need to provide either customMask or customMaskUrl parameter.
Tasks
Create Tasks
Request Parameters
- initParams
Parameters Sample:
{
"initParams": {
"taskName": "Create Task Api Test",
"originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
}
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskName | No | string | Task name | Do not exceed 20 characters |
originalImage | Yes | string | Original Image | When using an external image link, you must ensure that the image link is publicly accessible on the internet. |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskId | Yes | string | Task ID - the unique identifier | / |
Execution
Request Parameters
- params
Parameters Sample:
// Automatic Subject Segmentation
{
"params": {
"generatedContent": "referToOrigin",
"maskType": "autoSubjectSegment",
"locationId": 2718,
"textDescription": "A toy race car in front of a white wall.",
"negTextDescription": "human faces",
}
}
// Upload Custom Mask
{
"params": {
"generatedContent": "freeCreation",
"maskType": "custom",
"customMask": "<mask image base64 encoded>",
"textDescription": "A toy race car in front of a white wall.",
"negTextDescription": "human faces",
}
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
generatedContent | Yes | string | Select algorithm preference: "freeCreation":Free creation "referToOrigin":Refer to the original image | 1. FreeCreation free creation will make the resulting image more free, without being constrained by the style of the uploaded original image. 2. referToOrigin reference original image will make the resulting image refer to the style of the uploaded original image during the generation process. |
maskType | Yes | string | Select mask type: "autoSubjectSegment": Automatic subject segmentation "custom": Manually upload mask information | 1. autoSubjectSegment automatically segments the subject and the background, consistent with the 'change BG' on the web page. 2. For manual upload, ensure the uploaded mask image has the same dimensions as the original image. |
customMask | No | string | Upload the base64 encoded mask image | 1. When the mask type is "custom", this parameter must be uploaded, otherwise no need to upload. 2. The area outside the mask region is transparent. 3. Use base64 encoding, without the prefix "data:image/png;base64". 4. Must have the same dimensions as the original image. |
customMaskUrl | No | string | URL of the uploaded mask image | When using an external image link, you must ensure that the image link is publicly accessible on the internet. The image format requirements are the same as customMask. |
locationId | No | int | Location | Optional |
locationTagIds | No | array[int] | Location tags | Optional, please refer to Locations |
textDescription | No | string | Text description of the content (optional) | Optional |
negTextDescription | No | string | Description of content you don't want to appear (optional) | Optional |
resultImageFormat | No | string | Select the format of the generated result image, options: "jpg" "png" (default is png) | Default is png |
resizeToOriginalImage | No | bool | Whether to resize the generated result image to the original image dimensions | Default is false |
batchCount | No | int | Set the number of images to generate in this execution, minimum is 1, maximum is 16 | Default is 4, values out of range will use the default |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | Yes | string | Execution ID - the unique identifier | / |
Query Task
Request Parameters
- json format, parameters sample
{
"executionId":"<execution id>"
}
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | No | string | Execution ID | / |
taskId | No | string | Task ID | If the taskId parameter is passed, at most the last 20 execution records will be returned. |
Response Parameters
- initParams
Current task's initial information
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
taskName | Yes | string | Task name | / |
originalImage | Yes | string | Original image | / |
- executions
Execution information
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
executionId | Yes | string | Execution ID | / |
status | Yes | string | Execution Status: Segmenting:In automatic segmentation Pending:Queuing Running :In progress Success:Completed | / |
params | Yes | object | Task execution related parameters | / |
executionTime | Yes | string | Task execution timestamp | / |
results | Yes | array[object] | Task execution result information | / |
- result
Execution result
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
status | Yes | string | Execution results Running Success Failed Pending | / |
image | Yes | string | The generated final image | / |
progress | No | string | Processing progress, e.g. 0.71 means 71% has been processed | / |
error | No | string | Information if processing failed | When the status is "Failed", this field will definitely be returned. |
result
Execution result
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
status | Yes | string | Execution results Running Success Failed Pending | / |
image | Yes | string | The generated final image | / |
progress | No | string | Processing progress, e.g. 0.71 means 71% has been processed | / |
error | No | string | Information if processing failed | When the status is "Failed", this field will definitely be returned. |
Information Query
Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.
Request Parameters
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
agentName | Yes | string | agent name: "aiproduct" | / |
agentVersion | Yes | string | agent version: "v1.0" | / |
Response Parameters
- data
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
locations | Yes | array[object] | Location information | 1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info) 2. Please refer to the Locations data structure for details.Locations |
agentVersion | Yes | string | Agent version | / |
Locations
- location data structure
Parameter Name | Required | Type | Description | Notes |
---|---|---|---|---|
id | Yes | int | Location Id | / |
image | Yes | string | Location Image | / |
name | Yes | string | Location Name | / |
categories | Yes | array[string] | Location Category | / |
tags | No | array[object] | Location Tags | / |
- tag data structure
Parameter Name | Required | Type | Description | Note |
---|---|---|---|---|
id | Yes | int | Location Id(locationTagIds) | / |
name | Yes | string | Location Name | / |
[
{
"id": 2718,
"image": "https://ai-global-image.weshop.com/e2541c55-a6ef-4333-87a7-f2bdd5341a85_800x800.png_256x256.jpeg",
"name": "White Wall Shadow",
"categories": ["Light Effect"]
},
{
"id": 2712,
"image": "https://ai-global-image.weshop.com/59def4ad-5746-435a-991a-0ab83c190b2f_1024x1024.png_256x256.jpeg",
"name": "Rooftop Terrace",
"categories": ["Home Design"]
},
......
{
"id": 2680,
"image": "https://ai-global-image.weshop.com/9431f1dc-d40e-46ce-aebe-76c7a49e352b_1024x1024.png_256x256.jpeg",
"name": "Forest Window View",
"categories": ["Natural Scenery"]
}
]