Python script for generating image from text by Open AI
Project description
openai_image
Python script for generating image from text by Open AI
1. Install openai & openai-image
pip install openai
pip install openai-image
2. Recieve your OpenAI API KEY
https://platform.openai.com/account/api-keys
create file settings.py in your folder/
put this key to settings.py file
API_KEY = 'your-secret-openai-api-key'
3. Set image size
settings.py:
PIC_SIZE = '256x256'
(options :'256x256', '512x512', '1024x1024')
4. Mkdir images
Create folder 'images' (foder for ready images)
5. Use openai_image
import openai_image
Example1:
import openai_image
openai_image.get_image()
Prompt target text: blue bird
Your image file ready: /images/blue_bird.jpg
Example2:
import openai_image
openai_image.get_image('Alice in Wonderland')
Your image file ready: /images/Alice_in_Wonderland.jpg
Documentation
https://best-itpro.ru/news/openai_image/
That's All, Folks! ;)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openai_image-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 659dd237157507d9c84d1a87f04d92d707abc3c6a5a15d5ec041e7cc7e03c743 |
|
MD5 | d1cf70558074d8904bc0894a9a6cb86d |
|
BLAKE2b-256 | 40b2fcd478e8f49f96dfa905effd6ac94d781630a8ff83b7ac5587769e211529 |