Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    How to build an AI Text to Image Generator app in 7 mins | Builderkit

    blog thumbnail

    Introduction

    In this article, we'll walk you through the step-by-step process of setting up and testing an image generator app using Builderkit. By following these instructions, you will be able to create an AI-powered text-to-image generation application quickly and efficiently.

    Prerequisites

    Before we get started, ensure that you have access to either the Starter or Pro Plan of the Builderkit GitHub repository. This article assumes you have the Pro Plan access.

    Step-by-Step Setup

    Step 1: Clone the Repository

    1. Open the Documentation: Go to the Builderkit documentation and navigate to the AI apps section under image generator.
    2. Clone the Repository: Open your terminal and execute the following commands:
      cd ~/Desktop
      mkdir image-generator
      cd image-generator
      git clone <GitHub Repository URL>
      
      Replace <GitHub Repository URL> with the link to the Builderkit GitHub repository.

    Step 2: Switch Branch

    1. After cloning, open the folder using your code editor.
    2. In the terminal, run:
      git checkout image-generation
      
      This switches your local repository to the appropriate branch to use the image generator app.

    Step 3: Install Dependencies

    1. To install the necessary packages, run:
      pnpm install
      
      Note: You can also use npm if you prefer. This command installs all required libraries for your project.

    Step 4: Create Environment Variables

    1. Create an .env.local file to store your environment variables and sensitive information.
    2. Set your project URL and port:
      PROJECT_URL=http://localhost:3000
      
    3. Add any required API keys from Replica and Supabase to this file.

    Step 5: Setup Supabase

    1. You need to create a table in your Supabase database to store the image generations. Run the provided SQL script to create the image_generation table.
    2. If you don’t have a users table, also create it using the provided script in the documentation.

    Step 6: Sync Schema

    1. Sync your Supabase table schema with your local project by running:
      <sync_command_with_project_id>
      
      Replace <sync_command_with_project_id> with the appropriate command as described in the documentation.

    Step 7: Run Your Project

    1. Start your application with:
      pnpm run dev
      
    2. Your app should now be running at http://localhost:3000.

    Step 8: Create a Public URL with ngrok

    1. In the terminal, run:
      ngrok http 3000
      
    2. This command creates a public URL that you can use to receive responses from the replicate API.

    Step 9: Test the App

    1. Navigate to the public URL provided by ngrok.
    2. Start generating images by entering a prompt in the image generation app interface.
    3. The generated images can be viewed in your app's dashboard.

    Conclusion

    You have successfully set up an AI text-to-image generator app using Builderkit. The generated images are created using the Replica API, and you can explore your app to further enhance its capabilities.


    Keywords

    • Builderkit
    • AI image generator
    • Clone repository
    • Environment variables
    • Supabase
    • ngrok
    • Text to image generation

    FAQ

    Q1: What is Builderkit?
    A1: Builderkit is a platform that provides tools for building applications using AI technologies, such as text-to-image generation.

    Q2: What programming languages are required to build the app?
    A2: The app is built using tools like JavaScript and requires knowledge of Node.js and package management systems like npm or pnpm.

    Q3: Is the app hosted locally?
    A3: Yes, during development, the app runs on your local machine but can be accessed publicly using ngrok.

    Q4: Can I customize the image generation prompts?
    A4: Yes, you can enter custom prompts for image generation and explore various settings depending on your needs.

    Q5: Where can I find support for Builderkit?
    A5: You can find support and additional resources in the Builderkit documentation or community forums.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like