|
11 | 11 | from skimage import exposure |
12 | 12 |
|
13 | 13 | import modules.sd_hijack |
14 | | -from modules import devices, prompt_parser, masking |
| 14 | +from modules import devices, prompt_parser, masking, sd_samplers |
15 | 15 | from modules.sd_hijack import model_hijack |
16 | | -from modules.sd_samplers import samplers, samplers_for_img2img |
17 | 16 | from modules.shared import opts, cmd_opts, state |
18 | 17 | import modules.shared as shared |
19 | 18 | import modules.face_restoration |
@@ -110,7 +109,7 @@ def __init__(self, p: StableDiffusionProcessing, images_list, seed=-1, info="", |
110 | 109 | self.width = p.width |
111 | 110 | self.height = p.height |
112 | 111 | self.sampler_index = p.sampler_index |
113 | | - self.sampler = samplers[p.sampler_index].name |
| 112 | + self.sampler = sd_samplers.samplers[p.sampler_index].name |
114 | 113 | self.cfg_scale = p.cfg_scale |
115 | 114 | self.steps = p.steps |
116 | 115 | self.batch_size = p.batch_size |
@@ -265,7 +264,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments, iteration |
265 | 264 |
|
266 | 265 | generation_params = { |
267 | 266 | "Steps": p.steps, |
268 | | - "Sampler": samplers[p.sampler_index].name, |
| 267 | + "Sampler": sd_samplers.samplers[p.sampler_index].name, |
269 | 268 | "CFG scale": p.cfg_scale, |
270 | 269 | "Seed": all_seeds[index], |
271 | 270 | "Face restoration": (opts.face_restoration_model if p.restore_faces else None), |
@@ -478,7 +477,7 @@ def init(self, all_prompts, all_seeds, all_subseeds): |
478 | 477 | self.firstphase_height_truncated = int(scale * self.height) |
479 | 478 |
|
480 | 479 | def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength): |
481 | | - self.sampler = samplers[self.sampler_index].constructor(self.sd_model) |
| 480 | + self.sampler = sd_samplers.samplers[self.sampler_index].constructor(self.sd_model) |
482 | 481 |
|
483 | 482 | if not self.enable_hr: |
484 | 483 | x = create_random_tensors([opt_C, self.height // opt_f, self.width // opt_f], seeds=seeds, subseeds=subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self) |
@@ -521,7 +520,7 @@ def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subs |
521 | 520 |
|
522 | 521 | shared.state.nextjob() |
523 | 522 |
|
524 | | - self.sampler = samplers[self.sampler_index].constructor(self.sd_model) |
| 523 | + self.sampler = sd_samplers.samplers[self.sampler_index].constructor(self.sd_model) |
525 | 524 | noise = create_random_tensors(samples.shape[1:], seeds=seeds, subseeds=subseeds, subseed_strength=subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self) |
526 | 525 |
|
527 | 526 | # GC now before running the next img2img to prevent running out of memory |
@@ -556,7 +555,7 @@ def __init__(self, init_images=None, resize_mode=0, denoising_strength=0.75, mas |
556 | 555 | self.nmask = None |
557 | 556 |
|
558 | 557 | def init(self, all_prompts, all_seeds, all_subseeds): |
559 | | - self.sampler = samplers_for_img2img[self.sampler_index].constructor(self.sd_model) |
| 558 | + self.sampler = sd_samplers.samplers_for_img2img[self.sampler_index].constructor(self.sd_model) |
560 | 559 | crop_region = None |
561 | 560 |
|
562 | 561 | if self.image_mask is not None: |
|
0 commit comments