Skip to content

Commit

Permalink
feat: split onnx into separate option
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Feb 20, 2023
1 parent d8dc02f commit 908a9ca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docker-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def remove_unused_args(p):
def stable_diffusion_pipeline(p):
p.dtype = torch.float16 if p.half else torch.float32

if p.device == "cpu":
if p.onnx:
p.diffuser = OnnxStableDiffusionPipeline
p.revision = "onnx"
else:
Expand All @@ -63,6 +63,7 @@ def stable_diffusion_pipeline(p):
"upscalers": ["stabilityai/stable-diffusion-x4-upscaler"],
}
)

if p.image is not None:
if p.revision == "onnx":
p.diffuser = OnnxStableDiffusionImg2ImgPipeline
Expand Down Expand Up @@ -206,6 +207,14 @@ def main():
nargs="?",
help="The prompt to not render into an image",
)
parser.add_argument(
"--onnx",
type=bool,
nargs="?",
const=True,
default=False,
help="Use the onnx runtime for inference",
)
parser.add_argument(
"--prompt", type=str, nargs="?", help="The prompt to render into an image"
)
Expand Down

0 comments on commit 908a9ca

Please sign in to comment.