Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a stable diffusion xs + ControlNet pipeline #1102

Open
2 tasks done
lsb opened this issue Dec 18, 2024 · 0 comments
Open
2 tasks done

Add a stable diffusion xs + ControlNet pipeline #1102

lsb opened this issue Dec 18, 2024 · 0 comments
Labels
new pipeline Request a new pipeline

Comments

@lsb
Copy link
Contributor

lsb commented Dec 18, 2024

Pipeline description

I have a Stable Diffusion XS + ControlNet model that can compile to an ONNX model and run inference in WebGPU in a few hundred milliseconds in Chrome on a M1 Studio and in Chrome on a 4090.

In compiling this to an ONNX model, I’ve taken advantage of the fact that there’s only one step, so the scheduler phase and the time embedding compiled down to a constant. Further, the UNet + ControlNet + VAE model compresses down to 430MB for fast load times.

Is this sort of text to image synthesis model something that would be useful to add to a pipeline in Transformers.js? I’m open to collaborate on how best to refactor the monolithic ONNX artifact into something that makes sense for the existing code structure

Prerequisites

  • The pipeline is supported in Transformers (i.e., listed here)
  • The task is listed here

Additional information

Export script (requires a hot patched diffusers library!): https://github.com/lsb/sdxs-controlnet-sketch/blob/trunk/export-sdxs-512.py

Feel free to check out the repository that that’s in, or go to the linked blog post in that readme

Your contribution

Open to suggestions!

@lsb lsb added the new pipeline Request a new pipeline label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new pipeline Request a new pipeline
Projects
None yet
Development

No branches or pull requests

1 participant