Skip to content

Commit

Permalink
Add euler scheduler. Also, make it default for sd2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant Kumar committed Dec 12, 2022
1 parent e5be179 commit 8ae76d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shark/examples/shark_inference/stable_diffusion/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PNDMScheduler,
DDIMScheduler,
DPMSolverMultistepScheduler,
EulerDiscreteScheduler,
)
from tqdm.auto import tqdm
import numpy as np
Expand Down Expand Up @@ -77,6 +78,15 @@ def end_profiling(device):
subfolder="scheduler",
)

if args.version == "v2.1base":
tokenizer = CLIPTokenizer.from_pretrained(
"stabilityai/stable-diffusion-2-1-base", subfolder="tokenizer"
)

scheduler = EulerDiscreteScheduler.from_pretrained(
"stabilityai/stable-diffusion-2-1-base",
subfolder="scheduler",
)
start = time.time()

text_input = tokenizer(
Expand Down

0 comments on commit 8ae76d1

Please sign in to comment.