()
| 21 | |
| 22 | |
| 23 | def main(): |
| 24 | parser = ArgumentParser("Diffusers CLI tool", usage="diffusers-cli <command> [<args>]") |
| 25 | commands_parser = parser.add_subparsers(help="diffusers-cli command helpers") |
| 26 | |
| 27 | # Register commands |
| 28 | EnvironmentCommand.register_subcommand(commands_parser) |
| 29 | FP16SafetensorsCommand.register_subcommand(commands_parser) |
| 30 | CustomBlocksCommand.register_subcommand(commands_parser) |
| 31 | |
| 32 | # Let's go |
| 33 | args = parser.parse_args() |
| 34 | |
| 35 | if not hasattr(args, "func"): |
| 36 | parser.print_help() |
| 37 | exit(1) |
| 38 | |
| 39 | # Run |
| 40 | service = args.func(args) |
| 41 | service.run() |
| 42 | |
| 43 | |
| 44 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…