Downloads · 30 days
0
ClashSAN/miniSD-quantized-onnx
miniSD-quantized-onnx is a machine learning model from ClashSAN. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Feb 1, 2023
Repo size
1.4 GB
Likes
2
Public
Click a slice to open those files.
.data861 MB · 62%
From the Hugging Face model README

from diffusers import StableDiffusionOnnxPipeline
import torch
from diffusers import (
DDPMScheduler,
DDIMScheduler,
PNDMScheduler,
LMSDiscreteScheduler,
EulerDiscreteScheduler,
EulerAncestralDiscreteScheduler,
DPMSolverMultistepScheduler
)
scheduler = DPMSolverMultistepScheduler.from_pretrained("./model", subfolder="scheduler")
pipe = StableDiffusionOnnxPipeline.from_pretrained(
'./model',
custom_pipeline="lpw_stable_diffusion_onnx",
revision="onnx",
scheduler=scheduler,
safety_checker=None,
provider="CPUExecutionProvider"
)
prompt = "a photo of "
neg_prompt = ""
generator = torch.Generator(device="cpu").manual_seed(1)
image = pipe.text2img(prompt,negative_prompt=neg_prompt, num_inference_steps=8, width=192, height=256, guidance_scale=10, generator=generator, max_embeddings_multiples=3).images[0]
image.save('./test.png')