Untitled

mail@pastecode.io avatar
unknown
plain_text
10 months ago
462 B
1
Indexable
Never
!pip install pillow
import urllib.request
from PIL import Image
from IPython.display import display
import requests
r = requests.post(
    "https://api.deepai.org/api/text2img",
    data={
        'text': 'YOUR_TEXT_HERE',
    },
    headers={'api-key': 'quickstart-QUdJIGlzIGNvbWluZy4uLi4K'}
)
imageURL1 = r.json()['output_url']
imageName1="file1.jpg"
urllib.request.urlretrieve(imageURL1, imageName1)
img1 = Image.open(imageName1)
display(img1)