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

@pi-unipi/image

v2.2.5

Published

Image generation and image recognition tools for the Pi coding agent

Downloads

743

Readme

@pi-unipi/image

Image generation and image recognition tools for the agent.

Tools

| Tool | Description | |------|-------------| | image_generate | Generate an image from a text prompt. Returned inline and saved to disk. | | image_recognize | Analyze an image with a vision model. Accepts a file path, data: URL, or base64. |

Commands

| Command | Description | |---------|-------------| | /unipi:image-settings | Configure models, output directory and the recognition system prompt |

image_generate

image_generate(prompt: "A cutaway diagram of a submarine, technical illustration")
image_generate(prompt: "...", model: "flux.2-pro")

Models come from two places, merged into one list:

  • pi-ai's built-in image catalog — 34 models including FLUX.2, Gemini 3 Pro Image, GPT-5 Image, Recraft and Riverflow — served through OpenRouter (get a key).
  • Any provider registered by another extension. Third-party providers publish no image metadata, so these are detected by name; a real registry with 393 models contributed 12 generators (FLUX, Nano Banana, Ideogram, Recraft, Seedream, Stable Diffusion) alongside the built-ins.

Because that detection is heuristic, the picker has a custom entry — press c in /unipi:image-settings and type any provider/model-id. A well-formed reference is always accepted, even when the catalog has never heard of it, so no model is ever unreachable.

The model parameter is fuzzy-matched, so flux, recraft and gemini-3-pro all work. Omit it to use the model chosen in /unipi:image-settings.

Images are returned inline and written to ~/.unipi/images by default; the saved path is reported back to the agent. A failed write never discards a successfully generated image.

image_recognize

image_recognize(image: "./screenshot.png")
image_recognize(image: "./error.png", prompt: "What does the stack trace say?")

Uses any chat model whose input modality includes image. A model that cannot accept images is rejected up front with a clear message rather than failing inside the provider.

Input can be a local file path, a data: URL, or raw base64. The media type is detected from the file's magic numbers, so a .jpg that is really a PNG still works. Supported: PNG, JPEG, GIF, WebP. Remote URLs are not fetched.

Prefer file paths — inlining base64 into the conversation is far more expensive in tokens.

Configuration

~/.unipi/config/image/config.json:

{
  "generate": {
    "enabled": true,
    "model": "openrouter/google/gemini-3-pro-image",
    "outputDir": "~/.unipi/images",
    "saveToDisk": true
  },
  "recognize": {
    "enabled": true,
    "model": "",
    "systemPrompt": "You are a precise image analyst…"
  }
}
  • recognize.model empty means "use the session's current model".
  • The system prompt is fully customizable, and can be overridden per call.
  • Enabling or disabling a tool takes effect next session, since tools are registered at startup.
  • Every read falls back to defaults, so a corrupt config never breaks the tools.

Set UNIPI_IMAGE_CONFIG_DIR to relocate the config directory (used by tests).