Loading video...

Video Failed to Load

Go Home

Let’s make an AI photo generator app with Cursor in 7min. Just give Cursor Composer a prompt file and the AI will write 100% of the code. AI is making it so that *anyone* can start building software today. Full prompt below.

426,678 views • 1 year ago •via X (Twitter)

10 Comments

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

PASTE THIS PROMPT IN A ` file --- # Flux with Replicate Documentation Use this guide to setup generating images with Flux and Replicate. Write the complete code for every step. Do not get lazy. Write everything that is needed. Your goal is to completely finish the feature. ## Helpful Links - [Replicate]( - [Flux Schnell]( ## Required Environment Variables Make sure the user has the following environment variables set: - REPLICATE_API_TOKEN= ## Install Replicate Make sure the user has the Replicate package installed: ```bash npm install replicate ``` ## Setup Steps ### Create a Replicate Client This file should go in `/lib/replicate.ts` ```ts import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN }); ``` ### Create a Server Action This file should go in `/actions/replicate-actions.ts` ```ts "use server"; import replicate from "@/lib/replicate"; export async function generateFluxImage(prompt: string) { const input = { prompt: prompt, num_outputs: 1, aspect_ratio: "1:1", output_format: "webp", output_quality: 80 }; const output = await { input }); return output; } ``` ### Build the Frontend This file should go in `/app/flux/page.tsx`. - Create a form that takes a prompt - Create a button that calls the server action - Have a nice ui for when the image is blank or loading - Display the image that is returned - Have a button to generate a new image - Have a button to download the image

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

Reminder! This next week at we’re doing app week. Every day we’ll be building a new full-stack app with frontend, database, authentication, payments, and more. We will have projects for both beginners and experienced devs. Come learn to build with AI!

Luis C's profile picture
Luis C1 year ago

Awesome workflow! I completely agree, anyone can start building today. All you need is @cursor_ai and a @replicate API 🤗

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

@cursor_ai @replicate Replicate out here changing lives. You guys are amazing! :)

Ray Fernando's profile picture
Ray Fernando1 year ago

Bro you are coming in with nothing but bangers. LFG!!

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

This is a bangers only zone I promise

Andrei's profile picture
Andrei1 year ago

@lucataco93 Even my mom could compete with @levelsio nowadays

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

@lucataco93 @levelsio And I bet nobody in the world would be happier to see your mom succeed as an indie hacker than @levelsio himself! Awesome dude.

papadking's profile picture
papadking1 year ago

This is awesome. Feels like there is a bigger gap in learning deployment than writing code now lol

Mckay Wrigley's profile picture
Mckay Wrigley1 year ago

100%! It’s the top problem I see nowadays. Great sign, but we gotta fix that

Related Videos