Build An AI Image Generator With OpenAI & Node.js

preview_player
Показать описание
In this project, we will use OpenAI and the DALL-E model to create a web app that will generate images from scratch based on the entered text.

💻 Code:

📄OpenAI Docs:

⭐ All Courses:

💖 Show Support

👇 Follow Traversy Media On Social Media:

Timestamps:
0:00 - Intro
2:00 - Setup & Install Dependencies
3:33 - Express Server & ENV Variables
6:03 - Route & Controller
9:58 - OpenAI Library Request/Response
15:17 - Request Body Data
19:34 - Frontend Setup
24:00 - Form Event Listener
26:38 - GenerateImageRequest() Function
31:45 - Display Image in DOM
33:20 - Using The App & Outro
Рекомендации по теме
Комментарии
Автор

Brad's approach is unique because he doesn't assume that his students know everything, hence, he adopts a "from start to finish" approach which makes it easier for everyone including beginners to code along with him. Thanks for being the reason that I still find coding fun despite working in a different field now.

hamzajirah
Автор

i love everything about Brad. he made me love programming when i almost gave up. He is my hero

admireexcellence
Автор

You said you're going off for a while. I think programming is in your blood 😂. Much love from Kenya Developers brother. You're amazing 💓☺️

alikisang
Автор

Brad you are God sent. I can't thank you enough man. You've had a huge contribution in my career as a dev. I really appreciate your willingness to share what you know. Thank you again!

jonathanwalumbe
Автор

I’ve said before and I’ll say it now. You sir, you’re are a blessing to this world! Thanks!!

romulororizz
Автор

Hey I saw this on your IG and was waiting patiently!! THank you.

I've literally fallen off the coding wagon, just seems I'm not getting anywhere, I'm dedicating next year as the last chance i'd give myself to become that programmer I've always wanted to be,
Wish me the best !!

joel
Автор

brad you're one of the best people on this platform. keep up the great work

nessci
Автор

As soon as I saw the tweet on Twitter, I had to see the video. 
Great topic, OpenAI is very interesting ✅ Thank you for sharing Brad 😊

universecode
Автор

Brad is a king! i learned programming from scratch with you like a principal font of information! thanks a lot for everything!!!

ianduhamelhayes
Автор

2024 updated errors fix:

1.
10:31 "TypeError: Configuration is not a constructor"
Fix: Openai has updated their github page. Instead of what he pasted, paste the following code instead:

const OpenAI = require('openai');
const openai = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'],
});

2.
11:10 "openai.createImage is not a function"
Fix: Openai has updated their website to use a different function. Paste the following code instead:

const response = await openai.createImage
|
v
const response = await openai.images.generate

3.
12:23 "Cannot read properties of undefined (reading '0')"
Fix: I have found when I use "Postman" it doesn't like the const imageUrl so to fix I deleted ".data[0].url":

const imageUrl = response.data.data[0].url;
|
v
const imageUrl = response.data;

brattiestsubset
Автор

What a cool project! Amazing technology we can work with! Thanks Brad!!

heguer
Автор

Brad is One of the Best Teachers in a Whole World!

Hacking-NASSA-with-HTML
Автор

Congratulations on 2 million subs, Brad. I've been following you since around 400K subs and it's great to see the profound effect that you have had on web dev education.

NOCDIB
Автор

Amazing project Brad. Thank you for sharing this.

jayantjayant
Автор

It's giving me an error:

400
{
error: {
code: 'billing_hard_limit_reached',
message: 'Billing hard limit has been reached',
param: null,
type: 'invalid_request_error'
}
}

Ojas_-qvfp
Автор

Thank you for explaining it from start to finish. It makes the whole concept easy to understand.

floramerano
Автор

I can't believe after all these years and so many subs Brad is still so humble and grounded. Capricon I guess.

Little-bird-told-me
Автор

Brad, your awesome. Hope you and the family have a great Christmas!

brianlobo-amaro
Автор

const configuration = new Configuration({
^

TypeError: Configuration is not a constructor
[nodemon] app crashed - waiting for file changes before starting...
please update this course with new changes.

sweetykumari
Автор

I'm kinda glad I no longer programme for a living, but after 3 days working with Chat GTP, I reckon it has already knocked 2 to 3 months off an electronics design project I was researching. Disruptive.

sonovoxx