Doc (beta)
Agent

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 NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask 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 NameRequiredTypeDescriptionNotes
generatedContentYesstringSelect 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.
maskTypeYesstringSelect 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.
customMaskNostringUpload the base64 encoded mask image1. 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.
customMaskUrlNostringURL of the uploaded mask imageWhen 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.
locationIdNointLocationOptional
locationTagIdsNoarray[int]Location tagsOptional, please refer to Locations
fashionModelIdNointModelOptional
fashionModelTagIdsNoarray[int]Model tagsOptional, please refer to FashionModels
textDescriptionNostringText description of the content (optional)Optional
negTextDescriptionNostringDescription of content you don't want to appear (optional)Optional
resultImageFormatNostringSelect the format of the generated result image, options: "jpg" "png" (default is png)Default is png
resizeToOriginalImageNoboolWhether to resize the generated result image to the original image dimensionsDefault is false
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution Status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen 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 NameRequiredTypeDescriptionNotes
agentNameYesstringagent name:
"aimodel"
/
agentVersionYesstringagent version:
"v1.0"
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationsYesarray[object]Location information1. 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
fashionModelsYesarray[object]Model information1. 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
agentVersionYesstringAgent version/

Locations

  • location data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintLocation Id/
imageYesstringLocation Image/
nameYesstringLocation Name/
categoriesYesarray[string]Location Category/
tagsNoarray[object]Location Tags/

  • tag data structure
Parameter NameRequiredTypeDescriptionNote
idYesintLocation Id(locationTagIds)/
nameYesstringLocation Name/

locations

[
    {
 
        "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 NameRequiredTypeDescriptionNotes
idYesintModel Id/
imageYesstringModel image/
nameYesstringModel name/
profileNoobjectModel informatoin, including country, style etc/
typeYesstringModel Type:
AI: Provided by WeShop AI
Yours: Created by users, you may create your own AI model on the site
/
tagsNoarray[object]Model tags/
  • profile data structure
Parameter NameRequiredTypeDescriptionNotes
nationalityNointNationality of model/
styleNostringStyle of model/
priceDescriptionNostringPricing of model/
  • tag data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintModel tag Id(fashionModelTagIds)/
nameYesstringModel tags/

fashionModels

[
    {
        "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 NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal ImageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask 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 NameRequiredTypeDescriptionNotes
generatedContentYesstringSelect 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.
maskTypeYesstringSelect 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.
customMaskNostringUpload the base64 encoded mask image1. 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.
customMaskUrlNostringURL of the uploaded mask imageWhen 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.
locationIdNointLocationOptional
locationTagIdsNoarray[int]Location tagsOptional, please refer to Locations
textDescriptionNostringText description of the content (optional)Optional
negTextDescriptionNostringDescription of content you don't want to appear (optional)Optional
resultImageFormatNostringSelect the format of the generated result image, options: "jpg" "png" (default is png)Default is png
resizeToOriginalImageNoboolWhether to resize the generated result image to the original image dimensionsDefault is false
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution Status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen the status is "Failed", this field will definitely be returned.

result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen 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 NameRequiredTypeDescriptionNotes
agentNameYesstringagent name:
"aiproduct"
/
agentVersionYesstringagent version:
"v1.0"
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationsYesarray[object]Location information1. 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
agentVersionYesstringAgent version/

Locations

  • location data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintLocation Id/
imageYesstringLocation Image/
nameYesstringLocation Name/
categoriesYesarray[string]Location Category/
tagsNoarray[object]Location Tags/

  • tag data structure
Parameter NameRequiredTypeDescriptionNote
idYesintLocation Id(locationTagIds)/
nameYesstringLocation Name/

locations

[
    {
        "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"]
    }
]