1
0
Fork 0

add requirements file and test script

This commit is contained in:
Sean Sube 2023-01-05 10:05:23 -06:00
parent 6c932e2ee8
commit ccbce9abe8
2 changed files with 15 additions and 5 deletions

10
api/requirements.txt Normal file
View File

@ -0,0 +1,10 @@
### AI packages ###
diffusers
numpy
onnx
onnxruntime
transformers
### Server packages ###
flask
stringcase

View File

@ -1,11 +1,11 @@
from diffusers import OnnxStableDiffusionPipeline
cfg=8
steps=22
height=512
width=512
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")
image.save("../test.png")