close Issue #165

This commit is contained in:
Lincoln Stein 2022-08-28 18:21:20 -04:00
parent ac02a775e4
commit 8bbe7936bd
3 changed files with 10 additions and 11 deletions

View File

@ -63,13 +63,14 @@ class DreamServer(BaseHTTPRequestHandler):
initimg = initimg.split(",")[1] # Ignore mime type
f.write(base64.b64decode(initimg))
# Run img2img
outputs = self.model.img2img(prompt,
init_img = "./img2img-tmp.png",
iterations = iterations,
cfg_scale = cfgscale,
seed = seed,
steps = steps)
# Run img2img
outputs = self.model.img2img(prompt,
init_img = "./img2img-tmp.png",
iterations = iterations,
cfg_scale = cfgscale,
seed = seed,
gfpgan_strength=gfpgan_strength,
steps = steps)
# Remove the temp file
os.remove("./img2img-tmp.png")

View File

@ -208,7 +208,7 @@ class T2I:
# these are specific to img2img
init_img=None,
strength=None,
gfpgan_strength=None,
gfpgan_strength=0,
save_original=False,
upscale=None,
variants=None,
@ -592,6 +592,7 @@ class T2I:
return model
def _load_img(self, path):
print(f'image path = {path}, cwd = {os.getcwd()}')
with Image.open(path) as img:
image = img.convert('RGB')

View File

@ -95,9 +95,6 @@ def main():
log.close()
def main_loop(t2i, outdir, parser, log_path, infile):
print(
"\n* Initialization done! Awaiting your command (-h for help, 'q' to quit, 'cd' to change output dir, 'pwd' to print output dir)..."
)
"""prompt/read/execute loop"""
done = False
last_seeds = []