Let users add custom params to model nodes - #13684
Closed
hannahblair wants to merge 1 commit into
Closed
Conversation
The workflow canvas renders model input ports from an auto-discovered
InferenceClient signature — but per-model / per-provider overrides
aren't discoverable (HF has confirmed there's no API to expose them).
So a model that accepts extra params, or a provider that omits schema
params, can't be configured without editing workflow.json by hand.
This adds an "+ Add param" affordance to every model node. Clicking
it opens an inline form (name + type picker). The port is added to
node.inputs with custom: true so it survives schema refreshes and
endpoint switches. On the wire it looks like any other port —
connectable, greyable if optional — and its value flows through
_dispatch_model_endpoint as an extra kwarg to the InferenceClient
method call (no backend change needed, kwargs already pass through).
Custom ports get an "✕" remove button in their row so users can drop
them without editing JSON.
Also added a subtle italic style on the port label to distinguish
user-added ports from schema-defined ones at a glance.
The doc link ("Open on HuggingFace") that already exists on model
nodes covers the "where do I find valid params" question naturally —
users read the model card, see a param, add it.
Includes 5 new store tests covering: custom flag applied on add,
edges removed when port is removed, non-custom ports untouched by
remove_custom_port, custom ports preserved across
init_model_node_ports and switch_endpoint.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
🪼 branch checks and previews
Install Gradio from this PR pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/9f73f3ffae6db316d89cdb92e2b3363550f97cdd/gradio-6.20.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@9f73f3ffae6db316d89cdb92e2b3363550f97cdd#subdirectory=client/python"Import Gradio JS Client from this PR via CDN import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/9f73f3ffae6db316d89cdb92e2b3363550f97cdd/browser.js"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.