Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ operations are added to this namespace as they land.
### `models.run` — one call, one result

```python
result = client.models.run("fal-ai/flux-pro", {"prompt": "a cat", "steps": 4})
result = client.models.run("bfl/flux-2-pro", {"prompt": "a cat", "steps": 4})
result["images"][0]["url"]
```

That call is `POST https://api.comfy.org/v2/models/fal-ai/flux-pro` with
That call is `POST https://api.comfy.org/v2/models/bfl/flux-2-pro` with
`{"prompt": "a cat", "steps": 4}` as the body.

Three things follow from that, and they are the whole contract of this method:
Expand All @@ -413,8 +413,8 @@ Three things follow from that, and they are the whole contract of this method:
`COMFY_ROUTER_BASE_URL`, not by `COMFY_BASE_URL`. Your API key goes with it.
- **The first argument is the model's canonical id**, `{provider}/{model}` —
exactly the two segments that address the route, and exactly what Router's
model catalog lists. It must be two non-empty segments: `"fal-ai"` alone,
`"fal-ai/flux-pro/fp8"` (the three-segment variant form, which this route does
model catalog lists. It must be two non-empty segments: `"bfl"` alone,
`"bfl/flux-2-pro/fp8"` (the three-segment variant form, which this route does
not take yet), and anything containing a `.` or `..` segment all raise
`ValueError` locally, before any request. A non-string raises `TypeError`.
- **The second argument is the model's own native input**, forwarded to the
Expand All @@ -432,7 +432,7 @@ The awaitable form is the **async client**, not a differently-named method:

```python
async with AsyncComfy(api_key="comfyui-...") as client:
result = await client.models.run("fal-ai/flux-pro", {"prompt": "a cat"})
result = await client.models.run("bfl/flux-2-pro", {"prompt": "a cat"})
```

There is no `run_async()`, and there will not be one — one operation, one name,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_the_sans_io_request_builder_agrees_with_the_wire() -> None:
# `RouterModelSegment` pattern, and none of them is percent-encoded:
# they are unreserved (or sub-delims) in a path segment, so the URL the
# caller reads in a log is the id they passed.
("fal-ai/flux-pro", "/v2/models/fal-ai/flux-pro"),
("bfl/flux-2-pro", "/v2/models/bfl/flux-2-pro"),
("acme/sd_xl.turbo", "/v2/models/acme/sd_xl.turbo"),
("acme_labs/v1.5", "/v2/models/acme_labs/v1.5"),
# ...while anything that would change the *structure* of the path is
Expand Down
Loading