mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
cef99f37d3
* Toonify Script Added * Update README.md * Update toonify-API-2.py
18 lines
429 B
Python
18 lines
429 B
Python
import argparse
|
|
import requests
|
|
|
|
aq = argparse.ArgumentParser()
|
|
aq.add_argument('-i', '--input', required=True, help="input image path")
|
|
|
|
aq.add_argument('-k', '--apikey', required=True, help="api-key")
|
|
|
|
args = vars(aq.parse_args())
|
|
|
|
r = requests.post(
|
|
"https://api.deepai.org/api/toonify",
|
|
files={
|
|
'image': open(args['input'], 'rb'),
|
|
},
|
|
headers={'api-key': args['apikey']}
|
|
)
|
|
print(r.json()['output_url']) |