mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #159] [MERGED] feat: add model_provider / strict_mode / fallback_provider to models.run #159
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-python-sdk#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/159
Author: @deepme987
Created: 9/16/2026
Status: ✅ Merged
Merged: 9/18/2026
Merged by: @mattmillerai
Base:
main← Head:deepme987/router-provider-params📝 Commits (7)
e108e96chore: sync vendored Comfy Router spec from cloud@996a63c2af9be2feat(models): add model_provider, strict_mode, fallback_provider to models.runa60de73test(integration): add Router model-run e2e for the alt-provider controls0438c1ffix(models): normalise a bool fallback_provider to the spec's true/falseea9b995feat(models): surface Router's serving-provider and dropped-params disclosure3dde973test(integration): require an explicit opt-in before the e2e tests bille273132docs(models): resend the alt-provider controls with a recovery idempotency key📊 Changes
9 files changed (+1185 additions, -70 deletions)
View changed files
📝
spec/router-openapi.yaml(+398 -35)📝
src/comfy_low/transport.py(+93 -7)📝
src/comfy_sdk/__init__.py(+4 -0)📝
src/comfy_sdk/models.py(+262 -6)📝
src/comfy_sdk/router_exceptions.py(+80 -9)➕
tests/integration/test_router_models_e2e.py(+152 -0)📝
tests/test_models_run.py(+150 -0)📝
tests/test_models_run_retry.py(+33 -9)📝
tests/test_router_exceptions.py(+13 -4)📄 Description
What
Adds Comfy Router's alt-provider controls to
client.models.run(sync + async):model_provider— select an alternate serving provider for a model (e.g."fal"); omitted runs the model's default provider.strict_mode—False(default) sends this model's native input and Router translates to/from the provider's schema;Truesends and returns the provider's own raw shape unchanged.fallback_provider— pass"false"to opt out of the retry-against-another-provider behavior.Each is a query param on the run route, built by
_router_run_queryand sent only when set, so a call that names none is byte-for-byte the request this route has always made.Also reconciles the vendored Router spec sync (supersedes #156, which is spec-only): reblesses the 8 error buckets whose
meaningmoved incloud@996a63c, and types the 3 the spec now declares (cancelled,queue_timeout,request_not_found). The first two leaveDEFERRED_ERROR_TYPESnow that the contract carries them (file_download_errorstays deferred, still not in the spec).Scope
These controls are on the synchronous run route only — the backend accepts them on
runRouterModelalone, not on the queue routes (submit/subscribe), confirmed in the vendored spec and cloud'srouter_queue.go. Queue-surface support needs a cloud change first.Testing
uv run pytest— 884 passed, 4 skipped.COMFY_ROUTER_BASE_URL=https://stagingapi.comfy.org,model_provider=fal), all passing:video_urlstrict_mode=true→ fal's raw{"images":[...]}passthroughfallback_provider="false"acceptedCompanion PRs
Same feature across the other SDKs:
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.