Set up Replicate & understand how it’s used throughout the app
REPLICATE_API_TOKEN=your_replicate_api_key
app/api/replicate/sdxl/route.ts
import { replicate } from "@/lib/replicate"; // Generate response from Replicate const responseData = await replicate.run(toolConfig.aiModel, { input: { width: 768, height: 768, prompt: prompt, refine: "expert_ensemble_refiner", scheduler: "K_EULER", lora_scale: 0.6, num_outputs: 1, guidance_scale: 7.5, apply_watermark: false, high_noise_frac: 0.8, negative_prompt: negativePrompt, prompt_strength: 0.8, num_inference_steps: 25, }, }); // Get the image URL from the Replicate response const imageUrl = responseData; // Prepare the data for upload const uploadData = { imageUrl, uploadPath: toolConfig.upload.path, }; // See file for more logic