页面简介
Run open-source machine learning models with a cloud API
正文摘录
Minimax H3 Lite and Highspeed are 50% until end of yearRun AIwith an API.Run and fine-tune models. Deploy custom models. All with one line of code. Get started for freeNodePythonHTTPimport Replicate from "replicate";const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN})const model = const input = { prompt: };const [output] = await replicate.run(model, { input });console.log(output);A poolside patio at sunset with vintage lounge chairs.black-forest-labs/flux-2-proA soft armchair shaped like a peeled banana.google/nano-banana-proA woman relaxing in a french bookstore.bytedance/seedream-4A futuristic robot looking into the distance.black-forest-labs/flux-proAn abstract painting of a sunrise.black-forest-labs/flux-proWith Replicate you can Generate imagesGenerate speechGenerate musicRestore imagesCaption ImagesGenerate videos from imagesLarge Language Models (LLMs)bytedance / seedream-5-liteSeedream 5.0 lite is ByteDance's image model with built-in reasoning, example-based editing, and deep domain knowledge.3.7M runsOfficialgoogle / nano-banana-2Google's fast image generation model with conversational editing, multi-image fusion, and character consistency23.2M runsOfficialopenai / gpt-image-1.5OpenAI's latest image generation model with better instruction following and adherence to prompts16.4M runsOfficialxai / grok-imagine-imageSOTA image model from xAI7.3M runsOfficialrecraft-ai / recraft-v4-styles-pro-svgRecraft V4 Styles Pro SVG generates high-quality editable vector images that match a reusable style or attached reference images.1.1K runsOfficialrecraft-ai / recraft-v4-proRecraft's latest image generation model at ~2048px resolution. Same design taste and prompt accuracy as V4, with higher resolution for print-ready and large-scale work.26.1K runsOfficialopenai / gpt-image-2OpenAI's image generation and editing model. Create and edit images from text with close instruction following, sharp text rendering, and detailed edits.37.6M runsOfficialblack-forest-labs / flux-2-flexMax-quality image generation and editing with support for ten reference images509.4K runsOfficialThousands of models contributed by our communityAll the latest models are on Replicate. They’re not just demos — they all actually work and have production-ready APIs.AI shouldn’t be locked up inside academic papers and demos. Make it real by pushing it to Replicate.Explore modelsPush a modelanthropic / claude-fable-5.2Anthropic's model for the most demanding reasoning and long-horizon agentic work, at 20% less per token than Fable 513.7K runsOfficialopenai / gpt-image-2.6-flareOpenAI's fast image model for generating and editing images from text and image inputs. Adds a complexity setting that controls how much the model plans before it renders.100.8K runsOfficialminimax / h3-liteGenerate videos with MiniMax H3 Lite, the lower-cost version of MiniMax H3. Supports text-to-video, first- and last-frame image-to-video, and reference-based video generation at 480P or 768P.111K runsOfficialminimax / h3-highspeedGenerate videos with MiniMax H3 Highspeed, a faster version of MiniMax H3 that balances quality and speed. Supports text-to-video, first- and last-frame image-to-video, and reference-based video generation at 768P.47.2K runsOfficialanthropic / claude-opus-5.5Anthropic's Opus model for long-running agentic coding and knowledge work, at a lower price than Opus 554.5K runsOfficialgoogle / nano-banana-2.1Google's fast image generation and editing model, with sharp text rendering, multi-image editing, and up to 4K output.2.6M runsOfficialprunaai / p-video-2-pro-referencePruna's reference-to-video model, built on MiniMax H3. Generate 5 to 15 second video from a prompt plus up to 9 images, 3 videos, and 3 audio clips, with speed and cost modes.248.1K runsOfficialalibaba / wan-3Wan 3.0 generates video from a text prompt or a starting image, with cinematic motion and support for 480p, 720p, and 1080p output up to 30 seconds.101.6K runsOfficialbytedance / seedance-2.5ByteDance's flagship video model, with native audio, 30-second clips, and large sets of image, video, and audio references.457K runsOfficialinworld / realtime-tts-2Inworld's most expressive text-to-speech model, with natural-language steering, real-time latency, and support for more than 100 languages.136.3K runsOfficialopenai / gpt-image-2OpenAI's image generation and editing model. Create and edit images from text with close instruction following, sharp text rendering, and detailed edits.37.6M runsOfficialxai / grok-imagine-videoxAI's video model. Generate short videos with synchronized sound from text, animate an image, or edit a video.2.3M runsOfficialHow it worksYou can get started with any model with just one line of code. But as you do more complex things, you can fine-tune models or deploy your own custom code.Run modelsOur community has already published thousands of models that are ready to use in production. You can run these with one line of code.Explore modelsimport replicateoutput = replicate.run( "black-forest-labs/flux-dev", input={ "aspect_ratio": "1:1", "num_outputs": 1, "output_format": "jpg", "output_quality": 80, "prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic", })print(output)Fine-tune models with your own dataYou can improve models with your own data to create new models that are better suited to specific tasks.Image models like SDXL can generate images of a particular person, object, or style.Fine-tune image modelsTrain a model:training = replicate.trainings.create( destination="mattrothenberg/drone-art" version="ostris/flux-dev-lora-trainer:e440909d3512c31646ee2e0c7d6f6f4923224863a6a10c494606e79fb5844497", input={ "steps": 1000, "input_images": https://example.com/images.zip, "trigger_word": "TOK", },)This will result in a new model:mattrothenberg/drone-artFantastical images of drones on land and in the sky0 runsmattrothenberg / drone-artFantastical images of drones on land and in the sky0 runsThen, you can run it with one line of code:output = replicate.run( "mattrothenberg/drone-art:abcde1234...", input={"prompt": "a photo of TOK forming a rainbow in the sky"}),)Deploy custom modelsYou aren’t limited to the models on Replicate: you can deploy your own custom models using Cog, our open-source tool for packaging machine learning models.Cog takes care of generating an API server and deploying it on a big cluster in the cloud. We scale up and down to handle demand, and you only pay for the compute that you use.Learn moreFirst, define the environment your model runs in with cog.yaml:build: gpu: true system_packages: - "libgl1-mesa-glx" - "libglib2.0-0" python_version: "3.10" python_packages: - "torch==1.13.1"predict: "predict.py:Predictor"Next, define how predictions are run on your model with predict.py:from cog import BasePredictor, Input, Pathimport torchclass Predictor(BasePredictor): def setup(self): """Load the model into memory to make running multiple predictions efficient""" self.model = torch.load("./weights.pth") # The arguments and types the model takes as input def predict(self, image: Path = Input(description="Grayscale input image") ) -> Path: """Run a single prediction on the model""" processed_image = preprocess(image) output = self.model(processed_image) return postprocess(output)Scale on ReplicateThousands of businesses are building their AI products on Replicate. Your team can deploy an AI feature in a day and scale to millions of users, without having to be machine learning experts.Learn more about our enterprise plansAutomatic scaleIf you get a ton of traffic, Replicate scales up automatically to handle the demand. If you don't get any traffic, we scale down to zero and don't charge you a thing.CPU$0.000100/secNvidia T4 GPU$0.000225/secNvidia L40S GPU$0.000975/sec2x Nvidia L40S GPU$0.001950/secNvidia A100 (80GB) GPU$0.001400/sec8x Nvidia A100 (80GB) GPU$0.011200/secLearn more about pricingPay for what you useReplicate only bills you for how long your code is running. You don't pay for expensive GPUs when you're not using them.Forget about infrastructureDeploying machine learning models at scale is hard. If you've tried, you know. API servers, weird dependencies, enormous model weights, CUDA, GPUs, batching.Prediction throughput (requests per second)Logging & monitoringMetrics let you keep an eye on how your models are performing, and logs let you zoom in on particular predictions to debug how your model is behaving.Imagine what you can buildAutonomous RobotsZero-shot autonomous robots with open source modelsPaint with AIAn iPad app that lets you paint with AIemojis.shAI EmojisNever Gonna Give You UpVideo fine tunes on ReplicateLanguage Model CLILanguage model command line interfaceImagineAutonomous RobotsZero-shot autonomous robots with open source modelswhatyouPaint with AIAn iPad app that lets you paint with AIcanemojis.shAI EmojisNever Gonna Give You UpVideo fine tunes on Replicatebuild.Language Model CLILanguage model command line interfaceBuilding with Replicate and Cloudflare, you can wake up with an idea and watch it hit the front page of Hacker News by the time you go to bed.Get started