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

web-txt2img

v0.3.1

Published

Generate images from text prompts directly in the browser using open-weights AI models

Readme

web-txt2img

Generate images from text prompts directly in the browser using open-weights AI models. No server required - all inference runs locally using WebGPU acceleration.

Features

  • 🚀 100% browser-based - No server, API keys, or network requests for inference
  • 🎨 Multiple models - SD-Turbo (fast) and Janus-Pro-1B (quality)
  • WebGPU acceleration - Hardware-accelerated inference for fast generation
  • 🔄 Worker-based - Non-blocking UI with progress tracking and cancellation
  • 💾 Smart caching - Models cached locally after first download

Installation

npm i web-txt2img @xenova/transformers

For Janus-Pro-1B support, also install:

npm i @huggingface/transformers

Quick Start

import { Txt2ImgWorkerClient } from 'web-txt2img';

// Create worker client
const client = Txt2ImgWorkerClient.createDefault();

// Load SD-Turbo model with WebGPU
await client.load('sd-turbo', { 
  backendPreference: ['webgpu'] // WebGPU is required for reliable operation
});

// Generate image
const { promise } = client.generate({ 
  prompt: 'a cozy cabin in the woods, watercolor',
  seed: 42 
});

const result = await promise;
if (result.ok) {
  const url = URL.createObjectURL(result.blob);
  document.querySelector('img').src = url;
}

WebGPU Requirements

This library requires WebGPU support in your browser:

  • Chrome/Edge 113+ with WebGPU enabled
  • Safari Technology Preview with WebGPU feature flag
  • Firefox Nightly with WebGPU enabled

You can verify WebGPU support:

const caps = await client.detect();
if (!caps.webgpu) {
  console.error('WebGPU not supported in this browser');
}

Supported Models

  • sd-turbo - Fast single-step diffusion (512×512, ~2.3GB download)
    • Backend: WebGPU (required)
  • janus-pro-1b - Higher quality autoregressive (~2.2GB)
    • Backend: WebGPU only

Documentation

Requirements

  • Modern WebGPU-enabled browser (Chrome/Edge 113+, Safari Technology Preview, or Firefox Nightly with WebGPU)
  • GPU with WebGPU support

Note on WASM Support

While a WASM fallback exists in the API for compatibility reasons, it is experimental, untested, and not recommended for production use. This library is designed and optimized for WebGPU.

License

MIT