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
dff4850a82
commit
e49e83e944
@ -81,7 +81,7 @@ with metadata_from_png():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from argparse import Namespace
|
from argparse import Namespace, RawTextHelpFormatter
|
||||||
import shlex
|
import shlex
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -445,7 +445,9 @@ class Args(object):
|
|||||||
# This creates the parser that processes commands on the dream> command line
|
# This creates the parser that processes commands on the dream> command line
|
||||||
def _create_dream_cmd_parser(self):
|
def _create_dream_cmd_parser(self):
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="""
|
formatter_class=RawTextHelpFormatter,
|
||||||
|
description=
|
||||||
|
"""
|
||||||
*Image generation:*
|
*Image generation:*
|
||||||
To generate images, type a text prompt with optional switches. Example:
|
To generate images, type a text prompt with optional switches. Example:
|
||||||
a fantastic alien landscape -W576 -H512 -s60 -n4
|
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):
|
def write_log_message(results, output_cntr):
|
||||||
"""logs to the terminal"""
|
"""logs to the terminal"""
|
||||||
|
if len(results) == 0:
|
||||||
|
return output_cntr
|
||||||
log_lines = [f"{path}: {prompt}\n" for path, prompt in results]
|
log_lines = [f"{path}: {prompt}\n" for path, prompt in results]
|
||||||
if len(log_lines)>1:
|
if len(log_lines)>1:
|
||||||
subcntr = 1
|
subcntr = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user