Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

args_manager.py 3.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  1. import ldm_patched.modules.args_parser as args_parser
  2. args_parser.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
  3. args_parser.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
  4. args_parser.parser.add_argument("--disable-preset-selection", action='store_true',
  5. help="Disables preset selection in Gradio.")
  6. args_parser.parser.add_argument("--language", type=str, default='default',
  7. help="Translate UI using json files in [language] folder. "
  8. "For example, [--language example] will use [language/example.json] for translation.")
  9. # For example, https://github.com/lllyasviel/Fooocus/issues/849
  10. args_parser.parser.add_argument("--disable-offload-from-vram", action="store_true",
  11. help="Force loading models to vram when the unload can be avoided. "
  12. "Some Mac users may need this.")
  13. args_parser.parser.add_argument("--theme", type=str, help="launches the UI with light or dark theme", default=None)
  14. args_parser.parser.add_argument("--disable-image-log", action='store_true',
  15. help="Prevent writing images and logs to the outputs folder.")
  16. args_parser.parser.add_argument("--disable-analytics", action='store_true',
  17. help="Disables analytics for Gradio.")
  18. args_parser.parser.add_argument("--disable-metadata", action='store_true',
  19. help="Disables saving metadata to images.")
  20. args_parser.parser.add_argument("--disable-preset-download", action='store_true',
  21. help="Disables downloading models for presets", default=False)
  22. args_parser.parser.add_argument("--disable-enhance-output-sorting", action='store_true',
  23. help="Disables enhance output sorting for final image gallery.")
  24. args_parser.parser.add_argument("--enable-auto-describe-image", action='store_true',
  25. help="Enables automatic description of uov and enhance image when prompt is empty", default=False)
  26. args_parser.parser.add_argument("--always-download-new-model", action='store_true',
  27. help="Always download newer models", default=False)
  28. args_parser.parser.add_argument("--rebuild-hash-cache", help="Generates missing model and LoRA hashes.",
  29. type=int, nargs="?", metavar="CPU_NUM_THREADS", const=-1)
  30. args_parser.parser.set_defaults(
  31. disable_cuda_malloc=True,
  32. in_browser=True,
  33. port=None
  34. )
  35. args_parser.args = args_parser.parser.parse_args()
  36. # (Disable by default because of issues like https://github.com/lllyasviel/Fooocus/issues/724)
  37. args_parser.args.always_offload_from_vram = not args_parser.args.disable_offload_from_vram
  38. if args_parser.args.disable_analytics:
  39. import os
  40. os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
  41. if args_parser.args.disable_in_browser:
  42. args_parser.args.in_browser = False
  43. args = args_parser.args
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...