Загрузка видео...
Не удалось загрузить видео
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 просмотров • 1 год назад •via X (Twitter)
Комментарии: 10

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

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!

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

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

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

This is a bangers only zone I promise

@lucataco93 Even my mom could compete with @levelsio nowadays

@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.

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

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