Загрузка видео...

Не удалось загрузить видео

На главную

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

Фото профиля Mckay Wrigley
Mckay Wrigley1 год назад

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
Mckay Wrigley1 год назад

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
Luis C1 год назад

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

Фото профиля Mckay Wrigley
Mckay Wrigley1 год назад

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

Фото профиля Ray Fernando
Ray Fernando1 год назад

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

Фото профиля Mckay Wrigley
Mckay Wrigley1 год назад

This is a bangers only zone I promise

Фото профиля Andrei
Andrei1 год назад

@lucataco93 Even my mom could compete with @levelsio nowadays

Фото профиля Mckay Wrigley
Mckay Wrigley1 год назад

@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
papadking1 год назад

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

Фото профиля Mckay Wrigley
Mckay Wrigley1 год назад

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

Похожие видео