Skip to main content

What can you do with it?

The /replicate command enables you to run various AI models through the Replicate platform. You can generate images, edit images, convert text to speech, remove backgrounds, and more!

How to use it?

Basic Command Structure

/replicate [task description]

Parameters

Required:
  • authorId - The author ID of the model (e.g., google, minimax, 851-labs)
  • modelId - The model ID (e.g., gemini-2.5-flash-image, nano-banana, speech-02-turbo, background-remover)
  • input - Input parameters specific to the model
Optional:
  • version - Specific model version to use
  • file_links_expire_in_days - How long generated files remain accessible (1-7 days, defaults to 7)
  • file_links_expire_in_minutes - How long generated files remain accessible in minutes (takes precedence over days)

Response Format

The command returns:
{
  "output": [
    {
      "url": "https://generated-file-url",
      "mimeType": "image/webp or audio/wav"
    }
  ]
}
Note: All generated files are automatically saved to your “Multimedia Artifact” file store and will be accessible for the duration specified by the file_links_expire_in_days parameter.

Examples

Basic Image Generation

/replicate generate an image
authorId: google
modelId: gemini-2.5-flash-image
prompt: A modern office space with plants
output_format: png
Generates an image of an office space using Google’s Gemini 2.5 Flash Image model.

Text-to-Speech

/replicate text to speech
authorId: minimax
modelId: speech-02-turbo
text: Welcome to our automated customer service. How can I help you today?
voice_id: Friendly_Person
speed: 1.0
emotion: happy
file_links_expire_in_days: 7
Generates happy speech audio with a friendly voice that remains accessible for 7 days.

Background Removal

/replicate remove background
authorId: 851-labs
modelId: background-remover
image: https://example.com/product-photo.jpg  (or select from your files)
format: png
Removes the background from a product photo and returns a transparent PNG.

Text-Based Image Editing

/replicate edit image
authorId: google
modelId: nano-banana
prompt: Add a sunset sky background to this image
image_input: ["https://example.com/portrait.jpg"] (or select from your files)
output_format: png
Uses the premium Google Nano Banana model to edit an existing image with text instructions, providing high-quality results with improved typography generation.

Notes

Supported Content Types:
  • Images: Generate, edit, and transform images
  • Audio: Generate speech and audio processing
  • Video: NOT SUPPORTED

Model Parameters

Text-to-Speech (minimax/speech-02-turbo)

  • text (required): Text to convert to speech (max 5000 chars). Use <#x#> for pause control (0.01-99.99s)
  • pitch: Speech pitch (-12 to 12, default: 0)
  • speed: Speech speed (0.5 to 2, default: 1)
  • volume: Speech volume (0 to 10, default: 1)
  • bitrate: Bitrate (32000, 64000, 128000, 256000, default: 128000)
  • channel: Audio channels (“mono”, “stereo”, default: “mono”)
  • emotion: Speech emotion (“auto”, “neutral”, “happy”, “sad”, “angry”, “fearful”, “disgusted”, “surprised”, default: “auto”)
  • voice_id: Voice ID (default: “Wise_Woman”). Options: Wise_Woman, Friendly_Person, Inspirational_girl, Deep_Voice_Man, Calm_Woman, Casual_Guy, Lively_Girl, Patient_Man, Young_Knight, Determined_Man, Lovely_Girl, Decent_Boy, Imposing_Manner, Elegant_Man, Abbess, Sweet_Girl_2, Exuberant_Girl
  • sample_rate: Sample rate (8000, 16000, 22050, 24000, 32000, 44100, default: 32000)
  • language_boost: Language enhancement (“None”, “Automatic”, “Chinese”, “Chinese,Yue”, “English”, “Arabic”, “Russian”, “Spanish”, “French”, “Portuguese”, “German”, “Turkish”, “Dutch”, “Ukrainian”, “Vietnamese”, “Indonesian”, “Japanese”, “Italian”, “Korean”, “Thai”, “Polish”, “Romanian”, “Greek”, “Czech”, “Finnish”, “Hindi”, default: “None”)
  • english_normalization: Enable English text normalization for better number reading (boolean, default: false, slightly increases latency)

Image Generation (google/gemini-2.5-flash-image)

  • prompt (required): Prompt for generated image
  • output_format: Format of output images (“jpg”, “png”, default: “png”)

Background Removal (851-labs/background-remover)

  • image (required): Input image (URI format)
  • threshold: Threshold for hard segmentation (0.0-1.0, default: 0). If 0.0, uses soft alpha
  • reverse: If true, remove the foreground instead of the background (boolean, default: false)
  • background_type: Background type (default: “rgba”). Options: ‘rgba’, ‘map’, ‘green’, ‘white’, [R,G,B] array, ‘blur’, ‘overlay’, or path to an image
  • format: Output format (default: “png”). Examples: png, jpg

Text-Based Image Editing (google/nano-banana)

  • prompt (required): Text description of what you want to generate, or instruction on how to edit the given image
  • image_input: Optional: Array of image URLs to use as reference
  • output_format: Output format (“jpg”, “png”, default: “png”)
I