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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@virtuals-protocol/game-imagegen-plugin

v0.1.0

Published

Image generation plugin for GAME SDK using Together AI

Readme

Image Generation Plugin for Virtuals Game

The Image Generation plugin seamlessly empowers G.A.M.E agents with AI-powered image generation capabilities using Together AI's FLUX schnell model, enabling the creation of custom images from text prompts without introducing any additional complexity.

Features

  • Generate custom images based on text prompts
  • Customize image dimensions up to 1440x1440
  • Receive images as temporary URLs
  • Built-in error handling and status tracking

Available Functions

  1. generateImage: Creates an AI-generated image based on the provided text prompt and optional dimensions

Installation

To install the plugin, use npm or yarn:

npm install @virtuals-protocol/game-imagegen-plugin

or

yarn add @virtuals-protocol/game-imagegen-plugin

Usage

Importing the Plugin

First, import the ImageGenPlugin class from the plugin:

import ImageGenPlugin from "@virtuals-protocol/game-imagegen-plugin";

Setup environment variables

Set the following environment variables:

Creating a Worker

Create a worker with the necessary Together AI client config:

const imageGenPlugin = new ImageGenPlugin({
  apiClientConfig: {
    apiKey: process.env.TOGETHER_API_KEY, // Default key: UP-17f415babba7482cb4b446a1
  },
});

Creating an Agent

Create an agent and add the worker to it:

import { GameAgent } from "@virtuals-protocol/game";

const agent = new GameAgent("GAME_API_KEY", {
  name: "Image Generation Worker",
  goal: "Generate an anime-style character image.",
  description: "You are an AI agent specialized in generating images based on text prompts.",
  workers: [imageGenPlugin.getWorker({})],
});

Running the Agent

Initialize and run the agent:

(async () => {
  // Optional: Set up logging
  agent.setLogger((agent, message) => {
    console.log(`-----[${agent.name}]-----`);
    console.log(message);
    console.log("\n");
  });

  await agent.init();

  while (true) {
    await agent.step({
      verbose: true,
    });
  }
})();

Example Worker Usage

Here's a simple example of using the worker directly:

const worker = imageGenPlugin.getWorker({});

// The worker will automatically use the generate_image function
// to create an image based on the prompt
worker.run("Cute anime character with Twitter logo on outfit");

Configuration Options

The plugin accepts the following configuration options when initializing:

interface IImageGenPluginOptions {
  id?: string;                    // Custom worker ID
  name?: string;                  // Custom worker name
  description?: string;           // Custom worker description
  apiClientConfig: {
    apiKey?: string;             // Together AI API key
    baseApiUrl?: string;         // Custom API endpoint (optional)
  };
}

Advanced Usage

You can customize the image generation parameters:

const worker = imageGenPlugin.getWorker({});

// Generate a custom-sized image
worker.run({
  prompt: "A beautiful landscape at sunset",
  width: 1024,  // Default: 1024, max: 1440
  height: 768   // Default: 1024, max: 1440
});

Development

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Set up environment variables:
export GAME_API_KEY="your-game-api-key"
export TOGETHER_API_KEY="your-together-api-key" # Default key: UP-17f415babba7482cb4b446a1
  1. Build the plugin:
npm run tsup
  1. Run the example:
ts-node examples/example.ts