From 636620b1d5e2466613d0dcc2a604522be12fa3a4 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 8 Nov 2022 03:26:16 +0000 Subject: [PATCH] change initfile to ~/.invokeai - adjust documentation - also fix 'clipseg_models' to 'clipseg', which seems to be working now --- docs/features/CLI.md | 12 ++++++------ environment.yml | 2 +- ldm/invoke/args.py | 5 ++++- ldm/invoke/txt2mask.py | 2 +- scripts/invoke.py | 0 setup.py | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) mode change 100644 => 100755 scripts/invoke.py diff --git a/docs/features/CLI.md b/docs/features/CLI.md index 3c1e079f6d..b8de156412 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -123,13 +123,13 @@ overridden on a per-prompt basis (see You can either double your slashes (ick): `C:\\path\\to\\my\\file`, or use Linux/Mac style forward slashes (better): `C:/path/to/my/file`. -## invokeai.init initialization file +## The .invokeai initialization file -Place your preferred startup options in a file named `invokeai.init` -to have them load automatically at startup time. The file should contain the startup -options as you would type them on the command line (`--steps=10 ---grid`), one argument per line, or a mixture of both using any of -the accepted command switch formats: +To start up invoke.py with your preferred settings, place your desired +startup options in a file in your home directory named `.invokeai` The +file should contain the startup options as you would type them on the +command line (`--steps=10 --grid`), one argument per line, or a +mixture of both using any of the accepted command switch formats: !!! example "" diff --git a/environment.yml b/environment.yml index fc648e8262..ae07e11c3a 100644 --- a/environment.yml +++ b/environment.yml @@ -36,7 +36,7 @@ dependencies: - eventlet - getpass_asterisk - kornia==0.6.0 - - -e git+https://github.com/openai/CLIP.git@main#egg=clip + - git+https://github.com/openai/CLIP.git@main#egg=clip - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - -e git+https://github.com/invoke-ai/Real-ESRGAN.git#egg=realesrgan diff --git a/ldm/invoke/args.py b/ldm/invoke/args.py index f621f66f39..3c3b2059d5 100644 --- a/ldm/invoke/args.py +++ b/ldm/invoke/args.py @@ -116,7 +116,7 @@ PRECISION_CHOICES = [ # is there a way to pick this up during git commits? APP_ID = 'invoke-ai/InvokeAI' APP_VERSION = 'v2.1.2' -INITFILE = 'invokeai.init' +INITFILE = os.path.expanduser('~/.invokeai') class ArgFormatter(argparse.RawTextHelpFormatter): # use defined argument order to display usage @@ -170,7 +170,10 @@ class Args(object): try: sysargs = sys.argv[1:] if os.path.exists(INITFILE): + print(f'>> Initialization file {INITFILE} found. Loading...') sysargs.insert(0,f'@{INITFILE}') + else: + print(f'>> Initialization file {INITFILE} not found. Applying default settings...') self._arg_switches = self._arg_parser.parse_args(sysargs) return self._arg_switches except Exception as e: diff --git a/ldm/invoke/txt2mask.py b/ldm/invoke/txt2mask.py index 2103f2f48c..abac95faac 100644 --- a/ldm/invoke/txt2mask.py +++ b/ldm/invoke/txt2mask.py @@ -29,7 +29,7 @@ work fine. import torch import numpy as np -from clipseg_models.clipseg import CLIPDensePredT +from clipseg.clipseg import CLIPDensePredT from einops import rearrange, repeat from PIL import Image, ImageOps from torchvision import transforms diff --git a/scripts/invoke.py b/scripts/invoke.py old mode 100644 new mode 100755 diff --git a/setup.py b/setup.py index a544aa150a..0c5ddb2ae4 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='invoke-ai', - version='2.0.2', + version='2.1.3', description='', packages=find_packages(), install_requires=[