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

framegen

v1.4.0

Published

Real-time neural frame interpolation on raw WebGPU: hand-written WGSL kernels, 2.9 MB model, ~2 ms per generated frame on a mid-range GPU. The runtime behind the Framegen extension.

Downloads

461

Readme

framegen

Real-time neural frame interpolation on raw WebGPU - the runtime behind the Framegen extension, packaged as a library. Hand-written WGSL compute kernels, no ML framework, ~3 ms per generated frame at 720p on a mid-range GPU (RTX 4060 Ti).

Requires a browser with WebGPU and shader-f16 (Chrome 121+; Apple Silicon works).

Install

npm i framegen

The v7-small weights (2.9 MB) ship inside the package (weights/). In a bundler setup copy them from node_modules/framegen/weights/; in the browser the easiest path is the npm CDN (proper CORS, versioned, cached):

const BASE = 'https://cdn.jsdelivr.net/npm/[email protected]/weights';
const [bin, manifest] = await Promise.all([
  fetch(`${BASE}/rt_v7s.bin`).then(r => r.arrayBuffer()),
  fetch(`${BASE}/rt_v7s.json`).then(r => r.json()),
]);

(GitHub release assets do NOT send CORS headers - fetching them from a page fails. The CDN route above is the supported one.)

Interpolate between two frames

import { createRT } from 'framegen';

const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice({
  requiredFeatures: adapter.features.has('shader-f16') ? ['shader-f16'] : [],
});

// dimensions must be divisible by 16
const rt = await createRT(device, {
  w: 1280, h: 720,
  weightsBin: bin, weightsManifest: manifest,
  textureInput: true, textureOutput: true,
});

// frameA/frameB are GPUTextures (rgba8unorm, TEXTURE_BINDING);
// out is rgba8unorm with STORAGE_BINDING
rt.prepPair(frameA, frameB);   // t-free trunk, once per pair
rt.runT(0.5, out);             // one mid; call again with any t in (0,1)

prepPair + runT is the real-time path: the trunk runs once per frame pair, each additional mid costs only the small t-conditioned head - that is what makes 4x-6x factors affordable.

For one-off use (benchmarks, offline tools) there is also a buffer-mode API: rt.run(rgbaA, rgbaB, t) takes and returns Uint8Array RGBA pixels.

Squeeze the last 20%

Kernel shapes are GPU-specific. Run the autotuner once per machine and pass the result in:

import { createRT, tuneConvRB } from 'framegen';

const tune = await tuneConvRB(device, { ci: 192, co: 192, w16: 80, h16: 45 });
localStorage.setItem('fcTune', JSON.stringify(tune));
// ...next session:
const rt = await createRT(device, { ...opts, convTune: JSON.parse(localStorage.getItem('fcTune')) });

What's new in 1.1.0

  • Direct-warp flowout: the warp samples your source textures through the hardware bilinear unit instead of an internal full-res copy - less VRAM, less bandwidth, mids resampled once instead of twice (slightly sharper).
  • Occlusion-sparse refine (tfact2 weights): the refine chain runs only on tiles where the two warps disagree, scheduled entirely on the GPU via indirect dispatch. Bit-identical output on full-motion frames, up to ~4x cheaper refine on calm content. On by default; sparseRefine: false restores the dense path, refineThr tunes the sensitivity (default 0.02).
  • rt.profileT(a, b, t, outTex): per-stage GPU timings for the texture path (needs timestamp-query on the device).
  • tuneConvRB explores more workgroup shapes; pass its result as convTune exactly as before.

Example project

A complete working integration - synthetic WebGPU scene boosted in real time, raw-vs-boosted split, naive-blend comparison, honest GPU timing via timestamp queries: live at https://monzikwastaken.github.io/framegen-fps-booster/, source at https://github.com/MONZikWasTaken/framegen-fps-booster.

License

MIT. Embed it in anything, including commercial products - no strings on the code. The model weights bundled in this package are licensed separately (non-commercial - see WEIGHTS_LICENSE); for commercial weight licensing, get in touch.