1
0
Fork 0

feat(api): enable LPW custom pipeline (#27)

This commit is contained in:
Sean Sube 2023-02-04 17:44:54 -06:00
parent 1e477f7548
commit 7b506cb6d3
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 8 additions and 6 deletions

View File

@ -75,14 +75,14 @@ def upscale_outpaint(
latents = get_tile_latents(full_latents, dims)
rng = np.random.RandomState(params.seed)
result = pipe(
result = pipe.inpaint(
image,
mask,
prompt,
generator=rng,
guidance_scale=params.cfg,
height=size.height,
image=image,
latents=latents,
mask_image=mask,
negative_prompt=params.negative_prompt,
num_inference_steps=params.steps,
width=size.width,

View File

@ -73,6 +73,8 @@ def load_pipeline(
model,
provider=device.provider,
provider_options=device.options,
custom_pipeline='lpw_stable_diffusion_onnx',
revision='onnx',
safety_checker=None,
scheduler=scheduler,
)

View File

@ -32,7 +32,7 @@ def run_txt2img_pipeline(
rng = np.random.RandomState(params.seed)
progress = job.get_progress_callback()
result = pipe(
result = pipe.txt2img(
params.prompt,
height=size.height,
width=size.width,
@ -77,11 +77,11 @@ def run_img2img_pipeline(
rng = np.random.RandomState(params.seed)
progress = job.get_progress_callback()
result = pipe(
result = pipe.img2img(
source_image,
params.prompt,
generator=rng,
guidance_scale=params.cfg,
image=source_image,
negative_prompt=params.negative_prompt,
num_inference_steps=params.steps,
strength=strength,