GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - softwiredtech/stable-diffusion-webgpu: A WebGPU port of Stable Diffusion using tinygrad

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
bpe_simple_vocab_16e6.mjs
bpe_simple_vocab_16e6.mjs
 
 
clip_tokenizer.js
clip_tokenizer.js
 
 
index.html
index.html
 
 
net.js
net.js
 
 

Repository files navigation

Stable Diffusion on tinygrad WebGPU

NOTE: This is an outdated model export, please try these instead:

  • new f32 version (~10% faster): https://github.com/wpmed92/stable-diffusion-wgpu-tinygrad
  • f16 version (~40% faster): https://github.com/wpmed92/stable-diffusion-tinygrad-f16

This is a WebGPU port of Stable Diffusion in tinygrad.
Try it out here!
The python code I wrote to compile and export the model can be found here

How it works

The Stable Diffusion model is exported in three parts:

  • textModel
  • diffusor
  • decoder

If you open net.js you can see all the WebGPU kernels that are involved in the inference.
When you open the page for the first time, the model will be downloaded from huggingface in tinygrad's safetensor format. The model is in f16 to optimize download speed.
Since the computation is done in f32 in the model, and since shader-f16 is not yet supported in production Chrome, the model is decompressed to f32 using f16-to-f32-gpu WebGPU-based f16 decompression library.
When you open the site a second time, the model will be loaded from the IndexedDB cache into which it was saved on first visit. If you have a full cache hit, the model will be decompressed, compiled and ready to use. If you have a cache miss (usually due to QuotaExceededError), the model will be redownloaded.

License

MIT

About

A WebGPU port of Stable Diffusion using tinygrad

Topics

aistable-diffusiontinygradwebgpu

Resources

Readme
MIT license
Activity
Custom properties

Stars

36 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.