Commit b186d44d authored by AUTOMATIC's avatar AUTOMATIC
Browse files

use DDIM in hires fix is the sampler is PLMS

parent 3b61007a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -857,7 +857,8 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):

        shared.state.nextjob()

        self.sampler = sd_samplers.create_sampler(self.sampler_name, self.sd_model)
        img2img_sampler_name = self.sampler_name if self.sampler_name != 'PLMS' else 'DDIM'  # PLMS does not support img2img so we just silently switch ot DDIM
        self.sampler = sd_samplers.create_sampler(img2img_sampler_name, self.sd_model)

        samples = samples[:, :, self.truncate_y//2:samples.shape[2]-(self.truncate_y+1)//2, self.truncate_x//2:samples.shape[3]-(self.truncate_x+1)//2]