1
0
Fork 0

fix(api): embed LPW pipeline (fixes #96)

This commit is contained in:
Sean Sube 2023-02-05 16:01:11 -06:00
parent 49b3aa68bb
commit 7c5f9baeb7
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
4 changed files with 1162 additions and 8 deletions

View File

@ -72,10 +72,10 @@ def load_pipeline(
)
pipe = pipeline.from_pretrained(
model,
custom_pipeline="./onnx_web/diffusion/lpw_stable_diffusion_onnx.py",
provider=device.provider,
provider_options=device.options,
custom_pipeline='lpw_stable_diffusion_onnx',
revision='onnx',
revision="onnx",
safety_checker=None,
scheduler=scheduler,
)

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,10 @@
###
# This is based on a combination of the ONNX img2img pipeline and the PyTorch upscale pipeline:
# https://github.com/huggingface/diffusers/blob/v0.11.1/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
# https://github.com/huggingface/diffusers/blob/v0.11.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
# See also: https://github.com/huggingface/diffusers/pull/2158
###
from logging import getLogger
from typing import Any, Callable, List, Optional, Union
@ -18,12 +25,6 @@ num_channels_latents = 4
# TODO: make this dynamic, from self.unet.config.in_channels
unet_in_channels = 7
###
# This is based on a combination of the ONNX img2img pipeline and the PyTorch upscale pipeline:
# https://github.com/huggingface/diffusers/blob/v0.11.1/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
# https://github.com/huggingface/diffusers/blob/v0.11.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
###
def preprocess(image):
if isinstance(image, torch.Tensor):

View File

@ -1,2 +1,3 @@
[tool.isort]
profile = "black"
force_to_top = ".logging"