curl -d '{"style": "photo_mid", "scratch": "", "color": "", "livephoto": "", "input": "YOUR_IMAGE_URL"}' \
-H 'X-API-KEY:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
https://jpghd.com/api/task/
import requests
import json
data = {
'style': 'photo_mid',
'scratch': '',
'color': '',
'livephoto': '',
'input': 'YOUR_IMAGE_URL'
}
r = requests.post(
url='https://jpghd.com/api/task/',
headers={'X-API-KEY': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'},
data=json.dumps(data)
)
print(r.json())
- data is JSON format
- style can by photo(Photo AI Enhance + Lossless Enlarge 4X), photo_mid(Photo AI Enhance + Lossless Enlarge 2X), photo_slim(Photo AI Enhance), art(Artwork Image AI Enhance + Lossless Enlarge 4X), art_mid(Artwork Image AI Enhance + Lossless Enlarge 2X), art_slim(Artwork Image AI Enhance)
- scratch is Optional,set empty string will not repair scratch
- color is Optional, set empty string will not colorize the photo
- livephoto is Optional, set empty string will not make magic photo
- return status can be ok(means successed), conf_param_error(means conf parameter errors), exceed_limit(means api credits not enough)
curl https://jpghd.com/api/task/tid,tid,tidimport requests
r = requests.get(url='https://jpghd.com/api/task/tid,tid,tid')
print(r.json())
- yellow part is the task id returned by the Task Create API,split by comma
curl -X POST https://jpghd.com/api/task/tid,tid,tidimport requests
r = requests.post(url='https://jpghd.com/api/task/tid,tid,tid')
print(r.json())
- yellow part is the task id returned by the Task Create API,split by comma