diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-06 11:12:52 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-06 11:12:52 +0000 |
commit | 5993df24a1026225cb8af89237547c1d9101ce69 (patch) | |
tree | c52ac85fcdac4e332dc6fd7a5a6960b6b4a3b36d /modules/processing.py | |
parent | a971e4a767118ec41ec0f129770122babfb16a16 (diff) | |
download | stable-diffusion-webui-gfx803-5993df24a1026225cb8af89237547c1d9101ce69.tar.gz stable-diffusion-webui-gfx803-5993df24a1026225cb8af89237547c1d9101ce69.tar.bz2 stable-diffusion-webui-gfx803-5993df24a1026225cb8af89237547c1d9101ce69.zip |
integrate the new samplers PR
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py index e01c8b3f..e567956c 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -477,7 +477,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): self.firstphase_height_truncated = int(scale * self.height)
def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength):
- self.sampler = sd_samplers.samplers[self.sampler_index].constructor(self.sd_model)
+ self.sampler = sd_samplers.create_sampler_with_index(sd_samplers.samplers, self.sampler_index, self.sd_model)
if not self.enable_hr:
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)
@@ -520,7 +520,8 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): shared.state.nextjob()
- self.sampler = sd_samplers.samplers[self.sampler_index].constructor(self.sd_model)
+ self.sampler = sd_samplers.create_sampler_with_index(sd_samplers.samplers, self.sampler_index, self.sd_model)
+
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)
# GC now before running the next img2img to prevent running out of memory
@@ -555,7 +556,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing): self.nmask = None
def init(self, all_prompts, all_seeds, all_subseeds):
- self.sampler = sd_samplers.samplers_for_img2img[self.sampler_index].constructor(self.sd_model)
+ self.sampler = sd_samplers.create_sampler_with_index(sd_samplers.samplers_for_img2img, self.sampler_index, self.sd_model)
crop_region = None
if self.image_mask is not None:
|