Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
C
ComfyUI
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
锁定的文件
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
hanamizuki
ComfyUI
提交
b9daf4e3
提交
b9daf4e3
编辑于
1 year ago
作者:
comfyanonymous
浏览文件
操作
下载
补丁
差异文件
Add a /object_info/{node_class} route to get only the info of one node.
上级
e6e1999f
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
server.py
+24
-13
24 个添加, 13 个删除
server.py
有
24 个添加
和
13 个删除
server.py
+
24
−
13
浏览文件 @
b9daf4e3
...
...
@@ -261,23 +261,34 @@ class PromptServer():
async
def
get_prompt
(
request
):
return
web
.
json_response
(
self
.
get_queue_info
())
def
node_info
(
node_class
):
obj_class
=
nodes
.
NODE_CLASS_MAPPINGS
[
node_class
]
info
=
{}
info
[
'
input
'
]
=
obj_class
.
INPUT_TYPES
()
info
[
'
output
'
]
=
obj_class
.
RETURN_TYPES
info
[
'
output_is_list
'
]
=
obj_class
.
OUTPUT_IS_LIST
if
hasattr
(
obj_class
,
'
OUTPUT_IS_LIST
'
)
else
[
False
]
*
len
(
obj_class
.
RETURN_TYPES
)
info
[
'
output_name
'
]
=
obj_class
.
RETURN_NAMES
if
hasattr
(
obj_class
,
'
RETURN_NAMES
'
)
else
info
[
'
output
'
]
info
[
'
name
'
]
=
node_class
info
[
'
display_name
'
]
=
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
[
node_class
]
if
node_class
in
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
.
keys
()
else
node_class
info
[
'
description
'
]
=
''
info
[
'
category
'
]
=
'
sd
'
if
hasattr
(
obj_class
,
'
CATEGORY
'
):
info
[
'
category
'
]
=
obj_class
.
CATEGORY
return
info
@routes.get
(
"
/object_info
"
)
async
def
get_object_info
(
request
):
out
=
{}
for
x
in
nodes
.
NODE_CLASS_MAPPINGS
:
obj_class
=
nodes
.
NODE_CLASS_MAPPINGS
[
x
]
info
=
{}
info
[
'
input
'
]
=
obj_class
.
INPUT_TYPES
()
info
[
'
output
'
]
=
obj_class
.
RETURN_TYPES
info
[
'
output_is_list
'
]
=
obj_class
.
OUTPUT_IS_LIST
if
hasattr
(
obj_class
,
'
OUTPUT_IS_LIST
'
)
else
[
False
]
*
len
(
obj_class
.
RETURN_TYPES
)
info
[
'
output_name
'
]
=
obj_class
.
RETURN_NAMES
if
hasattr
(
obj_class
,
'
RETURN_NAMES
'
)
else
info
[
'
output
'
]
info
[
'
name
'
]
=
x
info
[
'
display_name
'
]
=
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
[
x
]
if
x
in
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
.
keys
()
else
x
info
[
'
description
'
]
=
''
info
[
'
category
'
]
=
'
sd
'
if
hasattr
(
obj_class
,
'
CATEGORY
'
):
info
[
'
category
'
]
=
obj_class
.
CATEGORY
out
[
x
]
=
info
out
[
x
]
=
node_info
(
x
)
return
web
.
json_response
(
out
)
@routes.get
(
"
/object_info/{node_class}
"
)
async
def
get_object_info_node
(
request
):
node_class
=
request
.
match_info
.
get
(
"
node_class
"
,
None
)
out
=
{}
if
(
node_class
is
not
None
)
and
(
node_class
in
nodes
.
NODE_CLASS_MAPPINGS
):
out
[
node_class
]
=
node_info
(
node_class
)
return
web
.
json_response
(
out
)
@routes.get
(
"
/history
"
)
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录