Simple Curl & Shell Notebook for AI Image Editing

While chatGPT has been all the craze, OpenAI’s underlying APIs offer much more. Outside of GPT4, the core piece to chatGPT, OpenAI provides AI Image-Generation APIs under the DALL-E umbrella.

💡 OpenAI’s description: DALL·E 2 is an AI system that can …


This content originally appeared on DEV Community and was authored by Sebastian Tiedtke

While chatGPT has been all the craze, OpenAI’s underlying APIs offer much more. Outside of GPT4, the core piece to chatGPT, OpenAI provides AI Image-Generation APIs under the DALL-E umbrella.

💡 OpenAI’s description: DALL·E 2 is an AI system that can create realistic images and art from a description in natural language. 👉 https://openai.com/product/dall-e-2

These APIs are plain amazing…! They allow you to take an existing image and describe in words what edits you’d like the AI to make for you. It's like magic!

🙌 No Coding Required

Edit image using words via AI

Edit a ball pit into the image? Easy!

You can learn how to use DALL-E's APIs without writing custom code. We'll showcase this using Runme, which lets you create Markdown notebooks with interactive Shell commands, similar to Jupyter for Python.

🛠 Please give Runme a spin, install here or search runme inside VS Code

My dog Luna 🐕 offered to help us make our point! Right below, you’ll see Luna at a doggy friend’s birthday party in real life. All we’re using is a simple scene prompt: “a happy german shepherd dog surrounded by cheeseburgers”:

Original image of Luna

Unedited image of Luna

Luna with faux cheeseburgers

No way Luna would sit this calmly if those cheeseburgers were real 🤭

👩‍💻 Try It Yourself

Head to https://platform.openai.com/ to get an API key and follow our Runme notebook. Depending on how much you plan on using the API, OpenAI puts a limit on its free tier.

The repo with the notebook is available here: https://github.com/sourishkrout/loon

Runme notebook for AI image editing

🖥 Skip The Notebook, Use The CLI

If you live in the terminal, use the Runme CLI instead. After you clone the repo, drop your OPENAI_API_KEY=<super secret> into your environment. Then, do this:

$ runme run --filename AI.md install-deps
$ runme run --filename AI.md run-scene | jq -r ".data[0]" # btw, output URL expires
{
  "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-tm5BAbynhBsE9Lzy1HTD6sk0/user-7A9nqIQ8tVXN7epnIqZs6fca/img-Hc1KHk6lkJegAkMqUWSL9D0i.png?st=2023-04-18T13%3A56%3A07Z&se=2023-04-18T15%3A56%3A07Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-04-18T11%3A36%3A32Z&ske=2023-04-19T11%3A36%3A32Z&sks=b&skv=2021-08-06&sig=9oEyq1os4zwf6rvb67W1rPDkTsPd%2BZ%2B1VHi/gWaz17M%3D"
}

Most terminal emulators will allow you to click the URL to open it in a browser. That's it!

🌠 Make Your Own

We've explained how to use your images within the Runme notebook. The originals are also included with the notebook in the repository. Interestingly, the more background you mask (let the AI know what not to preserve), the more drastically the AI morphs the scene. Let us know what you think. You can find us on Discord. Please drop by and share one of your own DALL-E impressions!

Thank you.


This content originally appeared on DEV Community and was authored by Sebastian Tiedtke


Print Share Comment Cite Upload Translate Updates
APA

Sebastian Tiedtke | Sciencx (2023-04-19T01:56:39+00:00) Simple Curl & Shell Notebook for AI Image Editing. Retrieved from https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/

MLA
" » Simple Curl & Shell Notebook for AI Image Editing." Sebastian Tiedtke | Sciencx - Wednesday April 19, 2023, https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/
HARVARD
Sebastian Tiedtke | Sciencx Wednesday April 19, 2023 » Simple Curl & Shell Notebook for AI Image Editing., viewed ,<https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/>
VANCOUVER
Sebastian Tiedtke | Sciencx - » Simple Curl & Shell Notebook for AI Image Editing. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/
CHICAGO
" » Simple Curl & Shell Notebook for AI Image Editing." Sebastian Tiedtke | Sciencx - Accessed . https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/
IEEE
" » Simple Curl & Shell Notebook for AI Image Editing." Sebastian Tiedtke | Sciencx [Online]. Available: https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/. [Accessed: ]
rf:citation
» Simple Curl & Shell Notebook for AI Image Editing | Sebastian Tiedtke | Sciencx | https://www.scien.cx/2023/04/19/simple-curl-shell-notebook-for-ai-image-editing/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.