Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#2 from ShinkoNet/master
Browse files Browse the repository at this point in the history
Better crash display
  • Loading branch information
hlky committed Aug 24, 2022
2 parents 065ad32 + 51cadc2 commit 62ea12c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,16 @@ the same effect. Use the --no-progressbar-hiding commandline option to revert th
### Prompt validation
Stable Diffusion has a limit for input text length. If your prompt is too long, you will get a
warning in the text output field, showing which parts of your text were truncated and ignored by the model.

### Loopback
A checkbox for img2img allowing to automatically feed output image as input for the next batch. Equivalent to
saving output image, and replacing input image with it. Batch count setting controls how many iterations of
this you get.

Usually, when doing this, you would choose one of many images for the next iteration yourself, so the usefulness
of this feature may be questionable, but I've managed to get some very nice outputs with it that I wasn't abble
to get otherwise.

Example: (cherrypicked result; original picture by anon)

![](images/loopback.jpg)
Binary file added images/loopback.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion relauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
if n > 0:
print(f'\tRelaunch count: {n}')
os.system("python scripts/webui.py")
print('Relauncher: Process ending. Relaunching in 0.5s...')
print('Relauncher: Process is ending. Relaunching in 0.5s...')
n += 1
time.sleep(0.5)
8 changes: 3 additions & 5 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,7 @@ def sample(init_data, x, conditioning, unconditional_conditioning):
except RuntimeError as e:
err = e
err_msg = f'CRASHED:<br><textarea rows="5" style="background: black;width: -webkit-fill-available;font-family: monospace;font-size: small;font-weight: bold;">{str(e)}</textarea><br><br>Please wait while the program restarts.'
stats = err_msg
return [], 1
return [], 0, "", err_msg
finally:
if err:
crash(err, '!!Runtime error (txt2img)!!')
Expand Down Expand Up @@ -740,8 +739,7 @@ def sample(init_data, x, conditioning, unconditional_conditioning):
except RuntimeError as e:
err = e
err_msg = f'CRASHED:<br><textarea rows="5" style="background: black;width: -webkit-fill-available;font-family: monospace;font-size: small;font-weight: bold;">{str(e)}</textarea><br><br>Please wait while the program restarts.'
stats = err_msg
return [], 1
return [], 0, "", err_msg
finally:
if err:
crash(err, '!!Runtime error (img2img)!!')
Expand Down Expand Up @@ -821,4 +819,4 @@ def run_GFPGAN(image, strength):
theme="default",
)

demo.launch(server_name='0.0.0.0')
demo.launch(show_error=True, server_name='0.0.0.0')

0 comments on commit 62ea12c

Please sign in to comment.