# Parse the --data-dir flag first so we can use it as a base for our other argument default values
parser=argparse.ArgumentParser()
parser.add_argument("--data-dir",type=str,default=os.path.dirname(os.path.dirname(os.path.realpath(__file__))),help="base path where all user data is stored",)
cmd_opts_pre=parser.parse_known_args()[0]
data_path=cmd_opts_pre.data_dir
models_path=os.path.join(data_path,"models")
# data_path = cmd_opts_pre.data
sys.path.insert(0,script_path)
sys.path.insert(0,script_path)
# search for directory of stable diffusion in following places
# search for directory of stable diffusion in following places
parser.add_argument("--data-dir",type=str,default=os.path.dirname(os.path.dirname(os.path.realpath(__file__))),help="base path where all user data is stored",)
parser.add_argument("--config",type=str,default=sd_default_config,help="path to config which constructs model",)
parser.add_argument("--config",type=str,default=sd_default_config,help="path to config which constructs model",)
parser.add_argument("--ckpt",type=str,default=sd_model_file,help="path to checkpoint of stable diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded",)
parser.add_argument("--ckpt",type=str,default=sd_model_file,help="path to checkpoint of stable diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded",)
parser.add_argument("--ckpt-dir",type=str,default=None,help="Path to directory with stable diffusion checkpoints")
parser.add_argument("--ckpt-dir",type=str,default=None,help="Path to directory with stable diffusion checkpoints")
...
@@ -35,7 +36,7 @@ parser.add_argument("--no-half", action='store_true', help="do not switch the mo
...
@@ -35,7 +36,7 @@ parser.add_argument("--no-half", action='store_true', help="do not switch the mo
parser.add_argument("--no-half-vae",action='store_true',help="do not switch the VAE model to 16-bit floats")
parser.add_argument("--no-half-vae",action='store_true',help="do not switch the VAE model to 16-bit floats")
parser.add_argument("--no-progressbar-hiding",action='store_true',help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)")
parser.add_argument("--no-progressbar-hiding",action='store_true',help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)")
parser.add_argument("--max-batch-count",type=int,default=16,help="maximum batch count value for the UI")
parser.add_argument("--max-batch-count",type=int,default=16,help="maximum batch count value for the UI")
parser.add_argument("--embeddings-dir",type=str,default=os.path.join(script_path,'embeddings'),help="embeddings directory for textual inversion (default: embeddings)")
parser.add_argument("--embeddings-dir",type=str,default=os.path.join(data_path,'embeddings'),help="embeddings directory for textual inversion (default: embeddings)")
parser.add_argument("--textual-inversion-templates-dir",type=str,default=os.path.join(script_path,'textual_inversion_templates'),help="directory with textual inversion templates")
parser.add_argument("--textual-inversion-templates-dir",type=str,default=os.path.join(script_path,'textual_inversion_templates'),help="directory with textual inversion templates")
@@ -74,16 +75,16 @@ parser.add_argument("--use-cpu", nargs='+', help="use CPU as torch device for sp
...
@@ -74,16 +75,16 @@ parser.add_argument("--use-cpu", nargs='+', help="use CPU as torch device for sp
parser.add_argument("--listen",action='store_true',help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
parser.add_argument("--listen",action='store_true',help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
parser.add_argument("--port",type=int,help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available",default=None)
parser.add_argument("--port",type=int,help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available",default=None)
parser.add_argument("--show-negative-prompt",action='store_true',help="does not do anything",default=False)
parser.add_argument("--show-negative-prompt",action='store_true',help="does not do anything",default=False)
parser.add_argument("--ui-config-file",type=str,help="filename to use for ui configuration",default=os.path.join(script_path,'ui-config.json'))
parser.add_argument("--ui-config-file",type=str,help="filename to use for ui configuration",default=os.path.join(data_path,'ui-config.json'))
parser.add_argument("--hide-ui-dir-config",action='store_true',help="hide directory configuration from webui",default=False)
parser.add_argument("--hide-ui-dir-config",action='store_true',help="hide directory configuration from webui",default=False)
parser.add_argument("--ui-settings-file",type=str,help="filename to use for ui settings",default=os.path.join(script_path,'config.json'))
parser.add_argument("--ui-settings-file",type=str,help="filename to use for ui settings",default=os.path.join(data_path,'config.json'))
parser.add_argument("--gradio-debug",action='store_true',help="launch gradio with --debug option")
parser.add_argument("--gradio-debug",action='store_true',help="launch gradio with --debug option")
parser.add_argument("--gradio-auth",type=str,help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"',default=None)
parser.add_argument("--gradio-auth",type=str,help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"',default=None)
parser.add_argument("--gradio-img2img-tool",type=str,help='does not do anything')
parser.add_argument("--gradio-img2img-tool",type=str,help='does not do anything')
parser.add_argument("--gradio-inpaint-tool",type=str,help="does not do anything")
parser.add_argument("--gradio-inpaint-tool",type=str,help="does not do anything")
parser.add_argument("--opt-channelslast",action='store_true',help="change memory type for stable diffusion to channels last")
parser.add_argument("--opt-channelslast",action='store_true',help="change memory type for stable diffusion to channels last")
parser.add_argument("--styles-file",type=str,help="filename to use for styles",default=os.path.join(script_path,'styles.csv'))
parser.add_argument("--styles-file",type=str,help="filename to use for styles",default=os.path.join(data_path,'styles.csv'))
parser.add_argument("--autolaunch",action='store_true',help="open the webui URL in the system's default browser upon launch",default=False)
parser.add_argument("--autolaunch",action='store_true',help="open the webui URL in the system's default browser upon launch",default=False)
parser.add_argument("--theme",type=str,help="launches the UI with light or dark theme",default=None)
parser.add_argument("--theme",type=str,help="launches the UI with light or dark theme",default=None)
parser.add_argument("--use-textbox-seed",action='store_true',help="use textbox for seeds in UI (no up/down, but possible to input long seeds)",default=False)
parser.add_argument("--use-textbox-seed",action='store_true',help="use textbox for seeds in UI (no up/down, but possible to input long seeds)",default=False)