mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #140] feat(models): add model_provider, strict_mode and fallback_provider to run() #140
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#140
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/140
Author: @deepme987
Created: 9/10/2026
Status: 🔄 Open
Base:
main← Head:deep/model-provider-strict-mode-fallback📝 Commits (1)
4253a30feat(models): add model_provider, strict_mode and fallback_provider to run()📊 Changes
8 files changed (+289 additions, -16 deletions)
View changed files
📝
CHANGELOG.md(+12 -0)📝
README.md(+30 -0)📝
spec/router-openapi.yaml(+27 -0)📝
src/comfy_low/transport.py(+52 -3)📝
src/comfy_sdk/models.py(+42 -5)📝
tests/conftest.py(+21 -8)📝
tests/test_models_run.py(+99 -0)📝
tests/test_models_run_retry.py(+6 -0)📄 Description
Summary
model_provider/strict_mode, renamed fromcomfy_provider/comfy_stricton 2026-09-10) andfallback_provideradd three query params toPOST /v2/models/{provider}/{model}— this SDK had none of them.model_provider,strict_modeandfallback_provideras optional keyword-only params onModels.run/AsyncModels.run, threaded throughpost_model_runand the sans-IOmodel_run_requestbuilder. All three default toNone, which omits the query param entirely — an existing caller's request is byte-for-byte unchanged.fallback_providerhas an inverted sense on the wire: Router defaults it ON, so onlyfallback_provider=Falseever reaches the query string.spec/router-openapi.yaml(newModelProvider/StrictMode/FallbackProviderparameter components) soscripts/check_drift.py's contract stays honest, plus the README and CHANGELOG.Companion server-side implementation: Comfy-Org/cloud#8538.
Test plan
uv run pytest -q— 726 passed, 4 pre-existing skipsuv run ruff check src/ tests/— cleanuv run ruff format --check src/ tests/— cleanuv run mypy src/— cleanuv run python scripts/check_drift.py— clean (models/spec sync, router error types, bound route)model_provider,strict_modetrue/false,fallback_providerfalse-only-on-wire,fallback_provider=Trueis a no-op), the async client, the sans-IO builder directly, and a full round trip still returning the provider's native payloadSummary by CodeRabbit
New Features
Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.