fix: various bugfixes

pull/28/head
Bryce 2 years ago committed by Bryce Drennan
parent 2eec756fab
commit b69072d382

@ -95,7 +95,8 @@ def imagine_image_files(
):
big_path = os.path.join(outdir, "upscaled")
masked_orig_path = os.path.join(outdir, "modified_originals")
os.makedirs(outdir, exist_ok=True)
generated_imgs_path = os.path.join(outdir, "generated")
os.makedirs(generated_imgs_path, exist_ok=True)
base_count = len(os.listdir(outdir))
output_file_extension = output_file_extension.lower()
@ -124,8 +125,7 @@ def imagine_image_files(
):
prompt = result.prompt
basefilename = f"{base_count:06}_{prompt.seed}_{prompt.sampler_type}{prompt.steps}_PS{prompt.prompt_strength}_{prompt_normalized(prompt.prompt_text)}"
filepath = os.path.join(outdir, "generated", f"{basefilename}.jpg")
os.makedirs(filepath, exist_ok=True)
filepath = os.path.join(generated_imgs_path, f"{basefilename}.jpg")
result.save(filepath)
logger.info(f" 🖼 saved to: {filepath}")
if result.upscaled_img:

@ -113,14 +113,13 @@ def configure_logging(level="INFO"):
help="What level of logs to show.",
)
@click.option(
"--quiet, -q",
"--quiet", "-q",
is_flag=True,
type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR"]),
help="Alias of `--log-level ERROR`",
)
@click.option(
"--show-work",
default=["none"],
default=False,
is_flag=True,
help="Output a debug images to `steps` folder.",
)
@ -192,6 +191,7 @@ def imagine_cmd(
mask_image,
mask_prompt,
mask_mode,
mask_modify_original,
caption,
precision,
):
@ -241,10 +241,11 @@ def imagine_cmd(
prompts,
outdir=outdir,
ddim_eta=ddim_eta,
record_step_images="images" in show_work,
record_step_images=show_work,
output_file_extension="png",
print_caption=caption,
precision=precision,
mask_modify_original=mask_modify_original
)

Loading…
Cancel
Save