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

Sdílet
Vložit
  • čas přidán 25. 08. 2024

Komentáře • 118

  • @tizianopreisig3094
    @tizianopreisig3094 Před 10 měsíci +12

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

  • @gentlehandwithgreatsmile
    @gentlehandwithgreatsmile Před 6 měsíci +2

    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 Před 6 měsíci

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

    • @studypoint3338
      @studypoint3338 Před 3 měsíci

      @@meghashah269 did your error resolved

  • @Philip-philippe
    @Philip-philippe Před 3 měsíci

    wow this is the right place to learn coding

  • @CC-1.
    @CC-1. Před 11 měsíci +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

  • @Shravankumar_888
    @Shravankumar_888 Před 11 měsíci +2

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

  • @zohramanzoor3473
    @zohramanzoor3473 Před 11 měsíci +4

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

    • @CodingNepal
      @CodingNepal  Před 11 měsíci

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

  • @switchlyrics.
    @switchlyrics. Před 11 měsíci

    I always watch your tutorials

  • @ascodes3461
    @ascodes3461 Před 9 měsíci

    Thank you soo much for this amazing video 😍

  • @user-br5vo4ew3g
    @user-br5vo4ew3g Před 11 měsíci +1

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

  • @user-vj3dh6ok6o
    @user-vj3dh6ok6o Před 11 měsíci

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

  • @marginiszero
    @marginiszero Před 10 měsíci

    It is an amazing work bro ✌😍

  • @arnoldfouenang5228
    @arnoldfouenang5228 Před 9 měsíci +3

    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?

  • @alaakouki4369
    @alaakouki4369 Před 11 měsíci +4

    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 Před 4 měsíci +1

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

  • @mehdismaeili3743
    @mehdismaeili3743 Před 10 měsíci

    Excellent.

  • @mdms4549
    @mdms4549 Před 11 měsíci

    Perfect job🎉🎉🎉 thanks 😊😊😊

  • @battlegroundgaming411
    @battlegroundgaming411 Před 5 měsíci +1

    can you make same project using hugging face

  • @siddhantgupta11
    @siddhantgupta11 Před 3 měsíci +1

    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  Před 3 měsíci

      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 will work as expected.

    • @tanbiraman6138
      @tanbiraman6138 Před 15 dny

      Can you upload a tutorial for the same project using HuggingFace models instead of Open ai??​@@CodingNepal

  • @bhuvandahal421
    @bhuvandahal421 Před 11 měsíci

    wow amazing 🥰😍🤩

  • @suriyar9462
    @suriyar9462 Před 7 měsíci

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

    • @darky8772
      @darky8772 Před 7 měsíci +1

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

  • @chikeziechinonso4671
    @chikeziechinonso4671 Před 11 měsíci

    Amazing

  • @Jihad313m
    @Jihad313m Před 8 měsíci

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

  • @CC-1.
    @CC-1. Před 11 měsíci +1

    First

  • @kajalaroskar1987
    @kajalaroskar1987 Před 9 měsíci +1

    {
    "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

  • @minionsgaming5164
    @minionsgaming5164 Před 7 měsíci +1

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

  • @vasimhubli2042
    @vasimhubli2042 Před 6 měsíci +1

    I added my api key, still not working.

    • @redxroomie
      @redxroomie Před 6 měsíci +1

      Did you have limit in api key

  • @kelwinanim4rt966
    @kelwinanim4rt966 Před 5 měsíci +1

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

  • @sathishkumar-lf4br
    @sathishkumar-lf4br Před 3 měsíci

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

  • @JordanPCox
    @JordanPCox Před 7 měsíci

    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!

  • @reallife1482
    @reallife1482 Před 11 měsíci

    Thank you so much 🥰❣️❣️❣️

  • @sathishkumar-lf4br
    @sathishkumar-lf4br Před 3 měsíci

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

  • @VedantBilaiya
    @VedantBilaiya Před 11 měsíci +1

    First 🥇
    Please pin because it is going to viral 😊

  • @tareq06
    @tareq06 Před měsícem

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

    • @CodingNepal
      @CodingNepal  Před 25 dny

      OpenAI no longer provides free credits for its API. However, you can get started with just $5. Once you purchase the credits, your API key will be activated, and this AI image generator will create images based on your prompts without any issues.

  • @aaqib9413
    @aaqib9413 Před 2 měsíci

    How to make this using pixabay API?

  • @gbgb1
    @gbgb1 Před 9 měsíci

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

  • @mahin_2_23
    @mahin_2_23 Před 11 měsíci

    Please create a professional video editing app

  • @himanshubarapatre1335
    @himanshubarapatre1335 Před 9 měsíci +1

    {
    "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?

  • @aimer926
    @aimer926 Před 20 dny

    i purshased this code but isnt working in wordpress

    • @CodingNepal
      @CodingNepal  Před 20 dny

      Refer to the README file included in the downloaded zip for instructions on how to run the project. If you still encounter issues, you can message me on the Buy Me Coffee page.

  • @sujalnarkar1942
    @sujalnarkar1942 Před 10 měsíci

    sir they are asking for api key

  • @DhirajkaReview26
    @DhirajkaReview26 Před 9 měsíci

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

  • @tr99x67
    @tr99x67 Před 3 měsíci

    at19:54 what was that mark you used??

  • @computer_electronics_works
    @computer_electronics_works Před 7 měsíci

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

  • @KhushiKumari-ff4eg
    @KhushiKumari-ff4eg Před 7 měsíci

    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 Před 6 měsíci

      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 Před 3 měsíci

      have you resolved this issue??

  • @skillofficialentertainment
    @skillofficialentertainment Před 4 měsíci +1

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

  • @pritimodanwal06
    @pritimodanwal06 Před 11 měsíci

    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  Před 11 měsíci

      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 Před 11 měsíci

      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 Před 11 měsíci

      Did u find the solution? Pleade help me

    • @siddhantgupta11
      @siddhantgupta11 Před 3 měsíci

      ​​@@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  Před 3 měsíci

      @@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-wu9su Před 9 měsíci

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

  • @jaiprakashshah7892
    @jaiprakashshah7892 Před 3 měsíci

    need help

  • @user-vl9im6ck9y
    @user-vl9im6ck9y Před 7 měsíci +1

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

  • @batuhanbayr7613
    @batuhanbayr7613 Před 11 měsíci

    ı 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  Před 11 měsíci

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

    • @batuhanbayr7613
      @batuhanbayr7613 Před 11 měsíci

      @@CodingNepal type is POST

    • @chandan_mishra18
      @chandan_mishra18 Před 11 měsíci

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

    • @chandan_mishra18
      @chandan_mishra18 Před 11 měsíci +1

      "{
      "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 Před 9 měsíci

      Did you manage to fix it?@@chandan_mishra18

  • @sathishkumar-lf4br
    @sathishkumar-lf4br Před 2 měsíci

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

  • @moaliwindows11
    @moaliwindows11 Před 11 měsíci

    hi

  • @SambhavTiwari-ld9rp
    @SambhavTiwari-ld9rp Před 6 měsíci

    Need valid key 🗝️

  • @vasimhubli2042
    @vasimhubli2042 Před 6 měsíci +2

    The api is paid😢

    • @sounabhbag4879
      @sounabhbag4879 Před 2 měsíci

      Isn't there is any free version?

    • @imxmix
      @imxmix Před 17 dny

      Use hugging face models

  • @Nova_Corp_Streamy
    @Nova_Corp_Streamy Před 9 měsíci

    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 Před 8 měsíci

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