Build An AI Image Generation Website in HTML CSS and JavaScript | Like Midjourney and DALL-E

In this video, I've shown how to build an AI-powered Image Generation Website in HTML, CSS, and JavaScript. On this website, users enter their prompt and select a number of AI-generated images they want to be created. They can also download their images by clicking on the download button. This website is similar to MidJourney and DALL-E and works on all devices.
🖼️ Get Images only of this AI Image Generator Website
➤ www.codingnepalweb.com/custom...
🗂️ Get Source Code of this AI Image Generator Website
➤ buymeacoffee.com/codingnepal/...
🌐 Visit CodingNepal for helpful coding projects
➤ www.codingnepalweb.com
⭐ Hire me on Fiverr
➤ www.fiverr.com/prakashahi
📷 Follow me on Instagram
➤ / coding.np
🤝 Support my work with a coffee
➤ buymeacoffee.com/codingnepal
Timestamps:
0:00 AI Image Generator Demo
2:00 Starting with HTML & CSS
17:09 Getting Into JavaScript
17:43 Creating Loading Cards
21:18 Generating AI Images using API
28:50 Downloading Image on Button Clicks
#html #css #javascript #ai #openai #dalle #aiimagegenerator
Music Credit:
Ikson - We Are Free [Official]
• #83 We Are Free (Offic...
LAKEY INSPIRED - Chill Day
• LAKEY INSPIRED - Chill...
Miss You - LiQWYD
• Miss You - LiQWYD (No ...
After Rain - Zackross
• After Rain - Zackross ...

Пікірлер: 112

  • @tizianopreisig3094
    @tizianopreisig30949 ай бұрын

    Thank you so much for making this available on KZread. You provide top-notch quality here. I'm a big fan of your videos.

  • @ascodes3461
    @ascodes34618 ай бұрын

    Thank you soo much for this amazing video 😍

  • @Philip-philippe
    @Philip-philippe2 ай бұрын

    wow this is the right place to learn coding

  • @marginiszero
    @marginiszero9 ай бұрын

    It is an amazing work bro ✌😍

  • @switchlyrics.
    @switchlyrics.10 ай бұрын

    I always watch your tutorials

  • @gentlehandwithgreatsmile
    @gentlehandwithgreatsmile5 ай бұрын

    Really nice tutorial! thanks. to anyone having troubles with this project, add "model : 'dall-e-3'" and 'n:1' and google the sizes of dall-e-3 and choose your ideal. Then you will get an error, the "bill" error, which means you have to pay the API, otherwise you can't access it. Still it's amazing to know how to build an AI project with javascript.

  • @meghashah269

    @meghashah269

    5 ай бұрын

    I'm getting access limit error can you please guide me?

  • @studypoint3338

    @studypoint3338

    2 ай бұрын

    @@meghashah269 did your error resolved

  • @Shravankumar_888
    @Shravankumar_88810 ай бұрын

    instead of making a top blacklayer and making it adjust you can use filter: brightness(0.8) its works best

  • @mehdismaeili3743
    @mehdismaeili37439 ай бұрын

    Excellent.

  • @user-vj3dh6ok6o
    @user-vj3dh6ok6o10 ай бұрын

    OMG It 's what I've been looking for :)

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Happy to hear that :)

  • @CC-1.
    @CC-1.10 ай бұрын

    Oh it would be fun if you created your own actual AI modal just use an transformer with few billion or million images labeled easy as it sounds with libbs like tensor flow training is easy creating server and we got it

  • @mdms4549
    @mdms454910 ай бұрын

    Perfect job🎉🎉🎉 thanks 😊😊😊

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Thank you too!

  • @user-br5vo4ew3g
    @user-br5vo4ew3g10 ай бұрын

    Instead of converting the response as a json we can directly make the response as a url and convert it into blob

  • @bhuvandahal421
    @bhuvandahal42110 ай бұрын

    wow amazing 🥰😍🤩

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Thank you!!

  • @alaakouki4369
    @alaakouki436910 ай бұрын

    Sir, please could you explain how querySelector of download Btn still works (after generate AI images) after you although you already remove the download button from the initial showcase images (the main one from HTML) ? Or it is take it from imgCardMarkup ?

  • @featherphone9644

    @featherphone9644

    3 ай бұрын

    because when you're generating images you generate const imgCardMarkup where the dwnload button is still present

  • @zohramanzoor3473
    @zohramanzoor347310 ай бұрын

    COOL 😍😍BUT WHEN WILL YOU UPLOAD THE SOURCE CODE ON YOUR WEBSITE ?

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Here is the source code link: www.codingnepalweb.com/ai-image-generator-website-html-javascript/

  • @chikeziechinonso4671
    @chikeziechinonso467110 ай бұрын

    Amazing

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Thanks

  • @JordanPCox
    @JordanPCox6 ай бұрын

    Thanks for doing this, love your work! I'm having a similar issue as others have shared with the API key I generated not working. From what I can gather, you have to subscribe to an OpenAI pricing plan in order to generate an API key as the free one is designated as a test key. Are you able to confirm if this is correct? Much appreciated!

  • @Jihad313m
    @Jihad313m7 ай бұрын

    Thank you very much, but I have a question: how can I run dall.e3 in this same project

  • @suriyar9462
    @suriyar94626 ай бұрын

    This nice working perfectly and I want be like ai quiz generator website plz create the video for this website 🙏🏻

  • @darky8772

    @darky8772

    6 ай бұрын

    How can this work if all users get a message about an incorrect api key when they click the generation button?

  • @reallife1482
    @reallife148210 ай бұрын

    Thank you so much 🥰❣️❣️❣️

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    You are so welcome

  • @siddhantgupta11
    @siddhantgupta112 ай бұрын

    This is Disgusting completed the project as it is but getting the same error as mostly people mentioned here, tried other apis like gemini etc but not working😢😢😢😢

  • @CodingNepal

    @CodingNepal

    2 ай бұрын

    It seems OpenAI no longer provides free credits for API usage. The minimum cost to get started is now $5. Once the payment is made, this project should work as expected.

  • @battlegroundgaming411
    @battlegroundgaming4114 ай бұрын

    can you make same project using hugging face

  • @gbgb1
    @gbgb18 ай бұрын

    hey codingnepal tou can post payment method strip steb by step? how i can install npx init in Visual code idk

  • @CC-1.
    @CC-1.10 ай бұрын

    First

  • @arnoldfouenang5228
    @arnoldfouenang52288 ай бұрын

    i followed the tutorial but my code is not working "{ "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } }" I've been stuck here since this morning, I can't move forward. Could I have a solution?

  • @sauravsharma5999

    @sauravsharma5999

    8 ай бұрын

    yes got the same error! please tell if you have solved this😓

  • @ascodes3461

    @ascodes3461

    8 ай бұрын

    use the word headers instead of header

  • @arthuralves515

    @arthuralves515

    8 ай бұрын

    Did you manage to fix it?

  • @46_princesharma61

    @46_princesharma61

    8 ай бұрын

    Yeah I have got the same error

  • @skillofficialentertainment

    @skillofficialentertainment

    3 ай бұрын

    Do you have this code? pls give me! Thanks bro very much!

  • @mahin_2_23
    @mahin_2_2310 ай бұрын

    Please create a professional video editing app

  • @sathishkumar-lf4br
    @sathishkumar-lf4br2 ай бұрын

    How to add a chatbot in my website at bottom pls tell mee 🙏

  • @VedantBilaiya
    @VedantBilaiya10 ай бұрын

    First 🥇 Please pin because it is going to viral 😊

  • @shivratanmarothiya2135

    @shivratanmarothiya2135

    6 күн бұрын

    nah

  • @minionsgaming5164
    @minionsgaming51646 ай бұрын

    PLease help we are getting error of API KEY i have done all correct can you check once!!

  • @siddhantgupta11

    @siddhantgupta11

    2 ай бұрын

    issue resolved??

  • @kajalaroskar1987
    @kajalaroskar19878 ай бұрын

    { "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } } please help me with this error m not able to solve this error

  • @sauravsharma5999

    @sauravsharma5999

    8 ай бұрын

    yes i am also stuck at this . please tell if you have solved this problem

  • @himanshubarapatre1335

    @himanshubarapatre1335

    8 ай бұрын

    @@sauravsharma5999 anyone solved the error ?

  • @rubenvega8454

    @rubenvega8454

    7 ай бұрын

    Anyone fix it?

  • @Nithish_kumar3

    @Nithish_kumar3

    4 ай бұрын

    We have to pay for apikey then only we can access

  • @sathishkumar-lf4br
    @sathishkumar-lf4br2 ай бұрын

    How to add my website bottom in chatbot pls give me a solution

  • @tareq06
    @tareq0624 күн бұрын

    Sir, my image is not generating. The api isn't workin perfectly. Can you guide me?

  • @kelwinanim4rt966
    @kelwinanim4rt9664 ай бұрын

    could someone borrow me a api key? i'm not getting it work

  • @bharathwajp1321

    @bharathwajp1321

    3 ай бұрын

    its paid

  • @MoviesTalk69
    @MoviesTalk698 ай бұрын

    Sir why don't u explain what code use why u use ?

  • @vasimhubli2042
    @vasimhubli20425 ай бұрын

    I added my api key, still not working.

  • @redxroomie

    @redxroomie

    5 ай бұрын

    Did you have limit in api key

  • @KhushiKumari-ff4eg
    @KhushiKumari-ff4eg6 ай бұрын

    did anyone got solution to this error { "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } }

  • @anavasconcelos7284

    @anavasconcelos7284

    5 ай бұрын

    Open ai has credit that you can use while in trial period. That means that your key is probably expired because your trial period has ended. You can pay credits to use it, but it may not be worth it since a lot of people are complaining the theres a problem with the system that checks the usage, and their keys often appear to consume the credit at an unrealisstic pace.

  • @siddhantgupta11

    @siddhantgupta11

    2 ай бұрын

    have you resolved this issue??

  • @himanshubarapatre1335
    @himanshubarapatre13358 ай бұрын

    { "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } } anyone her solved this error?

  • @ascodes3461

    @ascodes3461

    8 ай бұрын

    use the word headers instead of header

  • @arthuralves515

    @arthuralves515

    8 ай бұрын

    Did you manage to fix it?

  • @himanshubarapatre1335

    @himanshubarapatre1335

    8 ай бұрын

    can you tell where to change this@@ascodes3461

  • @rubenvega8454

    @rubenvega8454

    7 ай бұрын

    Have yo managed to fix it?

  • @sujalnarkar1942
    @sujalnarkar19429 ай бұрын

    sir they are asking for api key

  • @aaqib9413
    @aaqib9413Ай бұрын

    How to make this using pixabay API?

  • @tr99x67
    @tr99x672 ай бұрын

    at19:54 what was that mark you used??

  • @CodingNepal

    @CodingNepal

    Ай бұрын

    It's a backticks ` `

  • @batuhanbayr7613
    @batuhanbayr761310 ай бұрын

    ı followed thhe tutorial but my code is not working "{ "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } }" can somone help me please?

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    Please double-check your API call to ensure that the request method is set to POST.

  • @batuhanbayr7613

    @batuhanbayr7613

    10 ай бұрын

    @@CodingNepal type is POST

  • @chandan_mishra18

    @chandan_mishra18

    10 ай бұрын

    Same error coming in my project..can you please test your code@@CodingNepal

  • @chandan_mishra18

    @chandan_mishra18

    10 ай бұрын

    "{ "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } }"@@CodingNepal

  • @arthuralves515

    @arthuralves515

    8 ай бұрын

    Did you manage to fix it?@@chandan_mishra18

  • @lumnaire_coding
    @lumnaire_coding6 ай бұрын

    { "error": { "code": "billing_hard_limit_reached", "message": "Billing hard limit has been reached", "param": null, "type": "invalid_request_error" } } help me fix

  • @Nithish_kumar3

    @Nithish_kumar3

    4 ай бұрын

    We have to pay for apikey

  • @skillofficialentertainment
    @skillofficialentertainment3 ай бұрын

    Who has this code, pls tell me! Thanks very much!

  • @TOONSSTATION

    @TOONSSTATION

    3 ай бұрын

    Bii

  • @TOONSSTATION

    @TOONSSTATION

    3 ай бұрын

    Bio

  • @skillofficialentertainment

    @skillofficialentertainment

    3 ай бұрын

    @@TOONSSTATION what is that?

  • @TOONSSTATION

    @TOONSSTATION

    3 ай бұрын

    @@skillofficialentertainment check the description of this video it has the source code

  • @skillofficialentertainment

    @skillofficialentertainment

    3 ай бұрын

    @@TOONSSTATION i checked it pls,

  • @pritimodanwal06
    @pritimodanwal0610 ай бұрын

    Hate it , Project is not working properly. I got stuck and give 2 days still issue not resolve. Not satisfied of this project code

  • @CodingNepal

    @CodingNepal

    10 ай бұрын

    It works perfectly if you follow the steps properly. If you need source code, here it is: Here is the source code link: www.codingnepalweb.com/ai-image-generator-website-html-javascript/

  • @batuhanbayr7613

    @batuhanbayr7613

    10 ай бұрын

    no its not ı am taking this error "{ "error": { "code": null, "message": "Not allowed to GET on /v1/images/generations. (HINT: Perhaps you meant to use a different HTTP method?)", "param": null, "type": "invalid_request_error" } }" and my code is "const generateForm = document.querySelector(".generate-form"); const imageGallery = document.querySelector(".image-gallery"); const OPENAI_API_KEY = "my_key"; const updateImageCard = (imgDataArray) => { imgDataArray.forEach((imgObject, index) => { const imgCard = imageGallery.querySelectorAll(".img-card")[index]; const imgElement = imgCard.querySelector("img"); const aiGeneratedImg = `data:image/jpeg;base64,${imgObject.b64_json}`; imgElement.src = aiGeneratedImg; imgElement.onload = () => { imgCard.classList.remove("loading"); } }); } const generateAiImages = async (userPrompt, userImageQuantity) => { try{ const response = await fetch("api.openai.com/v1/images/generations",{ method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${OPENAI_API_KEY}`, }, body: JSON.stringify({ prompt: userPrompt, n: parseInt(userImageQuantity), size: "512x512", response_format: "b64_json" }) }); if(!response.ok) throw new Error("Failed to generate images! Please try again."); const { data } = await response.json(); updateImageCard([...data]); } catch(error){ alert(error.message); } } const handleFormSubmission = (e) => { e.preventDefault(); const userPrompt = e.srcElement[0].value; const userImageQuantity = e.srcElement[1].value; const imgCardMarkup = Array.from({length: userImageQuantity}, () => ` ` ).join(""); imageGallery.innerHTML = imgCardMarkup; generateAiImages(userPrompt, userImageQuantity); } generateForm.addEventListener("submit", handleFormSubmission); "@@CodingNepal

  • @batuhanbayr7613

    @batuhanbayr7613

    10 ай бұрын

    Did u find the solution? Pleade help me

  • @siddhantgupta11

    @siddhantgupta11

    2 ай бұрын

    ​​@@CodingNepal next time please use free apis😞 I wasted so many hours but unfortunately not able to complete due to the same invalid request error405

  • @CodingNepal

    @CodingNepal

    2 ай бұрын

    @@siddhantgupta11 When I created this project, OpenAI used to give some free credits for their API usage. However, it appears that OpenAI no longer offers free credits. The minimum cost to get started is $5. Once the payment is made, the project should work as expected.

  • @ThapeloMohapi-wu9su
    @ThapeloMohapi-wu9su8 ай бұрын

    "Authorization": `Bearer ${OPENAI_API_KEY}` not working

  • @ascodes3461

    @ascodes3461

    8 ай бұрын

    use the word headers instead of header

  • @46_princesharma61

    @46_princesharma61

    8 ай бұрын

    ​@@ascodes3461bro this is not a solution

  • @user-vl9im6ck9y
    @user-vl9im6ck9y6 ай бұрын

    Have a problem with FETCH!!! error 400 "message": "Additional properties are not allowed ('promt' was unexpected)" "type": "invalid_request_error"

  • @HFrontEndMastermind

    @HFrontEndMastermind

    5 ай бұрын

    i got the same error

  • @siddhantgupta11

    @siddhantgupta11

    2 ай бұрын

    spelling of prompt

  • @moaliwindows11
    @moaliwindows1110 ай бұрын

    hi

  • @Nova_Corp_Streamy
    @Nova_Corp_Streamy8 ай бұрын

    Bonjour, j'ai tout bien fait mais ça me dit que la clé API n'est pas correct... Pouvez-vous m'aider s'il vous plait ?

  • @rubenvega8454

    @rubenvega8454

    7 ай бұрын

    You speak french in a english video and you expect someone will help you, good luck

  • @sathishkumar-lf4br
    @sathishkumar-lf4br2 ай бұрын

    How to create a free API KEY 🗝️ tell mee bro

  • @SambhavTiwari-ld9rp
    @SambhavTiwari-ld9rp5 ай бұрын

    Need valid key 🗝️

  • @jaiprakashshah7892
    @jaiprakashshah78922 ай бұрын

    need help

  • @vasimhubli2042
    @vasimhubli20425 ай бұрын

    The api is paid😢

  • @sounabhbag4879

    @sounabhbag4879

    Ай бұрын

    Isn't there is any free version?

Келесі