diff --git a/docs/usage.md b/docs/usage.md index e228665..2f4366f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -302,6 +302,7 @@ else: - 每次请求会落到 `outputs/image-demo-runs/<时间戳>/`。 - 直接运行:`bash scripts/run_figma_direct_test.sh` - 只测 `https://api.aoixx.com/v1/images/generations` 时,运行 `bash scripts/run_aoixx_direct_test.sh`。 +- 这两个 direct test 会自动忽略 `.env` 里的 `REFERENCE_IMAGE` 和 `MASK_IMAGE`,默认走纯生成流程。 - 如果要走 OpenAI-compatible 的 `gpt-image-2` 图生图,运行 `bash scripts/run_openai_gpt_image2_edit.sh`。 - 如果要走多图参考生成多图,运行 `bash scripts/run_openai_gpt_image2_multi.sh`。 - 图生图可通过环境变量传参考图: diff --git a/scripts/run_aoixx_direct_test.sh b/scripts/run_aoixx_direct_test.sh index 6f53a7e..cc64799 100755 --- a/scripts/run_aoixx_direct_test.sh +++ b/scripts/run_aoixx_direct_test.sh @@ -35,4 +35,18 @@ export IMAGE_MAX_POLL_WAIT="${IMAGE_MAX_POLL_WAIT:-1800}" export IMAGE_INITIAL_POLL_DELAY="${IMAGE_INITIAL_POLL_DELAY:-10}" export IMAGE_POLL_INTERVAL="${IMAGE_POLL_INTERVAL:-5}" +# Direct generation tests should ignore any edit inputs coming from .env. +for name in \ + REFERENCE_IMAGE \ + REFERENCE_IMAGE_FILE \ + REFERENCE_IMAGE_URL \ + REFERENCE_IMAGE_DATA_URL \ + MASK_IMAGE \ + MASK_IMAGE_FILE \ + MASK_IMAGE_URL \ + MASK_IMAGE_DATA_URL +do + export "$name=" +done + python3 gpt_image2_generate.py "$@" diff --git a/scripts/run_figma_direct_test.sh b/scripts/run_figma_direct_test.sh index e614d05..b12602a 100755 --- a/scripts/run_figma_direct_test.sh +++ b/scripts/run_figma_direct_test.sh @@ -44,6 +44,20 @@ for name in "${!PRESERVED_ENV[@]}"; do export "$name=${PRESERVED_ENV[$name]}" done +# Direct generation tests should ignore any edit inputs coming from .env. +for name in \ + REFERENCE_IMAGE \ + REFERENCE_IMAGE_FILE \ + REFERENCE_IMAGE_URL \ + REFERENCE_IMAGE_DATA_URL \ + MASK_IMAGE \ + MASK_IMAGE_FILE \ + MASK_IMAGE_URL \ + MASK_IMAGE_DATA_URL +do + export "$name=" +done + unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY export IMAGE_REQUEST_STYLE="${IMAGE_REQUEST_STYLE:-apicodex}"