News for hackers. Stuff that matters.
Re:Running Stable Diffusion fully in browser with WebGPU by crowwork on Wednesday March 08, 2023 @01:33PM (#35072892)
This project brings stable diffusion models to web browsers. Everything runs inside the browser with no server support. Please check out our GitHub repo to see how we did it. There is also a demo which you can try out.
Re:Running Stable Diffusion fully in browser with WebGPU by sberens on Wednesday March 08, 2023 @02:01PM (#35073281)
> As WebGPU does not support FP16 at this moment, the memory consumption of running the demo is about 7GB. For Apple silicon Mac with only 8GB of unified memory, it may take longer (a few minutes) to generate an image. This demo may also work for Mac with AMD GPU.

Ouch. It will be interesting what this number will look like in 2-3 years though.

Re:Running Stable Diffusion fully in browser with WebGPU by crowwork on Wednesday March 08, 2023 @02:02PM (#35073292)
on apple M2max, it takes 20sec, and with the fp16 support, there will be opportunities for improvement likely soon this eyar
Re:Running Stable Diffusion fully in browser with WebGPU by sberens on Wednesday March 08, 2023 @02:04PM (#35073323)
I'm looking forward to an OpenAI quality embedding that I can use locally. I think eliminating the latency/cost from calling their API will allow for some novel UX patterns.
Re:Running Stable Diffusion fully in browser with WebGPU by crowwork on Wednesday March 08, 2023 @02:05PM (#35073330)
The current demo uses CLIP model from openai, which is likely what you are looking for
Re:Running Stable Diffusion fully in browser with WebGPU by sberens on Wednesday March 08, 2023 @02:16PM (#35073459)
Oops I meant text embeddings
Re:Running Stable Diffusion fully in browser with WebGPU by spectrometerHBH on Wednesday March 08, 2023 @02:04PM (#35073324)
50s per image, 16'' M1 pro 16G mbp, amazing!
Re:Running Stable Diffusion fully in browser with WebGPU by cyx6 on Wednesday March 08, 2023 @02:06PM (#35073340)
This is an AMAZING work! Just type in one line description and click, I get a photo by stable diffusion on my macbook in minutes. And it never needs any setup, just having fun. :)
Re:Running Stable Diffusion fully in browser with WebGPU by l3jin on Wednesday March 08, 2023 @02:09PM (#35073369)
Cooool! We can use Stable Diffusion models on chrome.

It can generate any image I want within 2mins:)

Re:Running Stable Diffusion fully in browser with WebGPU by jinhongyii on Wednesday March 08, 2023 @02:14PM (#35073435)
Great work! It's exciting to see such a large model running on my local web browser.
Re:Running Stable Diffusion fully in browser with WebGPU by junrushao1994 on Wednesday March 08, 2023 @02:17PM (#35073461)
This actually works on my non-M1/M2 macbook with AMD GPUs pretty smoothly. It's a bit slow for now (~70sec), but I expect this to be faster with fp16. Any roadmap to support fp16 on WebGPUs?
Re:Running Stable Diffusion fully in browser with WebGPU by crowwork on Wednesday March 08, 2023 @02:19PM (#35073486)
FP16 is already in the spec and hopefully will ship this year we believe
Re:Running Stable Diffusion fully in browser with WebGPU by ziheng on Wednesday March 08, 2023 @02:17PM (#35073469)
Cool project. The main point I guess is this doesn't require user to do any environment setup. All your need to do is just run it in the browser.

One thing I am curious, how's the performance of WebGPU approach compared to the local server approach?

Re:Running Stable Diffusion fully in browser with WebGPU by crowwork on Wednesday March 08, 2023 @02:18PM (#35073481)
On the current setup(M2 and metal), it should run as fast as the local native environment.
Re:Running Stable Diffusion fully in browser with WebGPU by zxybazh on Wednesday March 08, 2023 @02:36PM (#35073707)
Very cool demo, got it working on M1 macbook, generates each pic in 140s. Fun experience without specific setup.

Does it also work for cuda device? Is there any plan to support other models soon?

Re:Running Stable Diffusion fully in browser with WebGPU by misakamisuzu on Wednesday March 08, 2023 @03:01PM (#35073998)
Really impressive! Very smooth experience on chrome.
Re:Running Stable Diffusion fully in browser with WebGPU by yongwww on Wednesday March 08, 2023 @03:28PM (#35074313)
Great project! It is able to run on my local Mac M2, the generated result looks good to me! Looking forward to seeing more models are enabled
Re:Running Stable Diffusion fully in browser with WebGPU by wuweil on Wednesday March 08, 2023 @08:05PM (#35077063)
super cool! it also works on my MacBook with AMD GPU. this is a great demonstration of the power of web GPU