mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
disable readline functionality on windows
This commit is contained in:
@ -1,11 +1,16 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import readline
|
|
||||||
import argparse
|
import argparse
|
||||||
import shlex
|
import shlex
|
||||||
import atexit
|
import atexit
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# readline will be disabled on windows systems
|
||||||
|
try:
|
||||||
|
import readline
|
||||||
|
readline_available = True
|
||||||
|
except:
|
||||||
|
readline_available = False
|
||||||
|
|
||||||
debugging = False
|
debugging = False
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -26,6 +31,7 @@ def main():
|
|||||||
weights = "models/ldm/stable-diffusion-v1/model.ckpt"
|
weights = "models/ldm/stable-diffusion-v1/model.ckpt"
|
||||||
|
|
||||||
# command line history will be stored in a file called "~/.dream_history"
|
# command line history will be stored in a file called "~/.dream_history"
|
||||||
|
if readline_available:
|
||||||
setup_readline()
|
setup_readline()
|
||||||
|
|
||||||
print("* Initializing, be patient...\n")
|
print("* Initializing, be patient...\n")
|
||||||
@ -174,6 +180,7 @@ def create_cmd_parser():
|
|||||||
parser.add_argument('-f','--strength',default=0.75,type=float,help="strength for noising/unnoising. 0.0 preserves image exactly, 1.0 replaces it completely")
|
parser.add_argument('-f','--strength',default=0.75,type=float,help="strength for noising/unnoising. 0.0 preserves image exactly, 1.0 replaces it completely")
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
if readline_available:
|
||||||
def setup_readline():
|
def setup_readline():
|
||||||
readline.set_completer(Completer(['--steps','-s','--seed','-S','--iterations','-n','--batch_size','-b',
|
readline.set_completer(Completer(['--steps','-s','--seed','-S','--iterations','-n','--batch_size','-b',
|
||||||
'--width','-W','--height','-H','--cfg_scale','-C','--grid','-g',
|
'--width','-W','--height','-H','--cfg_scale','-C','--grid','-g',
|
||||||
|
Reference in New Issue
Block a user