From 18e667f98e44e05032a40cd3dcbd213022b3fd9b Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 4 Oct 2022 10:30:01 -0400 Subject: [PATCH] fix miscellaneous regressions: - embiggen needs to use ddim sampler due to low step count - --hires_fix option needs to be written to log and command string - fix call signature of _init_image_mask() --- ldm/dream/args.py | 2 ++ ldm/dream/generator/embiggen.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ldm/dream/args.py b/ldm/dream/args.py index c4485d7c23..7a41094ded 100644 --- a/ldm/dream/args.py +++ b/ldm/dream/args.py @@ -193,6 +193,8 @@ class Args(object): switches.append('--grid') if a['seamless']: switches.append('--seamless') + if a['hires_fix']: + switches.append('--hires_fix') # img2img generations have parameters relevant only to them and have special handling if a['init_img'] and len(a['init_img'])>0: diff --git a/ldm/dream/generator/embiggen.py b/ldm/dream/generator/embiggen.py index c85bae868c..079b7dd9aa 100644 --- a/ldm/dream/generator/embiggen.py +++ b/ldm/dream/generator/embiggen.py @@ -10,6 +10,7 @@ from PIL import Image from ldm.dream.generator.base import Generator from ldm.dream.generator.img2img import Img2Img from ldm.dream.devices import choose_autocast +from ldm.models.diffusion.ddim import DDIMSampler class Embiggen(Generator): def __init__(self, model, precision): @@ -349,7 +350,7 @@ class Embiggen(Generator): prompt, iterations = 1, seed = seed, - sampler = sampler, + sampler = DDIMSampler(self.model, device=self.model.device), steps = steps, cfg_scale = cfg_scale, conditioning = conditioning,