Skip to content

docs: use the real bfl/flux-2-pro id in the model-run examples - #127

Open
mattmillerai wants to merge 2 commits into
mainfrom
matt/be-11087-readme-bfl-flux-2-pro
Open

docs: use the real bfl/flux-2-pro id in the model-run examples#127
mattmillerai wants to merge 2 commits into
mainfrom
matt/be-11087-readme-bfl-flux-2-pro

Conversation

@mattmillerai

@mattmillerai mattmillerai commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

ELI-5

The README's very first Router example told you to run a model called fal-ai/flux-pro. That model does not exist, so the first line a new reader copy-pastes could never work. It is wrong twice over: flux-pro is not an enrolled Comfy Router model under any provider, and fal-ai is not a Comfy provider slug either — the fal provider's slug is fal, and fal-ai is the upstream path segment inside it. Flux is served direct from Black Forest Labs under bfl/*. This swaps the example for bfl/flux-2-pro, which is real, enrolled, and already the canonical id in the Router quickstart (picked there for a measured ~3.1s p50, the fastest path on the Router).

What changed

Docs and one test fixture — nothing in src/ moved, no generated artifact changed, no vendored file was touched, and models.run behaviour is untouched.

  • README.md — the quickstart call, the POST https://api.comfy.org/v2/models/... prose, the id-format bullet (both its one-segment example and its three-segment variant example, now "bfl" and "bfl/flux-2-pro/fp8"), and the async-client example.
  • tests/test_models_run.py — the percent-encoding fixture that used the bad id as a synthetic one, renamed to the real id.

Why spec/router-openapi.yaml is not in this diff

An earlier revision of this PR also rewrote the three example: values the vendored Router spec carries (RouterModelId, RouterModelSegment, RouterProviderSegment). That was reverted in 9675e8e, on review.

spec/router-openapi.yaml is a one-way vendored copy of the canonical Router contract, and both spec/README.md ("do not hand-edit either file") and AGENTS.md ("Vendored, synced one-way. Never hand-edit.") say it is not this repo's to edit. Nothing in CI would have caught the edit either — scripts/check_drift.py and tests/test_router_spec_contract.py only compare RouterErrorType.x-comfy-error-types, not example: values — so the local copy would have diverged from upstream silently, then either been reverted by the next routine sync or read as phantom churn in a diff reviewers are meant to take as pure upstream change. Those three example values belong in the canonical contract; they should arrive here via a sync, not by hand.

The consequence is deliberate and visible: fal-ai/flux-pro still appears three times in spec/router-openapi.yaml on this branch. That is the vendored upstream's text, not this repo's prose.

Sweep

The whole tree was swept for the string, not just the lines the ticket enumerated. It appeared on 9 lines across 3 files (README 5, spec 3, tests 1). After this change it appears on 3 lines in 1 file — the vendored spec, left untouched on purpose per the section above; 0 lines in everything this repo authors. Nothing in src/ carried it: the spec's example: values do not propagate into src/comfy_low/models/_generated.py, which is why the drift gate stays green with no regeneration.

Why the test rename is safe

The renamed row's stated job is that ., _ and - are legal inside a segment and are not percent-encoded. The old id carried - in both segments; bfl/flux-2-pro carries it only in the model segment. That is not a coverage loss: model_run_request applies the identical quote(..., safe="") to both segments, so provider-vs-model is not a distinct code path, and the sibling rows still cover _ in a provider segment (acme_labs/v1.5) and _/. in a model segment (acme/sd_xl.turbo). The new id also exercises a digit-only inner segment (2), which the old one did not.

Verifying the premise, not just the diff

This change rests on a non-existence claim, so it was checked against the catalog rather than from memory: on the platform's default branch today, every enrolled Flux route lives under the bfl provider — flux-2-pro among them, with an authored per-model input schema alongside it — and the fal provider carries no Flux route at all. The replacement id is also the one the platform's own Router quickstart uses.

Residual

  • The upstream source of the spec examples is unfixed, and this PR now deliberately leaves the vendored copy carrying it. spec/router-openapi.yaml is hand-synced, not generated, and the drift gate does not compare example: values — so the stale ids there redden no check and will not self-update. Verified today: the upstream spec still carries all three original example: values on its default branch. Fixing it in the canonical contract, and picking it up here via a normal sync, is the correct path and is tracked separately.
  • A second unrunnable README example is left unfixed. README.md:554 and README.md:566 (the idempotency-replay example) call client.models.run("acme/flux/dev", ...). That is a three-segment id, which parse_model_id refuses locally with ValueError before any request — the same string is the fixture for test_a_three_segment_id_says_the_variant_is_not_addressable_yet. It is a different defect (a malformed id shape, not a non-existent model) and outside this change's enumerated scope, but it is a second README example a reader cannot run. The fix is to collapse it to a two-segment id.
  • The same example is still live in 18 further files across 4 other repositories in the organisation (a current org-wide code search; one further hit is an unrelated vendored third-party sample). Cross-repo work is out of scope for this PR; those are separately tracked.
  • Unexercised artifact — the live Router catalog. GET /v2/models/{provider}/{model}/openapi.json requires authentication and answered 401 No Authorization header found for every id probed, so the live surface could not discriminate a real id from a fake one here without a key this run does not hold. The verification above is against the platform's source of truth instead. Confirming bfl/flux-2-pro against the live catalog with a real key is a one-command check worth doing.
  • Unexercised artifact — the originating report. The upstream discussion thread the report came from was not readable from this environment, and the report itself records that its exact wording was never verified. The linked parent issue's own body and comments were likewise not available, so the substitution here follows the replacement id the report names rather than anything read first-hand from either.

Provenance

  • Authored by: agent-work loop
  • Verified: re-run on the reverted tree (9675e8e) with the repo's pinned toolchain (ruff~=0.15.22 via the dev extra) — ruff check .: all checks passed; ruff format --check .: 51 files already formatted; mypy src: no issues in 19 source files; pytest -q: 718 passed, 4 skipped; scripts/check_public_repo_hygiene.py: no internal-only references; scripts/check_drift.py: both Router checks OK (its _check_models step needs the codegen binary, absent from this local venv — CI's comfy_low codegen drift job covers it and passes). git diff origin/main -- spec/router-openapi.yaml is empty, confirming the vendored copy is byte-identical to main. Note the ambient ruff on this machine is 0.16.0, which also reformats Markdown and reports spurious README diffs against this repo.
  • Deviations: the vendored-spec edits named in the original acceptance criteria were reverted rather than kept — see "Why spec/router-openapi.yaml is not in this diff". The remaining criteria are met; the items under Residual are out-of-scope findings and unexercisable artifacts, not skipped criteria.

Summary by CodeRabbit

  • Documentation

    • Updated models.run examples and validation descriptions to use the canonical bfl/flux-2-pro model identifier.
    • Updated API schema examples to reflect the bfl/flux-2-pro model path.
  • Tests

    • Updated model routing checks to validate requests using the canonical model identifier.

The quickstart told a reader to call `fal-ai/flux-pro`, which cannot
succeed: `flux-pro` is not an enrolled Comfy Router model under any
provider, and `fal-ai` is not a Comfy provider slug either — the fal
provider's slug is `fal`, and `fal-ai` is the upstream path segment
inside it. Flux is served direct from Black Forest Labs under `bfl/*`.

Replace it with `bfl/flux-2-pro` everywhere it appears — the README
quickstart call, the `POST /v2/models/...` prose, the id-format bullet
(including its three-segment variant example), the async example, the
three `example:` values in the vendored Router spec, and the one
percent-encoding fixture that used it as a synthetic id. Where the
provider and model segments are shown apart they become `bfl` and
`flux-2-pro`.

Documentation and examples only: no generated code carried the string
and no behaviour changes.
@mattmillerai mattmillerai added the agent-coded Authored by the agent-work loop label Sep 3, 2026
@mattmillerai
mattmillerai marked this pull request as ready for review September 3, 2026 08:01
@mattmillerai
mattmillerai requested review from a team as code owners September 3, 2026 08:01
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: ac20a1ab-6d96-4664-9a07-a72a85a6f173

📥 Commits

Reviewing files that changed from the base of the PR and between ce4242b and 9617546.

📒 Files selected for processing (3)
  • README.md
  • spec/router-openapi.yaml
  • tests/test_models_run.py

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


Important

Approval pending

CodeRabbit has no unresolved comments, but it has not reviewed the latest commit.

Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR replaces fal-ai/flux-pro with bfl/flux-2-pro in models.run documentation, OpenAPI examples, validation examples, and routing tests.

Changes

Canonical model identifier update

Layer / File(s) Summary
Documentation and schema examples
README.md, spec/router-openapi.yaml
Examples now use the bfl provider and flux-2-pro model.
Routing test alignment
tests/test_models_run.py
The parameterized routing case now uses bfl/flux-2-pro and preserves the existing route format.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 9675e

Examples and routing-test coverage now consistently use bfl/flux-2-pro. No merge-readiness risk remains.

Suggested reviewers: alexisrolland

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: updating model-run examples to use the canonical bfl/flux-2-pro identifier.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-11087-readme-bfl-flux-2-pro

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 3, 2026
@mattmillerai mattmillerai added the cursor-review Request an automated Cursor review label Sep 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 1 finding(s).

Severity Count
🟢 Low 1

Panel: 6/6 reviewers contributed findings.

Comment thread spec/router-openapi.yaml Outdated
…tests only

`spec/router-openapi.yaml` is a one-way vendored copy of the canonical Router
contract. Both `spec/README.md` ("do not hand-edit either file") and
`AGENTS.md` ("Vendored, synced one-way. Never hand-edit.") say so, and nothing
in CI catches an in-place edit: `scripts/check_drift.py` and
`tests/test_router_spec_contract.py` only compare
`RouterErrorType.x-comfy-error-types`. So the three `example:` values this PR
rewrote (`RouterModelId`, `RouterModelSegment`, `RouterProviderSegment`) would
have diverged silently from upstream and either been reverted by the next sync
or read as phantom churn in a diff reviewers are meant to take as pure upstream
change.

Reverts the vendored file to its `main` contents. The example values belong in
the canonical contract and should arrive here via a sync; the README prose and
the routing-test fixture are this repo's to fix and are unchanged by this
commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Authored by the agent-work loop cursor-review Request an automated Cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant