radames commited on
Commit
31dbff3
1 Parent(s): af45ba9

args: add ssl certfile and keyfile

Browse files
Files changed (2) hide show
  1. config.py +32 -3
  2. run.py +8 -1
config.py CHANGED
@@ -14,6 +14,8 @@ class Args(NamedTuple):
14
  torch_compile: bool
15
  use_taesd: bool
16
  pipeline: str
 
 
17
 
18
 
19
  MAX_QUEUE_SIZE = int(os.environ.get("MAX_QUEUE_SIZE", 0))
@@ -33,16 +35,29 @@ parser.add_argument(
33
  "--mode", type=str, default=default_mode, help="App Inferece Mode: txt2img, img2img"
34
  )
35
  parser.add_argument(
36
- "--max_queue_size", type=int, default=MAX_QUEUE_SIZE, help="Max Queue Size"
 
 
 
 
37
  )
38
  parser.add_argument("--timeout", type=float, default=TIMEOUT, help="Timeout")
39
  parser.add_argument(
40
- "--safety_checker", type=bool, default=SAFETY_CHECKER, help="Safety Checker"
 
 
 
 
41
  )
42
  parser.add_argument(
43
- "--torch_compile", type=bool, default=TORCH_COMPILE, help="Torch Compile"
 
 
 
 
44
  )
45
  parser.add_argument(
 
46
  "--use_taesd",
47
  type=bool,
48
  default=USE_TAESD,
@@ -54,5 +69,19 @@ parser.add_argument(
54
  default="txt2img",
55
  help="Pipeline to use",
56
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  args = Args(**vars(parser.parse_args()))
 
14
  torch_compile: bool
15
  use_taesd: bool
16
  pipeline: str
17
+ ssl_certfile: str
18
+ ssl_keyfile: str
19
 
20
 
21
  MAX_QUEUE_SIZE = int(os.environ.get("MAX_QUEUE_SIZE", 0))
 
35
  "--mode", type=str, default=default_mode, help="App Inferece Mode: txt2img, img2img"
36
  )
37
  parser.add_argument(
38
+ "--max-queue-size",
39
+ "--max_queue_size",
40
+ type=int,
41
+ default=MAX_QUEUE_SIZE,
42
+ help="Max Queue Size",
43
  )
44
  parser.add_argument("--timeout", type=float, default=TIMEOUT, help="Timeout")
45
  parser.add_argument(
46
+ "--safety-checker",
47
+ "--safety_checker",
48
+ type=bool,
49
+ default=SAFETY_CHECKER,
50
+ help="Safety Checker",
51
  )
52
  parser.add_argument(
53
+ "--torch-compile",
54
+ "--torch_compile",
55
+ type=bool,
56
+ default=TORCH_COMPILE,
57
+ help="Torch Compile",
58
  )
59
  parser.add_argument(
60
+ "--use-taesd",
61
  "--use_taesd",
62
  type=bool,
63
  default=USE_TAESD,
 
69
  default="txt2img",
70
  help="Pipeline to use",
71
  )
72
+ parser.add_argument(
73
+ "--ssl-certfile",
74
+ "--ssl_certfile",
75
+ type=str,
76
+ default=None,
77
+ help="SSL certfile",
78
+ )
79
+ parser.add_argument(
80
+ "--ssl-keyfile",
81
+ "--ssl_keyfile",
82
+ type=str,
83
+ default=None,
84
+ help="SSL keyfile",
85
+ )
86
 
87
  args = Args(**vars(parser.parse_args()))
run.py CHANGED
@@ -2,4 +2,11 @@ if __name__ == "__main__":
2
  import uvicorn
3
  from config import args
4
 
5
- uvicorn.run("app:app", host=args.host, port=args.port, reload=args.reload)
 
 
 
 
 
 
 
 
2
  import uvicorn
3
  from config import args
4
 
5
+ uvicorn.run(
6
+ "app:app",
7
+ host=args.host,
8
+ port=args.port,
9
+ reload=args.reload,
10
+ ssl_certfile=args.ssl_certfile,
11
+ ssl_keyfile=args.ssl_keyfile,
12
+ )