releases.shpreview

2.8.0

$npx -y @buildinternet/releases show rel_ta6lfmm7-LGR8f3kxrM65

What's new?

๐Ÿ–ผ๏ธ New task: Image-to-image

This release adds support for image-to-image translation (e.g., super-resolution) with Swin2SR models.

Side-by-side (full)Animated (zoomed)
side-by-sideanimated-comparison

As always, you can get started in just a few lines of code!

import { pipeline } from '@xenova/transformers';

let url = 'https://huggingface.co/spaces/jjourney1125/swin2sr/resolve/main/testsets/real-inputs/0855.jpg';
let upscaler = await pipeline('image-to-image', 'Xenova/swin2SR-compressed-sr-x4-48');
let output = await upscaler(url);
// RawImage {
//   data: Uint8Array(12582912) [165, 166, 163, ...],
//   width: 2048,
//   height: 2048,
//   channels: 3
// }

๐Ÿ’ป New architectures: TrOCR, Swin2SR, Mistral, and Falcon

We also added support for 4 new architectures, bringing the total up to 57! ๐Ÿคฏ

  • TrOCR for optical character recognition (OCR).

    import { pipeline } from '@xenova/transformers';
    
    let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/handwriting.jpg';
    let captioner = await pipeline('image-to-text', 'Xenova/trocr-small-handwritten');
    let output = await captioner(url);
    // [{ generated_text: 'Mr. Brown commented icily.' }]

    image

    Added in https://github.com/xenova/transformers.js/pull/375. See here for the list of available models.

  • Swin2SR for super-resolution and image restoration.

    import { pipeline } from '@xenova/transformers';
    
    let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/butterfly.jpg';
    let upscaler = await pipeline('image-to-image', 'Xenova/swin2SR-classical-sr-x2-64');
    let output = await upscaler(url);
    // RawImage {
    //   data: Uint8Array(786432) [ 41, 31, 24,  43, ... ],
    //   width: 512,
    //   height: 512,
    //   channels: 3
    // }

    Added in https://github.com/xenova/transformers.js/pull/381. See here for the list of available models.

  • Mistral and Falcon for text-generation. Added in https://github.com/xenova/transformers.js/pull/379. Note: Other than testing models, we haven't yet converted any of the larger (โ‰ฅ7B parameter) models. Stay tuned for more updates on this!

๐Ÿ› Bug fixes:

๐Ÿ”จ Minor improvements:

๐Ÿค— New Contributors

Full Changelog: https://github.com/xenova/transformers.js/compare/2.7.0...2.8.0

Fetched April 7, 2026