mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
cef99f37d3
* Toonify Script Added * Update README.md * Update toonify-API-2.py
19 lines
418 B
Python
19 lines
418 B
Python
import argparse
|
|
import requests
|
|
|
|
aq = argparse.ArgumentParser()
|
|
aq.add_argument('-i', '--input', required=True, help="input image link")
|
|
|
|
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': args['input'],
|
|
},
|
|
headers={'api-key': args['apikey']}
|
|
)
|
|
print(r.json()['output_url'])
|