Style error handler

pull/15/head
Animator Anon 2023-02-03 17:30:29 +10:00
parent 8c88001049
commit 48cbe00a8d
4 changed files with 23 additions and 7 deletions

5
.gitignore vendored
View File

@ -3,3 +3,8 @@ __pycache__
*.pyc
*.pyo
debug.txt
.idea/animator_extension.iml
.idea/inspectionProfiles/profiles_settings.xml
.idea/misc.xml
.idea/modules.xml
.idea/vcs.xml

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -107,6 +107,8 @@ def myprocess(*args, **kwargs):
# Make bat files before video incase we interrupt it, and so we can generate vids on the fly.
export.make_batch_files(myset)
# tmp_live_previews_enable = shared.opts.live_previews_enable
# shared.opts.live_previews_enable = False
shared.state.interrupted = False
if myset['loopback']:
@ -120,6 +122,8 @@ def myprocess(*args, **kwargs):
shared.state.end()
# shared.opts.live_previews_enable = tmp_live_previews_enable
return result, "done"
@ -281,7 +285,7 @@ def ui_block_output():
# Basic layout of page
#
def on_ui_tabs():
print("on_ui_tabs")
# print("on_ui_tabs")
with gr.Blocks(analytics_enabled=False) as animator_tabs:
with gr.Row():
# left Column
@ -332,7 +336,7 @@ def on_ui_tabs():
# Define my options that will be stored in webui config
#
def on_ui_settings():
print("on_ui_settings")
# print("on_ui_settings")
mysection = ('animatoranon', 'Animator Extension')
shared.opts.add_option("animatoranon_film_folder",

View File

@ -119,11 +119,15 @@ def process_keyframes(mysettings: dict) -> pd.DataFrame:
frame_count = math.ceil(mysettings['fps'] * mysettings['total_time'])
# Try and apply styles in addition to what was written into the template text boxes.
mysettings['tmpl_pos'] = shared.prompt_styles.apply_styles_to_prompt(mysettings['tmpl_pos'],
[mysettings['_style_pos'], 'None'])
mysettings['tmpl_neg'] = shared.prompt_styles.apply_negative_styles_to_prompt(mysettings['tmpl_neg'],
[mysettings['_style_neg'], 'None'])
try:
# Try and apply styles in addition to what was written into the template text boxes.
mysettings['tmpl_pos'] = shared.prompt_styles.apply_styles_to_prompt(mysettings['tmpl_pos'],
[mysettings['_style_pos'], 'None'])
mysettings['tmpl_neg'] = shared.prompt_styles.apply_negative_styles_to_prompt(mysettings['tmpl_neg'],
[mysettings['_style_neg'],
'None'])
except Exception as e:
print(f"Error: Failed to apply styles to templates: {e}")
# Define the columns in the pandas dataframe that will hold and calculate all the changing values..
variables = {'pos1': np.nan,