utils.py 805 Bytes
Newer Older
April Hu's avatar
April Hu committed
1
2
3
4
5
6
7
8
9
import argparse


def get_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-p", "--precision", type=str, default="int4", choices=["int4", "bf16"], help="Which precisions to use"
    )
    parser.add_argument(
10
        "-m", "--model", type=str, default="depth", choices=["canny", "depth"], help="Which FLUX.1 model to use"
April Hu's avatar
April Hu committed
11
12
13
14
    )
    parser.add_argument("--use-qencoder", action="store_true", help="Whether to use 4-bit text encoder")
    parser.add_argument("--no-safety-checker", action="store_true", help="Disable safety checker")
    parser.add_argument("--count-use", action="store_true", help="Whether to count the number of uses")
15
    parser.add_argument("--gradio-root-path", type=str, default="")
April Hu's avatar
April Hu committed
16
17
    args = parser.parse_args()
    return args