mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix crash that occurs in write_log when user interrupts generation with ^C
This commit is contained in:
parent
743342816b
commit
98271a0267
@ -81,7 +81,7 @@ with metadata_from_png():
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from argparse import Namespace
|
||||
from argparse import Namespace, RawTextHelpFormatter
|
||||
import shlex
|
||||
import json
|
||||
import hashlib
|
||||
@ -463,7 +463,9 @@ class Args(object):
|
||||
# This creates the parser that processes commands on the dream> command line
|
||||
def _create_dream_cmd_parser(self):
|
||||
parser = argparse.ArgumentParser(
|
||||
description="""
|
||||
formatter_class=RawTextHelpFormatter,
|
||||
description=
|
||||
"""
|
||||
*Image generation:*
|
||||
To generate images, type a text prompt with optional switches. Example:
|
||||
a fantastic alien landscape -W576 -H512 -s60 -n4
|
||||
|
@ -22,6 +22,8 @@ def write_log(results, log_path, file_types, output_cntr):
|
||||
|
||||
def write_log_message(results, output_cntr):
|
||||
"""logs to the terminal"""
|
||||
if len(results) == 0:
|
||||
return output_cntr
|
||||
log_lines = [f"{path}: {prompt}\n" for path, prompt in results]
|
||||
if len(log_lines)>1:
|
||||
subcntr = 1
|
||||
|
Loading…
Reference in New Issue
Block a user