Parse command-line arguments
()
| 33 | |
| 34 | |
| 35 | def parse_args(): |
| 36 | """Parse command-line arguments""" |
| 37 | parser = argparse.ArgumentParser( |
| 38 | description="Paper2Poster CLI - Convert papers to aesthetic conference posters", |
| 39 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 40 | epilog=""" |
| 41 | Examples: |
| 42 | # Basic usage |
| 43 | python script/run_paper2poster_cli.py --input paper.pdf --api-key sk-xxx |
| 44 | |
| 45 | # With custom dimensions |
| 46 | python script/run_paper2poster_cli.py --input paper.pdf --poster-width 54 --poster-height 36 |
| 47 | |
| 48 | # With logos |
| 49 | python script/run_paper2poster_cli.py --input paper.pdf --logo logo.png --aff-logo aff.png |
| 50 | |
| 51 | Environment Variables: |
| 52 | DF_API_URL - Default LLM API URL |
| 53 | DF_API_KEY - Default API key |
| 54 | DF_MODEL - Default text model name |
| 55 | """ |
| 56 | ) |
| 57 | |
| 58 | # Required arguments |
| 59 | parser.add_argument( |
| 60 | "--input", |
| 61 | required=True, |
| 62 | help="Input PDF paper file" |
| 63 | ) |
| 64 | |
| 65 | # Optional arguments |
| 66 | parser.add_argument( |
| 67 | "--api-url", |
| 68 | help="LLM API URL (default: from env DF_API_URL)" |
| 69 | ) |
| 70 | |
| 71 | parser.add_argument( |
| 72 | "--api-key", |
| 73 | help="LLM API key (default: from env DF_API_KEY)" |
| 74 | ) |
| 75 | |
| 76 | parser.add_argument( |
| 77 | "--model", |
| 78 | default="gpt-4o-2024-08-06", |
| 79 | help="Text model name (default: gpt-4o-2024-08-06)" |
| 80 | ) |
| 81 | |
| 82 | parser.add_argument( |
| 83 | "--vision-model", |
| 84 | default="gpt-4o-2024-08-06", |
| 85 | help="Vision model name (default: gpt-4o-2024-08-06)" |
| 86 | ) |
| 87 | |
| 88 | parser.add_argument( |
| 89 | "--poster-width", |
| 90 | type=float, |
| 91 | default=54.0, |
| 92 | help="Poster width in inches (default: 54.0)" |