npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-replicate

v1.0.0

Published

Node-RED node for creating image generations using Replicate.com

Readme

node-red-contrib-replicate

Node-RED Replicate Flow Example

A Node-RED node for generating images using the Replicate API. This node supports various Replicate models, including standard base models and LoRA fine-tuned models.

Prerequisites

  • Node-RED installation
  • Replicate API key (get one at replicate.com)

Installation

Manual Installation

  1. Download the Code:

    • Clone the repository or download the ZIP file from GitHub.
    git clone https://github.com/ashakoen/node-red-contrib-replicate.git
  2. Navigate to the Node-RED User Directory:

    • Typically, this is located at ~/.node-red.
    cd ~/.node-red
  3. Copy the Node Files:

    • Copy the downloaded files into the ~/.node-red directory.
  4. Install Dependencies:

    • Run the following command to install the necessary dependencies.
    npm install ./node-red-contrib-replicate
  5. Restart Node-RED:

    • Restart your Node-RED instance to load the new node.

Features

  • Support for standard Replicate models and LoRA fine-tuned models
  • Automatic parameter validation and adjustment
  • Supports image inputs via URL, file path, or base64 data
  • Comprehensive error handling and status feedback
  • Configurable output formats (webp, jpg, png)
  • Support for various model-specific parameters
  • Include config node for secure storage of Replicate API key
  • Image preview functionality inspired by node-red-contrib-image-output by @rikukissa

Usage

  1. Add your Replicate API key in the configuration node.
  2. Choose your model type (Standard or LoRA).
  3. Configure model-specific parameters.
  4. Send input via msg.payload.

Input Parameters

The node accepts parameters via the node configuration or msg.payload. Parameters in msg.payload override node configuration.

Common parameters include:

  • prompt - Text description of the desired image
  • num_outputs - Number of images to generate (1-4)
  • num_inference_steps - Number of denoising steps
  • guidance_scale - How closely to follow the prompt (0-10)
  • aspect_ratio - Image aspect ratio (e.g., "1:1", "16:9")
  • output_format - Image format ("webp", "jpg", "png")
  • seed - Random seed for reproducible results

Output

The node outputs a msg.payload object containing:

  • output - Array of generated image URLs
  • original_output - Original API response
  • logs - Generation process logs
  • metrics - Performance metrics
  • id - Prediction ID
  • status - Final status
  • created_at - Creation timestamp
  • completed_at - Completion timestamp

Example Flow

[
  {
    "id": "1ad8eec921654237",
    "type": "tab",
    "label": "Replicate",
    "disabled": false,
    "info": "",
    "env": []
  },
  {
    "id": "96bd7d88790b2536",
    "type": "inject",
    "z": "1ad8eec921654237",
    "name": "",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "topic": "",
    "payload": "{\"prompt\":\"a fast racecar\",\"num_outputs\":1,\"guidance_scale\":5,\"num_inference_steps\":35,\"model\":\"black-forest-labs/flux-dev\",\"useLoRAModel\":false,\"image\":\"\",\"mask\":\"\",\"prompt_strength\":0.8,\"format\":\"png\",\"aspect_ratio\":\"4:5\"}",
    "payloadType": "json",
    "x": 650,
    "y": 380,
    "wires": [
      [
        "34302b79787f7c6e"
      ]
    ]
  },
  {
    "id": "34302b79787f7c6e",
    "type": "replicate-node",
    "z": "1ad8eec921654237",
    "name": "",
    "replicateConfig": "de8b4314b35b9d1e",
    "modelType": "standard",
    "prompt": "",
    "model": "",
    "version": "",
    "showPreview": true,
    "previewWidth": "200",
    "x": 820,
    "y": 380,
    "wires": [
      []
    ]
  },
  {
    "id": "de8b4314b35b9d1e",
    "type": "replicate-config"
  }
]

Supported Models

Standard Models

  • FLUX Dev
  • FLUX Pro
  • FLUX Pro Ultra
  • FLUX Schnell
  • Other Replicate-compatible models

LoRA Models

  • Any LoRA fine-tuned model on Replicate

Error Handling

The node provides detailed error messages and status updates for:

  • Missing required parameters
  • Invalid parameter values
  • API errors
  • Network issues
  • Image processing errors

License

MIT

Support

For issues and feature requests, please use the GitHub issue tracker.

Contributing

Contributions are welcome! Please submit pull requests or open issues for any improvements.