This article helps how to use Dall-e 2 API to create images from textual description.
Start with Dall-e 2 account
https://openai.com/product/dall-e-2
Jumpstart Your Creativity with Dall-E 2: Get 50 Free Credits to Create, Tweak, and Generate Image Variants!
-
Create a free account: Sign up for an account on the OpenAI website to access DALL-E 2. Upon signing up, you will receive 50 credits initially, with an additional set of 15 credits added every month. Note that free credits cannot be carried forward.
-
Explore the web application: DALL-E 2 is available as a web application, which you can directly access from your internet browser. Once logged in, you can start using the AI image generation function through the web application's interface.
Create a PowerApp
- TextInput to type the prompt
- Button to trigger the Power automate
Set OnSelect property:
Set(imageurl, OpenAIDalle.Run(imagePromptTextInput.Text))
where OpenAIDalle is the name of the PowerAutomate workflow - Media Type Image to display the image returned from Dall-e Power automate
Create a PowerAutomate
-
Here are the steps to create a Power Flow:
- Go to flow.microsoft.com and click on "Flows".
- Visit https://make.powerautomate.com/
- Click "New Flow" and name it "OpenAIDalle".
- Start with PowerApps trigger to get the prompt.
- HTTP-Dall-e (as shown below)
Get OpenAI api-key from https://platform.openai.com/account/api-keys
replace openai_Api_key with above key
Authorization: Bearer openai_Api_key - parse the response json for generated image URL from a prompt
- Send the image URL back to powerappPowerApps
Set the media image URL in PowerApps as returned response from PowerApps
Output in PowerApps
References:
https://platform.openai.com/docs/api-reference
https://create.microsoft.com/en-us/learn/articles/how-to-image-prompts-dall-e-ai
More advance capabilities of DALL-e 2 and PowerApps are coming soon!!