Downloads · 30 days
0
aislamov/stable-diffusion-2-1-base-onnx
stable-diffusion-2-1-base-onnx is a machine learning model from aislamov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
StableDiffusion 2.1 converted to fp16 ONNX model to run GPU accelerated NodeJS code https://github.com/dakenf/stable-diffusion-nodejs
Downloads · 30 days
0
Access
Public
Updated Nov 7, 2023
Repo size
10.8 GB
Likes
5
Public
Click a slice to open those files.
.onnx2.6 GB · 96%
From the Hugging Face model README
StableDiffusion 2.1 converted to fp16 ONNX model to run GPU accelerated NodeJS code https://github.com/dakenf/stable-diffusion-nodejs
import * as tf from "@tensorflow/tfjs-node"
import { StableDiffusionPipeline } from 'stable-diffusion-nodejs'
const pipe = await StableDiffusionPipeline.fromPretrained(
'directml', // can be 'cuda' on linux or 'cpu' on mac os
'aislamov/stable-diffusion-2-1-onnx', // relative path or huggingface repo with onnx model
)
const image = await pipe.run("A photo of a cat", undefined, 1, 9, 30)
const png = await tf.node.encodePng(image[0])
fs.writeFileSync("output.png", png);