Skip to content

Let users add custom params to model nodes - #13684

Closed
hannahblair wants to merge 1 commit into
workflow-auto-discoveryfrom
workflow-custom-params
Closed

Let users add custom params to model nodes#13684
hannahblair wants to merge 1 commit into
workflow-auto-discoveryfrom
workflow-custom-params

Conversation

@hannahblair

@hannahblair hannahblair commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

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>
@hannahblair
hannahblair deleted the workflow-custom-params branch July 29, 2026 09:45
@gradio-pr-bot

gradio-pr-bot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Storybook failed! Details

Install Gradio from this PR

pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/9f73f3ffae6db316d89cdb92e2b3363550f97cdd/gradio-6.20.0-py3-none-any.whl

Install 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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants