Building a Text to Image App USING AI! [OpenAI DALLE 2 API]

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 31

  • @foundrysmith1
    @foundrysmith1 2 года назад +1

    Great video! Exactly what I was looking for. Looking forward to what comes next

    • @borismeinardus
      @borismeinardus  2 года назад

      Thanks!! I hope my future content will not disappoint you ☺️

    • @foundrysmith1
      @foundrysmith1 2 года назад +1

      @@borismeinardus I have had a lot of fun getting your program to work on my Windows 10 computer. I did have to roll back the current customtkinter-5.0.03 version to customtkinter-4.6.3 to generate the image. Otherwise I was getting a "TypeError: __init__() missing 1 required positional argument" on line 21 (wanted a 'master' definition). But with the older version, the "magic" works!
      Still not able to save the generated image, I tried rolling back Pillow to 9.2.0 from 9.4.0 with no success. I am hoping you may have a suggestion, here is the error message I receive:
      Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
      = RESTART: C:\Users\dalleapp\app.py
      Image created for prompt: blue dogs and red chickens chase fish upstream to waterfall
      Exception in Tkinter callback
      Traceback (most recent call last):
      File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1948, in __call__
      return self.func(*args)
      ^^^^^^^^^^^^^^^^
      File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\customtkinter\widgets\ctk_button.py", line 377, in clicked
      self.command()
      File "C:\Users\dalleapp\app.py", line 48, in save_image
      img.save(f"img/{prompt}.png")
      File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL\Image.py", line 2428, in save
      fp = builtins.open(filename, "w+b")
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      FileNotFoundError: [Errno 2] No such file or directory: 'img/blue_dogs_and_red_chickens_chase_fish_upstream_to_waterfall.png'

  • @oreki4081
    @oreki4081 2 года назад +1

    This video is very very very fantastic and I started interesting in AI fields because of your channel videos. Right now, I just started Python programming Day 1 from today. I promise I will try this as soon as I understand the python. I will try this one again.
    Thank you very much for this extraordinary video. I hope to see something like this more in your future videos. and also can you make a video of machine learning project like this one. please! 😊

    • @borismeinardus
      @borismeinardus  2 года назад +2

      I‘m really happy to hear that!
      Enjoy the ride, I‘m sure you‘ll do great if you stick to it 😊
      I‘ll do my best 🫡 :)

  • @leokonto6860
    @leokonto6860 2 года назад

    You’re the reason I keep going bro you’re my inspiration ❤

  • @startmusicworld666
    @startmusicworld666 2 года назад

    promt_input = ctk.CTkEntry(
    TypeError: CTkEntry.__init__() missing 1 required positional argument: 'master' can i know what it is?

    • @borismeinardus
      @borismeinardus  2 года назад

      you perhaps need to provide the root CTK element as the ‚master‘ argument

    • @startmusicworld666
      @startmusicworld666 2 года назад

      @@borismeinardus I have provided in this format ""master=root_CTk"" but it doesn't work any alternative format I need to give can you suggest!

    • @samuelannapureddy8640
      @samuelannapureddy8640 Год назад

      provide master = None

  • @SNxZoRRo
    @SNxZoRRo Год назад

    how i can generate the auth_token ?
    🙂🙂

    • @borismeinardus
      @borismeinardus  Год назад

      You need to do that in your Browser when logged into your OpenAI account :)

  • @hmdanish2424
    @hmdanish2424 2 года назад

    Is it possible to call openai api in Android studio?

    • @borismeinardus
      @borismeinardus  2 года назад

      I‘m sadly not familiar with Android studio but I think yes :)

  • @aykanseper
    @aykanseper 2 года назад

    Thank you, this is really well explained. But I am a newbie and want to ask something:), How could I implement this on an app where user creates an item and based on their title, app provides an image. There is a training project I work on and there are already files, app works but need to add this extension, I can't figure out which file I should work on

    • @borismeinardus
      @borismeinardus  2 года назад +1

      Well, you will have a front end that can capture text and button clicks. Then you need to associate an action to a button click (like I did in the video). Where and how you implement that action (in this case the generation of the image) is up to you. You might do it in a separate file for actions or you implement micro services that you then call with a button press.
      But simply adding the one function (similar to the one in the video) should be sufficient.
      I hope this helps :)

    • @aykanseper
      @aykanseper 2 года назад

      @@borismeinardus thank you! It certainly does much more sense but we'll see if I can solve it :)). Subscribed for more, best of luck!

  • @Ogabrielhr
    @Ogabrielhr 2 года назад

    Very nice video! I have a question: Do you had to pay something to make this images? I trying to make a aplication to create Avatars, but i'm looking for alternatives for Stable Diffusion.

    • @borismeinardus
      @borismeinardus  2 года назад

      Thanks! Sounds like a cool idea! 👨🏻‍💻😊
      I didn't have to pay to make the images because I used my initial free tokens. But otherwise you would have to pay, yes :/

  • @rgb8534
    @rgb8534 2 года назад

    I am getting an error
    promt_input = ctk.CTkEntry(
    ^^^^^^^^^^^^^
    TypeError: CTkEntry.__init__() missing 1 required positional argument: 'master'

    • @borismeinardus
      @borismeinardus  2 года назад

      you might need to provide the tkinter root element.

  • @dameonjensen
    @dameonjensen 2 года назад

    code is broken

    • @borismeinardus
      @borismeinardus  2 года назад

      hmm, weird :/ In my case it works

    • @Kirabyt3
      @Kirabyt3 2 года назад

      Which error are you getting?

    • @BigDaddyRenny
      @BigDaddyRenny Год назад

      ​@@Kirabyt3 I can't install PIL and authtoken

  • @Lilxomnii
    @Lilxomnii 2 года назад

    Bro please provide your source code

    • @borismeinardus
      @borismeinardus  2 года назад

      You can find a link to the code in the video description :)

  • @AidanF-qy9fr
    @AidanF-qy9fr 2 года назад

    im getting an error
    main_image = tk.Canvas(app, width=512, height=512)
    main_image.place(x=10, y=110)
    prompt_input = ctk.CTkEntry(
    height=40,
    width=512,
    text_font=("Arial", 20),
    text_color="black:",
    fg_color="white",
    placeholder_text="Enter a prompt.",
    )
    prompt_input.place(x=10, y=10)

    • @borismeinardus
      @borismeinardus  2 года назад

      What does the error message say?
      Maybe it could be the line
      text_color="black"
      You there have a ":" after the word "black"

    • @tjhealey9544
      @tjhealey9544 2 года назад

      @@borismeinardus I am having the same problem, the error is: TypeError: __init__() missing 1 required positional argument: 'master'