
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
node-replicate
Advanced tools
A NodeJS client for Replicate.
import replicate from "node-replicate"
const prediction = await replicate
.model(
"stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
)
.predict({
prompt: "an astronaut riding on a horse",
})
console.log(prediction.output)
// [ "https://replicate.delivery/pbxt/nSREat5H54rxGJo1kk2xLLG2fpr0NBE0HBD5L0jszLoy8oSIA/out-0.png" ]
Magic!
Replicate is an online platform for running generative AI models in the cloud. This package implements a lightweight client for their anonymous API, allowing you to run Stable Diffusion, CLIP and other state-of-the-art models with only a few lines of code. Those familiar with replicate-js should feel right at home 😊👌.
Install with npm:
npm i node-replicate
Like replicate-js, this package exports model, which can be used to access a particular model on Replicate. A model's identifier consists of a path (e.g. stability-ai/stable-diffusion) and a version (e.g. db21...e5bf) separated by a colon. You can obtain this information from a model's home page on Replicate.
const model = replicate.model("stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf")
Once you've obtained a model identifier, you can run the model using predict. This method takes in one or more parameters such as prompt. The specific parameters for a model can also be found on its home page (e.g. https://replicate.com/stability-ai/stable-diffusion/api).
const prediction = await model.predict({ prompt: "an astronaut riding on a horse" })
This will return a Prediction object containing the model's output, as well as other metadata. The output is a JavaScript object, typically an array, containing one or more results depending on how you queried the model. For instance, most image synthesis models return an array of image URLs.
To track a model's progress during inference, you can specify an onUpdate callback:
const prediction = await model.predict(
{
prompt: "an astronaut riding on a horse",
}, {
onUpdate(prediction) {
console.log(prediction.status)
}
}
)
If you'd like to contribute to this package, feel free to open a pull request or open an issue for suggestions. Some features we'd like to add in future include support for file uploads and integration with the paid API.
FAQs
A Node.js client for Replicate.
The npm package node-replicate receives a total of 72 weekly downloads. As such, node-replicate popularity was classified as not popular.
We found that node-replicate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.