lint(api): join all paths
This commit is contained in:
parent
dc33b7c887
commit
4e3a86dfdb
|
@ -47,9 +47,9 @@ max_height = 512
|
|||
max_width = 512
|
||||
|
||||
# paths
|
||||
model_path = environ.get('ONNX_WEB_MODEL_PATH', '../models')
|
||||
output_path = environ.get('ONNX_WEB_OUTPUT_PATH', '../outputs')
|
||||
params_path = environ.get('ONNX_WEB_PARAMS_PATH', './params.json')
|
||||
model_path = environ.get('ONNX_WEB_MODEL_PATH', path.join('..', 'models'))
|
||||
output_path = environ.get('ONNX_WEB_OUTPUT_PATH', path.join('..', 'outputs'))
|
||||
params_path = environ.get('ONNX_WEB_PARAMS_PATH', 'params.json')
|
||||
|
||||
|
||||
# pipeline caching
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
from diffusers import OnnxStableDiffusionPipeline
|
||||
from os import path
|
||||
|
||||
cfg = 8
|
||||
steps = 22
|
||||
height = 512
|
||||
width = 512
|
||||
prompt = "an astronaut eating a hamburger"
|
||||
|
||||
pipe = OnnxStableDiffusionPipeline.from_pretrained("../models/stable-diffusion-onnx-v1-5", provider="DmlExecutionProvider", safety_checker=None)
|
||||
model = path.join('..', 'models', 'stable-diffusion-onnx-v1-5')
|
||||
prompt = 'an astronaut eating a hamburger'
|
||||
output = path.join('..', 'outputs', 'test.png')
|
||||
|
||||
pipe = OnnxStableDiffusionPipeline.from_pretrained(model, 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(output)
|
Loading…
Reference in New Issue