Skip to content

Commit

Permalink
runtime errors now produce a stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed Aug 24, 2022
1 parent 6ffe874 commit 7ecd6fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ldm/simplet2i.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import time
import math
import re
import traceback

from ldm.util import instantiate_from_config
from ldm.models.diffusion.ddim import DDIMSampler
Expand Down Expand Up @@ -415,7 +416,8 @@ def img2img(self,prompt,outdir=None,init_img=None,batch_size=None,iterations=Non
print('*interrupted*')
print('Partial results will be returned; if --grid was requested, nothing will be returned.')
except RuntimeError as e:
print(str(e))
print("Oops! A runtime error has occurred. If this is unexpected, please copy-and-paste this stack trace and post it as an Issue to http://github.com/lstein/stable-diffusion")
traceback.print_exc()

toc = time.time()
print(f'{image_count} images generated in',"%4.2fs"% (toc-tic))
Expand Down
3 changes: 1 addition & 2 deletions scripts/dream.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ def main():
exit(-1)

# preload the model
if not debugging:
t2i.load_model()
t2i.load_model()
print("\n* Initialization done! Awaiting your command (-h for help, 'q' to quit, 'cd' to change output dir, 'pwd' to print output dir)...")

log_path = os.path.join(opt.outdir,'dream_log.txt')
Expand Down

0 comments on commit 7ecd6fd

Please sign in to comment.