feat(api): enable LPW custom pipeline (#27)
This commit is contained in:
parent
d636ce3eef
commit
70dedf811a
|
@ -92,14 +92,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,
|
||||
|
|
|
@ -63,6 +63,8 @@ def load_pipeline(pipeline: DiffusionPipeline, model: str, provider: str, schedu
|
|||
logger.debug('loading new diffusion pipeline from %s', model)
|
||||
pipe = pipeline.from_pretrained(
|
||||
model,
|
||||
custom_pipeline='lpw_stable_diffusion_onnx',
|
||||
revision='onnx',
|
||||
provider=provider,
|
||||
safety_checker=None,
|
||||
scheduler=scheduler.from_pretrained(model, subfolder='scheduler')
|
||||
|
|
|
@ -56,7 +56,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,
|
||||
|
@ -97,11 +97,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,
|
||||
|
|
Loading…
Reference in New Issue