Full access is free during Beta. A paid subscription will be offered after Beta.

Replicate — User Guide

Run open models in the cloud.

Visit website
Freemium
Strengths
  • No need to configure the GPU environment, call the API directly
  • Supports thousands of open source models (images, videos, audios, text)
  • Pay as you go, no minimum spend
  • Can deploy your own models for others to use
  • Python/JavaScript SDK is easy to use
Best for
  • Quickly call image generation models such as Stable Diffusion and FLUX
  • Run computationally intensive models such as video generation and audio processing
  • AI functional testing during prototype development phase
  • Deploy and share your trained models
  • Run open source models without a GPU

Quickly call image generation model

The most common use of Replicate is to invoke image generation models without requiring a local GPU.

Scenario

Call FLUX to generate images

Prompt example
import replicate

# Set API Token (obtained from replicate.com/account)
# export REPLICATE_API_TOKEN=your-token

output = replicate.run(
    "black-forest-labs/flux-schnell",
    input={
        "prompt": "A serene Japanese garden with cherry blossoms, "
                  "traditional stone lantern, photorealistic",
        "num_outputs": 1,
        "aspect_ratio": "16:9",
        "output_format": "webp",
        "output_quality": 90
    }
)

# output is a list of image URLs
print(output[0]) #Print image URL

# Download image
import requests
img_data = requests.get(output[0]).content
with open("output.webp", "wb") as f:
    f.write(img_data)
Output / what to expect
Generate high-quality images in seconds, Returns a temporary URL, FLUX Schnell is one of the fastest high-quality image generation models available.
Tips

FLUX Schnell is fast but slightly lower quality, FLUX Dev is higher quality but slower, choose based on your needs.

Scenario

Call the video generation model

Prompt example
import replicate

output = replicate.run(
    "minimax/video-01",
    input={
        "prompt": "A butterfly landing on a flower, "
                  "macro photography, slow motion",
        "duration": 5,
    }
)

# Video generation takes a long time
print(output) # Return video URL
Output / what to expect
Generate 5 seconds of high-quality video, The generation time is about 2-5 minutes, Returns the downloadable video URL.
Tips

Video generation takes longer than image generation, so it is recommended to use asynchronous calling.

Starter & above

The rest of this guide

Additional scenarios and the full comparison table are included with Starter and above. Sign in with an eligible account to load them.

You're on the Free plan. Upgrade to Starter or higher to unlock the rest of this guide—additional scenarios and the full comparison table.

Loading full guide…