3. Start Fast-Try-on Task

1 Function description

Tell the back end to start the inference task,please ensure that you have successfully uploaded the image

Note that In addition to the points for try-on, each api call will consume 0.1 coins.

2 Request method

method:POST URL :{ApiUrl}/api/inf/fastinf_upload

3 Request parameter

nametypedescribesample

openId

string

your openId

apiKey

string

our apiKey

infId

long

task id

6618

denoise_steps

int

steps

20

auto_mask

int

auto gen mask

1

auto_crop

int

meaningless

1

category

int

{1:'upper_body', 2:'lower_body', 3:'dresses', 4:'full_body', }

3

caption

string

cloth caption

white dress

notifyUrl

string

Callback

Callback url when task finished

denoise_steps = 20
auto_mask = 1
auto_crop = 1
category = 2
caption = "white dress"

params = {'openId':OpenId, 'apiKey':ApiKey, 'infId':infId, 
    'denoise_steps':denoise_steps, 'auto_mask':auto_mask, 
    'auto_crop':auto_crop, 'category':category, 'caption':caption,
    'notifyUrl':''}
session = requests.session()
ret = requests.post(f"{ApiUrl}/api/inf/public_fastinf", data=json.dumps(params))
if ret.status_code==200:
    print(ret.json())
    if 'data' in ret.json():
        """
            [Success] An example returns the result
            {'code': 200, 'msg': 'ok', 'data': True}
        """
        print('public task successfully!')
    else:
        print('public task failed')
        exit(0)
else:
    exit(0)

4 Respond

  • success

{'code': 200, 'msg': 'ok', 'data': True}
  • failed

If the returned result is false, it means that the image legality check failed, mostly because the face was not detected, or a headshot was uploaded. Call {ApiUrl}/api/inf/get_result, to get fail result

{'code': 200, 'msg': 'ok', 'data': False}

Last updated