print current and max VRAM usage stats after each round of generation

This commit is contained in:
Lincoln Stein
2022-08-28 13:05:01 -04:00
parent 38ed6393fa
commit ba03289c14
2 changed files with 10 additions and 7 deletions

View File

@ -10,9 +10,6 @@ import warnings
import ldm.dream.readline
from ldm.dream.pngwriter import PngWriter, PromptFormatter
debugging = False
def main():
"""Initialize command-line parsers and the diffusion model"""
arg_parser = create_argv_parser()
@ -209,10 +206,10 @@ def main_loop(t2i, outdir, parser, log, infile):
normalized_prompt = PromptFormatter(t2i, opt).normalize_prompt()
individual_images = not opt.grid
# Here is where the images are actually generated!
try:
file_writer = PngWriter(outdir, normalized_prompt, opt.batch_size)
callback = file_writer.write_image if individual_images else None
image_list = t2i.prompt2image(image_callback=callback, **vars(opt))
results = (
file_writer.files_written if individual_images else image_list