ComfyUI/tests-unit
Marwan Ahmed e9f8aa9346 feat(api-nodes): add dedicated OpenAI GPT-Image-2 node
- Add `OpenAIGPTImage2` node (`node_id: OpenAIGPTImage2`) with settings
  specific to gpt-image-2: quality auto/low/medium/high, background
  auto/opaque (transparent not supported), all 8 popular size presets,
  and custom width/height inputs (step=16, max=3840) that override the
  size preset when both are non-zero
- Add `_resolve_gpt_image_2_size` helper that enforces API constraints:
  max edge ≤ 3840px, multiples of 16, ratio ≤ 3:1, total pixels
  655,360–8,294,400
- Add `calculate_tokens_price_image_2` using correct gpt-image-2 rates
  ($8/1M input, $30/1M output); price badge shows range per quality
  tier with approximate flag for auto quality
- Rename `OpenAIGPTImage1` display name to "OpenAI GPT Image 1 & 1.5",
  remove gpt-image-2 from its model dropdown, and update its price badge
  to be model-aware with correct per-model ranges
- Add unit tests covering price formulas, size resolution logic, and
  schema correctness for both nodes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 05:23:17 +02:00
..
app_test feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
assets_test fix(assets): recognize temp directory in asset category resolution (#13159) 2026-03-25 19:59:59 -07:00
comfy_api_test feat(api-nodes): add dedicated OpenAI GPT-Image-2 node 2026-04-22 05:23:17 +02:00
comfy_extras_test fix(number-convert): preserve int precision for large numbers (#13147) 2026-03-25 18:06:34 -04:00
comfy_quant Properly save mixed ops. (#11772) 2026-01-10 02:03:57 -05:00
comfy_test Native LongCat-Image implementation (#12597) 2026-02-27 23:04:34 -05:00
execution_test Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
folder_paths_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
prompt_server_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
seeder_test feat(assets): register output files as assets after prompt execution (#12812) 2026-03-24 20:48:55 -07:00
server/utils Remove unused GET /files API endpoint (#6714) 2025-02-05 18:48:36 -05:00
server_test fix: use no-store cache headers to prevent stale frontend chunks (#12911) 2026-03-14 18:25:09 -04:00
utils Normalize extra_model_config.yaml paths to prevent duplicates. (#6885) 2025-02-20 07:09:45 -05:00
feature_flags_test.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
README.md Minor: update tests-unit README.md (#4896) 2024-09-12 04:53:08 -04:00
requirements.txt refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
websocket_feature_flags_test.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00

Pytest Unit Tests

Install test dependencies

pip install -r tests-unit/requirements.txt

Run tests

pytest tests-unit/