Files
ComfyUI_frontend/tools/devtools/nodes/remote.py
Arjan Singh 0239a83da2 Update rh-test (as of 2025-10-11) (#6044)
## Summary

Tested these changes and confirmed that:
1. Feedback button shows.
2. You can run workflows and switch out models.
3. You can use the mask editor. (thank you @ric-yu for helping me
verify).

## Changes

A lot, please see commits.

Gets us up to date with `main` as of 10-11-2025.

---------

Co-authored-by: Simula_r <18093452+simula-r@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: snomiao <snomiao@gmail.com>
Co-authored-by: Christian Byrne <cbyrne@comfy.org>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: DrJKL <DrJKL@users.noreply.github.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: Marwan Ahmed <155799754+marawan206@users.noreply.github.com>
Co-authored-by: DrJKL <DrJKL0424@gmail.com>
Co-authored-by: Rizumu Ayaka <rizumu@ayaka.moe>
Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
Co-authored-by: AustinMroz <4284322+AustinMroz@users.noreply.github.com>
Co-authored-by: Austin Mroz <austin@comfy.org>
Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
Co-authored-by: Benjamin Lu <benceruleanlu@proton.me>
Co-authored-by: Jin Yi <jin12cc@gmail.com>
Co-authored-by: Robin Huang <robin.j.huang@gmail.com>
2025-10-14 15:59:26 -07:00

221 lines
6.6 KiB
Python

from __future__ import annotations
class RemoteWidgetNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"remote_widget_value": (
"COMBO",
{
"remote": {
"route": "/api/models/checkpoints",
},
},
),
},
}
FUNCTION = "remote_widget"
CATEGORY = "DevTools"
DESCRIPTION = "A node that lazily fetches options from a remote endpoint"
RETURN_TYPES = ("STRING",)
def remote_widget(self, remote_widget_value: str):
return (remote_widget_value,)
class RemoteWidgetNodeWithParams:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"remote_widget_value": (
"COMBO",
{
"remote": {
"route": "/api/models/checkpoints",
"query_params": {
"sort": "true",
},
},
},
),
},
}
FUNCTION = "remote_widget"
CATEGORY = "DevTools"
DESCRIPTION = (
"A node that lazily fetches options from a remote endpoint with query params"
)
RETURN_TYPES = ("STRING",)
def remote_widget(self, remote_widget_value: str):
return (remote_widget_value,)
class RemoteWidgetNodeWithRefresh:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"remote_widget_value": (
"COMBO",
{
"remote": {
"route": "/api/models/checkpoints",
"refresh": 300,
"max_retries": 10,
"timeout": 256,
},
},
),
},
}
FUNCTION = "remote_widget"
CATEGORY = "DevTools"
DESCRIPTION = "A node that lazily fetches options from a remote endpoint and refresh the options every 300 ms"
RETURN_TYPES = ("STRING",)
def remote_widget(self, remote_widget_value: str):
return (remote_widget_value,)
class RemoteWidgetNodeWithRefreshButton:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"remote_widget_value": (
"COMBO",
{
"remote": {
"route": "/api/models/checkpoints",
"refresh_button": True,
},
},
),
},
}
FUNCTION = "remote_widget"
CATEGORY = "DevTools"
DESCRIPTION = "A node that lazily fetches options from a remote endpoint and has a refresh button to manually reload options"
RETURN_TYPES = ("STRING",)
def remote_widget(self, remote_widget_value: str):
return (remote_widget_value,)
class RemoteWidgetNodeWithControlAfterRefresh:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"remote_widget_value": (
"COMBO",
{
"remote": {
"route": "/api/models/checkpoints",
"refresh_button": True,
"control_after_refresh": "first",
},
},
),
},
}
FUNCTION = "remote_widget"
CATEGORY = "DevTools"
DESCRIPTION = "A node that lazily fetches options from a remote endpoint and has a refresh button to manually reload options and select the first option on refresh"
RETURN_TYPES = ("STRING",)
def remote_widget(self, remote_widget_value: str):
return (remote_widget_value,)
class NodeWithOutputCombo:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"subset_options": (["A", "B"], {"forceInput": True}),
"subset_options_v2": (
"COMBO",
{"options": ["A", "B"], "forceInput": True},
),
}
}
RETURN_TYPES = (["A", "B", "C"],)
FUNCTION = "node_with_output_combo"
CATEGORY = "DevTools"
DESCRIPTION = "A node that outputs a combo type"
def node_with_output_combo(self, subset_options: str):
return (subset_options,)
class MultiSelectNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"foo": (
"COMBO",
{
"options": ["A", "B", "C"],
"multi_select": {
"placeholder": "Choose foos",
"chip": True,
},
},
)
}
}
RETURN_TYPES = ("STRING",)
OUTPUT_IS_LIST = [True]
FUNCTION = "multi_select_node"
CATEGORY = "DevTools"
DESCRIPTION = "A node that outputs a multi select type"
def multi_select_node(self, foo: list[str]) -> list[str]:
return (foo,)
NODE_CLASS_MAPPINGS = {
"DevToolsRemoteWidgetNode": RemoteWidgetNode,
"DevToolsRemoteWidgetNodeWithParams": RemoteWidgetNodeWithParams,
"DevToolsRemoteWidgetNodeWithRefresh": RemoteWidgetNodeWithRefresh,
"DevToolsRemoteWidgetNodeWithRefreshButton": RemoteWidgetNodeWithRefreshButton,
"DevToolsRemoteWidgetNodeWithControlAfterRefresh": RemoteWidgetNodeWithControlAfterRefresh,
"DevToolsNodeWithOutputCombo": NodeWithOutputCombo,
"DevToolsMultiSelectNode": MultiSelectNode,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"DevToolsRemoteWidgetNode": "Remote Widget Node",
"DevToolsRemoteWidgetNodeWithParams": "Remote Widget Node With Sort Query Param",
"DevToolsRemoteWidgetNodeWithRefresh": "Remote Widget Node With 300ms Refresh",
"DevToolsRemoteWidgetNodeWithRefreshButton": "Remote Widget Node With Refresh Button",
"DevToolsRemoteWidgetNodeWithControlAfterRefresh": "Remote Widget Node With Refresh Button and Control After Refresh",
"DevToolsNodeWithOutputCombo": "Node With Output Combo",
"DevToolsMultiSelectNode": "Multi Select Node",
}
__all__ = [
"RemoteWidgetNode",
"RemoteWidgetNodeWithParams",
"RemoteWidgetNodeWithRefresh",
"RemoteWidgetNodeWithRefreshButton",
"RemoteWidgetNodeWithControlAfterRefresh",
"NodeWithOutputCombo",
"MultiSelectNode",
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
]