OpenAI-compatible adapter for ComfyUI image generation and editing

This commit is contained in:
Shaman
2026-10-04 21:56:00 +03:00
commit c17ab5036e
29 changed files with 1730 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import httpx
import pytest
from tests.conftest import FAKE_KEY
async def test_missing_key_401(client: httpx.AsyncClient):
r = await client.post("/v1/images/generations", json={"prompt": "x"}, headers={"Authorization": ""})
assert r.status_code == 401
assert r.json()["error"]["code"] == "invalid_api_key"
async def test_wrong_key_401(client: httpx.AsyncClient):
r = await client.post("/v1/images/generations", json={"prompt": "x"}, headers={"Authorization": "Bearer sk-wrong"})
assert r.status_code == 401
async def test_valid_key_accepted(client: httpx.AsyncClient):
r = await client.get("/v1/models")
assert r.status_code == 200
async def test_health_open_without_key(client: httpx.AsyncClient):
r = await client.get("/health", headers={"Authorization": ""})
assert r.status_code == 200
assert r.json() == {"status": "ok"}