adds cmdline arg to prevent auto-update, only installs if index.html doesn't exist, checks for update in main.py again instead of install
parent
6cc0ae1bb0
commit
7b4f84816e
|
|
@ -4,6 +4,8 @@ Please see the respective READMEs and wikis for each of the above projects for a
|
|||
|
||||
This extension also adds buttons to send output from webUI txt2img and img2img tools directly to openOutpaint which will also include the prompts used for convenience.
|
||||
|
||||
**_2023-01-23: new `--lock-oo-submodule` commandline argument if you want to roll back to a previous version of openOutpaint and keep it there - be sure to install/run openOutpaint extension at least once before enabling this flag_**
|
||||
|
||||
**Note: Requires `--api` flag enabled in your webui-user launch script!**
|
||||
|
||||
**_FURTHER NOTE: the commandline flag `--gradio-debug` disables custom API routes and completely breaks openOutpaint. please remove it from your COMMANDLINE_ARGS before running openOutpaint._**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ installDir = os.path.join(scripts.basedir(), usefulDirs[0], usefulDirs[1])
|
|||
# Attempt to use launch module from webui
|
||||
command = f'"{git}" -C "' + installDir +\
|
||||
'" submodule update --init --recursive --remote'
|
||||
if not os.path.isfile(os.path.join(installDir, "app", "index.html")):
|
||||
try:
|
||||
from launch import run
|
||||
stdout = run(command)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
import argparse
|
||||
|
||||
def preload(parser: argparse.ArgumentParser):
|
||||
parser.add_argument("--lock-oo-submodule", action='store_true',
|
||||
help="(openOutpaint-webUI-extension) Prevent checking for main openOutpaint submodule updates.")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from modules import script_callbacks, scripts
|
||||
from modules import script_callbacks, scripts, shared
|
||||
import gradio as gr
|
||||
from fastapi import FastAPI
|
||||
import os
|
||||
|
|
@ -40,6 +40,12 @@ def started(demo, app: FastAPI):
|
|||
|
||||
|
||||
def add_tab():
|
||||
if (not shared.cmd_opts.lock_oo_submodule):
|
||||
git = os.environ.get('GIT', "git")
|
||||
run(f'"{git}" -C "' + scripts.basedir() +
|
||||
'" submodule update --init --recursive --remote')
|
||||
else:
|
||||
print("locked openOutpaint submodule, not updating")
|
||||
with gr.Blocks(analytics_enabled=False) as ui:
|
||||
#refresh = gr.Button(value="refresh", variant="primary")
|
||||
canvas = gr.HTML(
|
||||
|
|
|
|||
Loading…
Reference in New Issue