xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
10.86k stars 658 forks source link

[Feature request] Image-to-image (super-resolution) #138

Closed josephrocca closed 10 months ago

josephrocca commented 1 year ago

Name of the feature Image super-resolution.

Reason for request I have a web app where people can generate images using a server-side stable diffusion model, and although it'd of course be possible for me to do the upscaling on the server, it'd be handy if I could allow them to upscale using their own compute - mainly to simplify my server-side deployment/orchestration stuff.

Additional context A while ago I got SwinIR working in the browser, and IIRC it was simple to get it working with ORT Web, but it takes quite a while to initialise due to the ONNX export resulting in 40k ops for some reason. This was probably a mistake in the way I was exporting, or a weird quirk of the specific export approach that I happened to use.

Size/speed notes:

That said, there might be better models available now - according to the docs, Hugging Face Transformers supports these:

josephrocca commented 1 year ago

(Also: The above-mentioned SwinIR demo crashes my whole [Ubuntu] machine on Chrome. It didn't originally do this. Works fine on Firefox. If someone with a Windows/Mac machine could test it [after saving all your work] so I know whether to report it to the Chromium devs, that would be handy. Might just be a weird Ubuntu thing.)

xenova commented 1 year ago

We'll definitely be adding image-to-image pipelines once WebGPU is supported. 👍

josephrocca commented 11 months ago

:eyes: https://twitter.com/NielsRogge/status/1709259362143707553 :eyes: