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

@unexposed/image-gen

v0.1.6

Published

Thin Unexposed image generation client for sealed task submission.

Readme

@unexposed/image-gen

Unexposed Image Gen

Thin Unexposed image generation client for sealed task submission.

Highlights

  • Sends only sealed prompts and source images to the Task Manager.
  • Keeps the Generation Key Pair private key out of the Task Manager request.
  • Works as a Node API or a tiny command line tool.
  • Uses Node Web Crypto: X25519, HKDF-SHA-256, and AES-256-GCM.
  • Has no runtime dependencies.

Install

npm install @unexposed/image-gen

Or run the CLI directly:

npx @unexposed/image-gen "product photo of a watch" --accessToken ux_...AIax --model flux2_dev --output ./watch.png

Usage

import { generateImage, generateImages } from "@unexposed/image-gen";

const image = await generateImage({
  accessToken: "ux_...AIax",
  prompt: "product photo of a watch",
  model: "flux2_dev",
});

await image.save("./watch.png");
for await (const result of generateImages(
  [
    { prompt: "product photo of a watch", model: "flux2_dev" },
    { prompt: "studio product photo of headphones", model: "flux2_dev" },
  ],
  { accessToken: "ux_...AIax" },
)) {
  if (result.ok) await result.image.save(`./image-${result.index}.png`);
}
unexposed-image-gen "studio product photo of a watch" --model flux2_dev --output ./watch.png --accessToken ux_...AIax
unexposed-image-gen "studio product photo of a watch" --workflow cool-workflow --source ./img1.png --accessToken ux_...AIax

API

import {
  createSealedImageGenerationTask,
  generateImage,
  generateImages,
  submitImageGenerationTask,
  submitSealedImageGenerationTask,
} from "@unexposed/image-gen";

generateImage(options) seals a prompt, submits the task, streams the Generated Image from the Generation Session, and returns a GeneratedImage. Pass accessToken, prompt, and either model or workflow. You may also pass apiUrl, source, sources, output, onProgress, or fetchImpl.

generateImages(images, options) submits a batch and returns an async iterator. Each result is either { ok: true, image } or { ok: false, error }. The SDK keeps scheduling internal and does not expose a concurrency setting.

GeneratedImage.save(path) writes the image to disk, creates parent directories, and infers the extension from the image content type.

submitSealedImageGenerationTask(options) is the lower-level task submission helper.

createSealedImageGenerationTask(options) returns { task, generationPrivateKey } without sending the task. Use this when another boundary owns submission.

submitImageGenerationTask(options) sends an already sealed task to /v1/image-generation-tasks.

CLI Options

Usage:
  unexposed-image-gen "prompt" [options]
  npx @unexposed/image-gen "prompt" --accessToken ux_...

Options:
  --accessToken <token>   Access Token for access and billing checks.
  --token <token>         Alias for --accessToken.
  --api-url <url>         Task Manager base URL. Default: https://api.unexposed.ai
  --model <model>         Image model identifier. Default: flux2_dev
  --workflow <slug>       Account-private Workflow slug.
  --source <path>         Optional source image to encrypt with the prompt.
                           Repeat for Workflows with multiple image inputs.
  --output <path>         Local output path. Not sent to the Task Manager.
  --help                  Show this help text.

Environment:
  UNEXPOSED_ACCESS_TOKEN  Access Token used when --accessToken is omitted.
  UNEXPOSED_API_URL       Task Manager URL used when --api-url is omitted.

UNEXPOSED_ACCESS_TOKEN and UNEXPOSED_API_URL can be used instead of --accessToken and --api-url.

How It Works

The client creates a one-use Generation Key Pair, seals the prompt and optional source images with a sender key, and submits only the encrypted task payload. The Task Manager receives the Access Token, model name or Workflow slug, and sealed request. It does not receive the Generation Key Pair private key or decrypted prompt/source content. The SDK sends the private key directly to the Generation Session, which streams image bytes back to the SDK.

More detail lives in docs/api.md.