1
0
Fork 0
onnx-web/api/test-setup.py

11 lines
382 B
Python
Raw Normal View History

2023-01-05 15:44:01 +00:00
from diffusers import OnnxStableDiffusionPipeline
cfg=8
steps=22
height=512
width=512
prompt = "an astronaut eating a hamburger"
pipe = OnnxStableDiffusionPipeline.from_pretrained("../../stable_diffusion_onnx", provider="DmlExecutionProvider", safety_checker=None)
image = pipe(prompt, height, width, num_inference_steps=steps, guidance_scale=cfg).images[0]
image.save("test.png")