# Magic Smear-API Access

Magic Smear can repair damaged image or remove excess objects in the image, restoring the original state of the image, while ensuring the image to achieve the best artistic results.

# Task Creation

Create an algorithm task based on the input parameters and return the task id

# Request Address

/v3/pic/aigc-sd15/batch

# Request Parameter

Method

post

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx Basic base64 (appkey:appsecret) created by users combining appkey and secret

Body

Field Son Field Required Type Value Description
text - YES string Replace the text description in the smeared area of image
scale - NO string Size: 1:1/16:9/9:16/4:3/3:4, default of 1:1
image_url - NO string Link to downloadable image file
mask_url - NO string Smeared watermark image, with the resolution same as the image of image_url, black and white image
step - YES number Default of 7, the larger, the slower, and the value ranges from 1 to 30
cv_scale - YES number Text similarity 8.0 (0 - 30)
sampler - YES string Default Sampling Mode of "DDIM", select "PLMS"
sr - NO boolean Whether to super-resolution or not
strength - YES number Composition similarity 0.8 (0 -1.0)
np - NO string reverse word
out_num - YES integer Number of output image, default of 1, max value 4, charge on the number of image
disable_translate - NO boolean Whether to translation or not
disable_text_sensitive - NO boolean Whether to enable text sensitive word detection or not
disable_picture_sensitive - NO boolean Whether to enable image sensitive word detection or not

Sample Code

{
  "text": "natural landscape",
  "scale": "1:1",
  "image_url": "Downloadable image file link",
  "mask_url": "Downloadable image file link",
  "step": 7,
  "cv_scale": 8.0,
  "sampler": "DDIM",
  "sr": true,
  "strength": 0.8,
  "np": "body",
  "out_num": 1,
  "disable_translate": false,
  "disable_text_sensitive": false,
  "disable_picture_sensitive": false
}

# Input File Restriction

Image Format Image File Size Image Resolution Image Aspect Ratio
PNG JPG JPEG BMP No more than 50 MB Greater than 256x256px, less than 5000x5000px Aspect ratio within 4:1

# Return Data

Body

Field Son Field Required Type Value Description
code - YES number Status Code
msg - YES string Request Information
data - YES object Response Data
- task_id YES string Task id

Sample Code

{
  "code": 0,
  "msg": "",
  "data": {
    "task_id": "6a4eab77-be30-430a-bf0e-3048042a34ef"
  }
}

# Result Acquisition

Request task processing result based on task id

# Request Address

/v3/pic/aigc-sd15/result

# Request Parameter

Method

post

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx Basic base64 (appkey:appsecret) created by users combining appkey and secret

Body

Field Son Field Required Type Value Description
task_id - YES string Task id

# Return Data

Body

Field Son Field Required Type Value Description
code - YES number Status Code
msg - YES string Request Information
data - YES object Response Data
- url YES string
- status YES string Task Status Status: 1: Success; 2: Failure; 3: Queue Up; 4: Processing; 5: Sensitive Text; 6: Sensitive Image; 7: Timeout
- error YES string Error Message
- task_id YES string
- cost YES string Return Time
- images YES string[] Generated Image Array
Last Updated: 3/2/2024, 1:50:51 PM