fix(scripts): ignore reference images in direct tests
This commit is contained in:
@@ -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`。
|
||||
- 图生图可通过环境变量传参考图:
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user