Commit
·
f1bde35
1
Parent(s):
f83832c
more
Browse files- run_xl_ediffi.py +2 -18
run_xl_ediffi.py
CHANGED
@@ -21,29 +21,13 @@ start_time = time.time()
|
|
21 |
random_generator = torch.Generator()
|
22 |
random_generator.manual_seed(12345)
|
23 |
|
24 |
-
scheduler = DPMSolverMultistepScheduler(
|
25 |
-
beta_start=0.00085,
|
26 |
-
beta_end=0.012,
|
27 |
-
beta_schedule="scaled_linear",
|
28 |
-
prediction_type="epsilon",
|
29 |
-
num_train_timesteps=1000,
|
30 |
-
trained_betas=None,
|
31 |
-
thresholding=False,
|
32 |
-
algorithm_type="dpmsolver++",
|
33 |
-
solver_type="midpoint",
|
34 |
-
lower_order_final=True,
|
35 |
-
use_karras_sigmas=True,
|
36 |
-
)
|
37 |
-
|
38 |
model_id = "stabilityai/stable-diffusion-xl-base-0.9"
|
39 |
pipe_high_noise = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True, local_files_only=True)
|
40 |
-
|
41 |
-
pipe_high_noise.scheduler = scheduler
|
42 |
pipe_high_noise.to("cuda")
|
43 |
|
44 |
pipe_low_noise = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-0.9", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
45 |
-
|
46 |
-
pipe_low_noise.scheduler = scheduler
|
47 |
pipe_low_noise.to("cuda")
|
48 |
|
49 |
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
|
|
|
21 |
random_generator = torch.Generator()
|
22 |
random_generator.manual_seed(12345)
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
model_id = "stabilityai/stable-diffusion-xl-base-0.9"
|
25 |
pipe_high_noise = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True, local_files_only=True)
|
26 |
+
pipe_high_noise.scheduler = DPMSolverMultistepScheduler.from_config(pipe_high_noise.scheduler.config)
|
|
|
27 |
pipe_high_noise.to("cuda")
|
28 |
|
29 |
pipe_low_noise = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-0.9", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
30 |
+
pipe_low_noise.scheduler = pipe_high_noise.scheduler
|
|
|
31 |
pipe_low_noise.to("cuda")
|
32 |
|
33 |
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
|