fixes #9 FFPROBE PATH-entry by providing DL.-link and settings

pull/17/head
GeorgLegato 2023-04-16 01:12:46 +02:00
parent 846e7b0534
commit 9a1bfe8994
1 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,15 @@ def renderImg2Img(
return processed return processed
def fix_env_Path_ffprobe():
envpath = os.environ['PATH']
ffppath= shared.opts.data.get("infzoom_ffprobepath","")
if (ffppath and not ffppath in envpath):
path_sep = ';' if os.name == 'nt' else ':'
os.environ['PATH'] = envpath+path_sep+ffppath
def create_zoom( def create_zoom(
prompts_array, prompts_array,
negative_prompt, negative_prompt,
@ -108,6 +117,9 @@ def create_zoom(
zoom_speed, zoom_speed,
outputsize outputsize
): ):
fix_env_Path_ffprobe()
prompts = {} prompts = {}
for x in prompts_array: for x in prompts_array:
try: try:
@ -403,6 +415,8 @@ def on_ui_settings():
shared.opts.add_option("infzoom_outsize", shared.OptionInfo( shared.opts.add_option("infzoom_outsize", shared.OptionInfo(
512, "Default size for X and Y of your video", gr.Slider, {"minimum": 512, "maximum": 2048, "step": 8}, section=section)) 512, "Default size for X and Y of your video", gr.Slider, {"minimum": 512, "maximum": 2048, "step": 8}, section=section))
shared.opts.add_option("infzoom_ffprobepath", shared.OptionInfo(
"", "Writing videos has dependency to an existing FFPROBE executable on your machine. D/L here (https://github.com/BtbN/FFmpeg-Builds/releases) your OS variant and point to your installation path", gr.Textbox, {"interactive": True}, section=section))
script_callbacks.on_ui_tabs(on_ui_tabs) script_callbacks.on_ui_tabs(on_ui_tabs)
script_callbacks.on_ui_settings(on_ui_settings) script_callbacks.on_ui_settings(on_ui_settings)