dallecli
is a community-maintained cli designed to provide users with the ability to generate, edit and filter images using the DALL-E 3 API provided by OpenAI, all from the command line.
The tool provides three main commands, generate, edit, and filter.
The generate
command allows the user to generate an image using a prompt, with the option to apply a filter, specify the size, and choose the number of times to generate the image. The generated image can also be saved to a specified file path.
The edit
command provides the ability to edit an existing image by adjusting the brightness, contrast, and sharpness of the image. The edited image is then saved to a new file.
The filter
command allows users to apply various filters and effects to an existing image. The user can select from a range of different filters, and the filtered image can be saved to a specified file path.
This is ideal for developers, designers, and anyone who wants to quickly generate and manipulate images without the need for a full-fledged image editing software. I hope you find it useful.
The image generations endpoint allows you to create an original image given a text prompt. When using DALLยทE 3, images can have a size of 1024x1024, 1024x1792 or 1792x1024 pixels.
By default, images are generated at standard quality, but when using DALLยทE 3 you can set quality: "hd" for enhanced detail. Square, standard quality images are the fastest to generate.
You can request 1 image at a time with DALLยทE 3 (request more by making parallel requests)
Read more here https://platform.openai.com/docs/guides/images/introduction
The cli requires you to have an api token to query the OpenAI's api. You can read about and get it here https://platform.openai.com/account/api-keys.
Install the dallecli python package directly from pypi.
pip install dallecli
I would recommend using pipx instead of pip to install cli applications on you machine.
Usage: dallecli [OPTIONS] COMMAND [ARGS]...
๐ Use the Dall.E 3 api to generate, edit & filter images from the cmd line.
Options:
--help Show this message and exit.
Commands:
edit ๐ด Change the brightness, contrast and sharpness of an image.
filter ๐ฆ Apply filters and effects to an image.
generate ๐ธ Generate an image from the OpenAI Dalle api.
update ๐ Update the OpenAI API key.
generate
Usage: dallecli generate [OPTIONS]
๐ธ Generate an image from the OpenAI Dalle api
Options:
--prompt TEXT ๐ฌ The prompt to generate the image from.
--size TEXT ๐ The size of the generated image (default 1024x1024).
--filter ๐จ Apply a filter to the generated image.
--iterations INTEGER ๐ The number of times to generate the image.
--save-path FILE ๐พ Save the generated image to the specifiedfile path.
--hide FLAG ๐ฑ๏ธ Do not open the image after generation.
--quality TEXT ๐ The quality of the image ( "standard" or "hd" ).
--model TEXT ๐ฆพ The OpenAI model to use when generating images ( use dall-e-2 for older model)
--help Show this message and exit.
edit
Usage: dallecli edit [OPTIONS] IMAGE_PATH
๐ด Change the brightness, contrast and sharpness of an image.
Options:
--brightness FLOAT ๐ก The brightness of the image
--contrast FLOAT ๐ The contrast of the image
--sharpness FLOAT ๐ช The sharpness of the image
--help Show this message and exit.
filter
Usage: dallecli filter [OPTIONS] IMAGE_PATH
๐ฆ Apply filters and effects to an image.
Options:
--filter [grayscale|sepia|blur|contour|detail|edge_enhance|edge_enhance_more|emboss|find_edges|sharpen|smooth|smooth_more|outline|posterize|solarize|invert|flip]
๐จ The filter to apply to the image
--save-path PATH The directory to save the filtered image.
Defaults to the current directory.
--help Show this message and exit.
update
Usage: dallecli update [OPTIONS]
๐ Update the OpenAI API key.
Options:
--env โป๏ธ Get the api key from the OPENAI_API_KEY env variable
--help Show this message and exit.
Please feel to create issues or request for features. There will be many features added to the cli.