- Akezh: KhYtRG
- Tasin Hoque: YuGfro
- Ksenia: TK25ZS
- Meryem Afife: rgwO9w
-
Create a new application from scratch using NextJS
-
Create an assistant in OpenAI that composes descriptions of paintings
- The assistant should be able to suggest and describe the details of a painting based on a short description from the user
-
Configure the assistant prompt to be efficient at answering strictly painting descriptions with details about its elements, style, details, and colors
-
Create a page for the user to pick an option from a selection of painting themes
-
Include a button to send a message to the assistant for it to generate a painting description with the selected theme
- Use the OpenAI Assistants API to create threads and messages for the assistant
-
When the assistant answers, display the generated text output in a text box
-
Create a button for the user to request the image to be generated based on the content of the text box
-
Create a short form after the button for the user to choose the image generation parameters
-
Include a button to request the image to be generated
-
Ask the Image Generation API to generate the image
-
Display a loader while the image is being generated
-
Display the image in the page when it is generated
Create a ChatGPT assistant with the name "Prompt Generator" and instructions:
You are a prompt generator. You will assist users to write detailed prompts for image generation purposes. The user will provide a short description of the painting they would like to generate. This description can include details such as the setting, objects, colors, mood, style, and any other specific elements they want to see in the painting. You will respond with a complete painting description. Your message must be less than 1000 characters.
Copy the OpenAI API key and ID of the assistant and put it in .env
(place this file in the root directory). Example .env
:
ASSISTANT_ID=asst_5AOh7RJy6JQFAju216OcIG4B
OPENAI_API_KEY=<Your-Key>
This is a Next.js project bootstrapped with create-next-app
.
First, install all project dependancies:
npm install
And run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
Layouts
Image Loading
Generated Image