How to Create AI-Generated Images Using Your Prompts

How to Create AI-Generated Images Using Your Prompts

AI is smart enough to guess and generate images based on your prompt. It's more like creating digital art for various purposes.

The world has seen a growth in AI tools, and many exist today because of their ability to create and innovate in the form of text, images, songs, and videos. These tools boost your creativity, making it suitable for all professionals, no matter your technical prowess or ability. Creating an input (prompt) is possible, and the tool generates an output.

Easy-peasy right?

PromptPic is a photo-sharing community application that helps bring your idea to life through textual descriptions. The OpenAI DALL-E AI model generates a thoughtful image that allows you to share eye-catching visuals or generate another if you are unsatisfied with the output.

In this guide, we will go through the concept of choosing this idea, and how it can solve a need in the creative space, coupled with the fact that the app packs a lot of features like creating, sharing, and saving your generated image art with a click of a button for any use case, you can think of.

Try PromptPic LIVE.

Let's delve into the details.

Identifying the challenge

The central message is to identify the gaps that other tools present to creatives like marketers, artists, and so on, which may arise due to the complex nature of the interfaces that present a barrier to using these platforms or tools. With PromptPic, you have an enjoyable experience with the ease of use of the app, and seeing what others have created gives you a sense of belonging of adapting their creations into your workflow with proper user management and cloud storage using Cloudinary as the digital asset manager.

How PromptPic works

By leveraging Next.js and Node.js, we aim to assure users that their creations are securely stored in a database using the Xata architecture. The stored data from the backend uses Prisma as a connection to interact with the data and make the details visible for everyone to see on the app home page, with or without authentication with Clerk. And without creating an account, you can't share art with the community.

If you create a new post to share and one of the details is missing, like the input field (name or the prompt), a pop-up appears notifying the user to complete the blank fields. Once completed and shared with the community with the click of the button "Share with the community," Cloudinary kicks into action to store the image and the URL from the picture, the name of the user, and the prompt goes into storage in Xata.

Tech stack

The following technologies were essential in building this product:

Backend development: For the server code, integrate Xata into the Express app, a serverless database for data storage, and Prisma, an ORM (object-relational mapping) for interacting and connecting with the database. For OpenAI, the DALL-E AI is used to help generate images from text.

Frontend development: Next.js is used to build the UI, integrate Clerk for authentication, and protect routes to prevent unauthorized access from unsigned users.

Deployment: The two web tools for making the app public are Render and Vercel.

Features of the app

  • Turn texts into an image using the DALL-E model

  • Pick a random prompt when you click the "Surprise me" button, which fills in the text from the database, or better still, craft one yourself

  • Toast notification

  • Support configuration through environment variables

  • Search functionality that filters results based on the search term

  • Redirect the user to the home route upon logout

PromptPic - generated image gallery

PromptPic URL: https://imagen-pearl.vercel.app/

Server code: https://github.com/terieyenike/imagen-server

GitHub repo: https://github.com/Terieyenike/imagen-pxcc-client

API: https://imagen-backend.onrender.com/api/v1/post

Conclusion

The union between or combination of all these technologies helps developers build reliable, secure, and dynamic full-stack applications.

I'm excited about the potential for a product like this to become a SaaS offering. With user-generated images and token access, the possibilities are endless.

Kindly share your experience using this app and suggestions!

Learn more

Check the following guide to help you build a full-stack application: