Datasets:
File size: 922 Bytes
2add930 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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_<timestamp>.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()
|