import sys import argparse import gpt_image def main(): parser = argparse.ArgumentParser(description="Upload reference images to S3, call img2img model, poll for result, and cleanup temporary files.") parser.add_argument("images", nargs="+", help="Paths to local reference images.") parser.add_argument("-o", "--output", help="Output path for the generated image. Defaults to 'result_.png' in current directory.") parser.add_argument("-p", "--prompt", default="生成ta的真人照片,再生成ta的背面放在图片右边", help="Prompt for the img2img model.") args = parser.parse_args() try: gpt_image.generate_img2img( local_image_paths=args.images, prompt=args.prompt, output_path=args.output ) except Exception as e: print(f"[!] Execution failed: {e}") sys.exit(1) if __name__ == '__main__': main()