Doc (beta)
Agent

AI Agents

Updated time: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": 2093,
        "fashionModelId": 20053,
        "tagIds": [2006],
        "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": 2093
    }
}
 
// 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
"custom": Manually upload mask information
1. autoApparelSegment automatic apparel segmentation is consistent with the automatic segmentation on the web page.
2. autoSubjectSegment automatic subject segmentation is for subject background segmentation, different from manual selection on the web page.
3. 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": 2113,
        "image": "https://ai-global-image.weshop.com/3e3fe7db-4cac-4c2d-8530-c4d9973b75ae_1024x1024.png_256x256.jpeg",
        "name": "Shopping Mall",
        "categories": ["Commercial Complex"],
        "tags": [
            {
                "id": 2034,
                "name": "Cinematic"
            },
            {
                "id": 2035,
                "name": "Film Grain"
            },
 
            ......
 
            {
                "id": 2036,
                "name": "Spot light"
            }
        ]
    },
    {
        "id": 2371,
        "image": "https://ai-global-image.weshop.com/9cba7891-dd9f-43ca-875d-1411cf9fd5ed_1024x1024.png_256x256.jpeg",
        "name": "Grocery Store",
        "categories": ["Store"],
        "tags": [
            {
                "id": 2012,
                "name": "Summer"
            },
            {
                "id": 2017,
                "name": "Fall"
            },
 
            ......
 
            {
                "id": 2004,
                "name": "Spring"
            }
        ]
    }
]

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": 20082,
        "image": "https://ai-global-image.weshop.com/92e45b1b-830d-4eaa-8ac2-340fc930230e_560x648.png_crop512.jpeg",
        "name": "Letitia",
        "profile": {
            "nationality": "Spain",
            "style": "Mature, Sexy",
            "priceDescription": "Additional cost of 5 points/image",
        },
        "type": "AI",
        "tags": [
            {
                "id": 2003,
                "name": "Smile"
            },
            {
                "id": 2014,
                "name": "Elegant"
            }
        ]
    },
    {
        "id": 20095,
        "image": "https://ai-global-image.weshop.com/a20ec42f-08b6-4b81-a4ea-36ce4a37fd2f_680x1024.png_crop512.jpeg",
        "name": "Eve",
        "profile": {
            "nationality": "Poland",
            "style": "Sweet, Cute",
            "priceDescription": "Additional cost of 5 points/image",
        },
        "type": "AI",
        "tags": [
            {
                "id": 2014,
                "name": "Elegant"
            },
            {
                "id": 2007,
                "name": "Laughing"
            },
            {
                "id": 2020,
                "name": "Fashionable"
            }
        ]
    }
]

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: "autoApparelSegment": Automatic apparel segmentation "autoSubjectSegment": Automatic subject segmentation
"custom": Manually upload mask information
1. autoApparelSegment automatic apparel segmentation is consistent with the automatic segmentation on the web page.
2. autoSubjectSegment automatic subject segmentation is for subject background segmentation, different from manual selection on the web page.
3. 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"]
    }
]