# AI Painting -API Access

AI painting based on various prompt words and models

# Task Creation

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

# Request Address

/v3/pic/aigc-novel/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
prompt - YES string Prompt words that want to appear in the picture are separated by commas
negative_prompt - NO string Contents that do not appear are separated by commas
image_url - NO string Sample graph that is introduced into downloadable link
denoising_strength - NO number float64 type, image similarity range (0~1.0), default of 0.8
seed - NO integer Random seeds that can be inputted in random numbers
steps - NO integer Generate iteration steps, with default of 7, ranging from 1 to 30, the larger, the slower
cfg_scale - NO number float64 type, image-text correlation, the larger the number, the closer to the description of the prompt words, generally between 6 and 20
sampler_index - YES string Sampling apparatus, choose from "Euler a", "Euler", "LMS", "Heun", "DPM2", "DPM2 a", "DPM++ 2S a", "DPM++ 2M", "DPM++ SDE", "DPM fast", "DPM adaptive", "LMS Karras", "DPM2 Karras", "DPM2 a Karras", "DPM++ 2S a Karras", "DPM++ 2M Karras", "DPM++ SDE Karras","DDIM","PLMS"
model - YES integer Model: 1: anything 2: nice 3: hasdx 4: ultracolor 5: meinamix 6: bestqualitypastel, default to 1
batch_size - YES integer Number of image, default of 1, max value 4, charge on the number of image
scale - NO string Scale: "1:1", "16:9" and "9:16", choose one from the three
is_translate - NO boolean Whether to translate or not

Sample Code

{
  "prompt": "natural landscape, 4k hd photo",
  "image_url": "Downloadable image file link",
  "model": 1,
  "sampler_index": "Euler a",
  "batch_size": 2,
  "scale": "16:9",
  "seed": 91,
  "is_translate": true,
  "steps": 20,
  "cfg_scale": 9,
  "negative_prompt": "animal, people",
  "denoising_strength": 0.7
}

# 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-novel/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
- 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
- task_id YES string
- cost YES string
- images YES string[]
Last Updated: 3/2/2024, 1:50:51 PM