Socket
Book a DemoInstallSign in
Socket

node-replicate

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-replicate

A Node.js client for Replicate.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

node-replicate

A Node.js client for Replicate.

import replicate from "node-replicate"
const model = "owner/model:version"
const input = { prompt: "an astronaut riding on a horse" }

await replicate.run(model, input)

Introduction

Replicate is an online platform for running machine learning models in the cloud. This package implements a lightweight client for their anonymous API, allowing you to run Stable Diffusion, Whisper and other cutting-edge models in just a few lines of code 😄🤏.

Features

  • Anonymous API 👻.
  • Lightweight - only 30 lines of code 🔥.

Installation

Install with npm.

npm i node-replicate

Usage

To run a model, just pass its identifier and prediction parameters to replicate.run().

const model = "owner/model:version"
const input = { prompt: "an astronaut riding on a horse" }

await replicate.run(model, input)

You can also monitor pending predictions with replicate.create().

let prediction = await replicate.create(model, input)

prediction = await replicate.get(prediction)

Once the prediction has succeeded, prediction.status will be set to "succeeded".

Contributing

Have a feature you'd like to see added? Create a pull request or open an issue.

Keywords

ai

FAQs

Package last updated on 26 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts