From 1df1e5c38b3a04535315b3e0a4aa4003b0eea850 Mon Sep 17 00:00:00 2001 From: Sean McLellan Date: Tue, 23 Aug 2022 19:22:35 -0400 Subject: [PATCH] Test for the presence of the specified img2img --- scripts/dream.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/dream.py b/scripts/dream.py index fb8fec2384..05287c7ebe 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -161,7 +161,12 @@ def main_loop(t2i,parser,log,infile): if opt.init_img is None: results = t2i.txt2img(**vars(opt)) else: - results = t2i.img2img(**vars(opt)) + if os.path.exists(opt.init_img): + results = t2i.img2img(**vars(opt)) + else: + print(f"An image was not present at {opt.init_img}. Try again with a valid image path!") + continue + print("Outputs:") write_log_message(t2i,opt,results,log)