Skip to content

Commit

Permalink
catch exception for all paste_fields callable
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Apr 9, 2024
1 parent 600f339 commit ef83f68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/infotext_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import gradio as gr
from modules.paths import data_path
from modules import shared, ui_tempdir, script_callbacks, processing, infotext_versions, images, prompt_parser
from modules import shared, ui_tempdir, script_callbacks, processing, infotext_versions, images, prompt_parser, errors
from PIL import Image

sys.modules['modules.generation_parameters_copypaste'] = sys.modules[__name__] # alias for old name
Expand Down Expand Up @@ -488,7 +488,11 @@ def paste_func(prompt):

for output, key in paste_fields:
if callable(key):
v = key(params)
try:
v = key(params)
except Exception:
errors.report(f"Error executing {key}", exc_info=True)
v = None
else:
v = params.get(key, None)

Expand Down

0 comments on commit ef83f68

Please sign in to comment.