repair broken highres fix #1109
This commit is contained in:
parent
828d6cce72
commit
9a54077d4d
|
@ -218,7 +218,7 @@ def resize_image(resize_mode, im, width, height):
|
|||
|
||||
upscaler = upscalers[0]
|
||||
scale = max(w / im.width, h / im.height)
|
||||
upscaled = upscaler.scaler.upscale(im, scale)
|
||||
upscaled = upscaler.scaler.upscale(im, scale, upscaler.data_path)
|
||||
|
||||
if upscaled.width != w or upscaled.height != h:
|
||||
upscaled = im.resize((w, h), resample=LANCZOS)
|
||||
|
|
|
@ -492,8 +492,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|
|||
x_sample = 255. * np.moveaxis(x_sample.cpu().numpy(), 0, 2)
|
||||
x_sample = x_sample.astype(np.uint8)
|
||||
image = Image.fromarray(x_sample)
|
||||
upscaler = [x for x in shared.sd_upscalers if x.name == opts.upscaler_for_img2img][0]
|
||||
image = upscaler.upscale(image, self.width, self.height)
|
||||
image = images.resize_image(0, image, self.width, self.height)
|
||||
image = np.array(image).astype(np.float32) / 255.0
|
||||
image = np.moveaxis(image, 2, 0)
|
||||
batch_images.append(image)
|
||||
|
|
Loading…
Reference in New Issue
Block a user