bizydraft 0.2.49__py3-none-any.whl → 0.2.87__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bizydraft might be problematic. Click here for more details.
- bizydraft/env.py +3 -0
- bizydraft/hijack_nodes.py +60 -42
- bizydraft/hijack_routes.py +36 -3
- bizydraft/oss_utils.py +231 -2
- bizydraft/patch_handlers.py +197 -8
- bizydraft/static/js/aiAppHandler.js +460 -425
- bizydraft/static/js/clipspaceToOss.js +386 -0
- bizydraft/static/js/disableComfyWebSocket.js +64 -0
- bizydraft/static/js/freezeModeHandler.js +425 -404
- bizydraft/static/js/handleStyle.js +128 -36
- bizydraft/static/js/hookLoad/configLoader.js +74 -0
- bizydraft/static/js/hookLoad/media.js +684 -0
- bizydraft/static/js/hookLoad/model.js +322 -0
- bizydraft/static/js/hookLoadMedia.js +196 -0
- bizydraft/static/js/hookLoadModel.js +207 -256
- bizydraft/static/js/main.js +2 -0
- bizydraft/static/js/nodeFocusHandler.js +118 -106
- bizydraft/static/js/nodeParamsFilter.js +91 -89
- bizydraft/static/js/postEvent.js +1207 -967
- bizydraft/static/js/socket.js +55 -50
- bizydraft/static/js/tool.js +71 -63
- bizydraft/static/js/uploadFile.js +49 -41
- bizydraft/static/js/workflow_io.js +193 -0
- {bizydraft-0.2.49.dist-info → bizydraft-0.2.87.dist-info}/METADATA +1 -1
- bizydraft-0.2.87.dist-info/RECORD +34 -0
- bizydraft/static/js/hookLoadImage.js +0 -177
- bizydraft-0.2.49.dist-info/RECORD +0 -28
- {bizydraft-0.2.49.dist-info → bizydraft-0.2.87.dist-info}/WHEEL +0 -0
- {bizydraft-0.2.49.dist-info → bizydraft-0.2.87.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { app } from "../../scripts/app.js";
|
|
2
|
-
import { $el } from "../../scripts/ui.js";
|
|
3
2
|
const styleMenus = `
|
|
4
|
-
|
|
3
|
+
/* 隐藏Panel内容容器,但排除选择工具箱 */
|
|
4
|
+
.p-panel:not(.selection-toolbox) .p-panel-content-container{
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
7
7
|
// .side-tool-bar-container.small-sidebar{
|
|
@@ -28,10 +28,11 @@ const styleMenus = `
|
|
|
28
28
|
#comfyui-body-bottom{
|
|
29
29
|
display: none;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
/* 隐藏左侧的工作流按钮 */
|
|
32
32
|
.p-button.p-component.p-button-icon-only.p-button-text.workflows-tab-button.side-bar-button.p-button-secondary{
|
|
33
33
|
display: none;
|
|
34
34
|
}
|
|
35
|
+
/* 隐藏左侧的输入输出按钮 */
|
|
35
36
|
.p-button.p-component.p-button-icon-only.p-button-text.mtb-inputs-outputs-tab-button.side-bar-button.p-button-secondary{
|
|
36
37
|
display: none;
|
|
37
38
|
}
|
|
@@ -56,46 +57,137 @@ const styleMenus = `
|
|
|
56
57
|
.side-tool-bar-container.small-sidebar .side-bar-button-label{
|
|
57
58
|
display: none;
|
|
58
59
|
}
|
|
60
|
+
/* 隐藏整个comfy-menu-button-wrapper元素 */
|
|
61
|
+
.comfy-menu-button-wrapper{
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
/* 隐藏帮助中心按钮 */
|
|
65
|
+
.comfy-help-center-btn{
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
/* 隐藏底部面板(Console)按钮 */
|
|
69
|
+
button[aria-label="底部面板"]{
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
/* 隐藏键盘快捷键按钮 */
|
|
73
|
+
button[aria-label^="键盘快捷键"]{
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
/* 隐藏右下角按钮组(包含鼠标指针、适应视图、缩放控制、小地图、隐藏链接等按钮) */
|
|
77
|
+
.p-buttongroup.absolute.right-0.bottom-0{
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
.pointer-events-auto.relative.w-full.h-10.bg-gradient-to-r.from-blue-600.to-blue-700.flex.items-center.justify-center.px-4 {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
.p-splitterpanel.p-splitterpanel-nested.flex.flex-col .ml-1.flex.pt-1{
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
.p-button.p-component.p-button-text.size-8.bg-primary-background.text-white.p-0{
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
.p-button.p-component.p-button-secondary.p-button-text.h-8.w-8.px-0{
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* 隐藏左侧的资产按钮 */
|
|
94
|
+
.p-button.p-component.p-button-icon-only.p-button-text.assets-tab-button.side-bar-button.p-button-secondary {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
/* 隐藏左侧的模型库按钮 */
|
|
98
|
+
.p-button.p-component.p-button-icon-only.p-button-text.model-library-tab-button.side-bar-button.p-button-secondary{
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
body .comfy-img-preview video{
|
|
102
|
+
width: 100%;
|
|
103
|
+
height: 100%;
|
|
104
|
+
}
|
|
105
|
+
button[aria-label^="设置 (Ctrl + ,)"]{
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
body .p-toast-message.p-toast-message-error{
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
body .bizyair-toaster-container{
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
.text-muted-foreground.bg-transparent.h-8.rounded-lg.p-2.text-xs.side-bar-button.cursor-pointer.border-none.templates-tab-button{
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
.text-muted-foreground.bg-transparent.h-8.rounded-lg.p-2.text-xs.side-bar-button.cursor-pointer.border-none.mtb-inputs-outputs-tab-button{
|
|
118
|
+
display: none;
|
|
119
|
+
}
|
|
120
|
+
.text-muted-foreground.bg-transparent.h-8.rounded-lg.p-2.text-xs.side-bar-button.cursor-pointer.border-none.workflows-tab-button{
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
.text-muted-foreground.bg-transparent.h-8.rounded-lg.p-2.text-xs.side-bar-button.cursor-pointer.border-none.assets-tab-button{
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
59
126
|
`;
|
|
60
127
|
app.registerExtension({
|
|
61
128
|
name: "comfy.BizyAir.Style",
|
|
62
129
|
async setup() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
130
|
+
const styleElement = document.createElement("style");
|
|
131
|
+
styleElement.textContent = styleMenus;
|
|
132
|
+
document.head.appendChild(styleElement);
|
|
67
133
|
const getCloseBtn = () => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
134
|
+
// let temp = null
|
|
135
|
+
// document.querySelectorAll('h2').forEach(e => {
|
|
136
|
+
// if (e.innerHTML == "<span>模板</span>") {
|
|
137
|
+
// const dialogContent = e.closest('.p-dialog-content')
|
|
138
|
+
// if (dialogContent) {
|
|
139
|
+
// temp = dialogContent.querySelector('i.pi.pi-times.text-sm')
|
|
140
|
+
// }
|
|
141
|
+
// }
|
|
142
|
+
// })
|
|
143
|
+
return document.querySelector("i.pi.pi-times.text-sm");
|
|
144
|
+
};
|
|
145
|
+
const getFengrossmentBtn = () => {
|
|
146
|
+
let temp = null;
|
|
147
|
+
document.querySelectorAll("button").forEach((e) => {
|
|
148
|
+
if (e.getAttribute("aria-label") == "专注模式 (F)") {
|
|
149
|
+
temp = e;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return temp;
|
|
153
|
+
};
|
|
76
154
|
let indexCloseLayout = 0;
|
|
77
155
|
let indexAddSmlBar = 0;
|
|
156
|
+
let indexFengrossment = 0;
|
|
78
157
|
let iTimer = setInterval(() => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}, 300)
|
|
158
|
+
indexCloseLayout++;
|
|
159
|
+
if (indexCloseLayout > 10) {
|
|
160
|
+
clearInterval(iTimer);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (getCloseBtn()) {
|
|
164
|
+
getCloseBtn().click();
|
|
165
|
+
clearInterval(iTimer);
|
|
166
|
+
}
|
|
167
|
+
}, 300);
|
|
89
168
|
let iTimerSmlBar = setInterval(() => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
169
|
+
indexAddSmlBar++;
|
|
170
|
+
if (indexAddSmlBar > 10) {
|
|
171
|
+
clearInterval(iTimerSmlBar);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (document.querySelector(".side-tool-bar-container")) {
|
|
175
|
+
document
|
|
176
|
+
.querySelector(".side-tool-bar-container")
|
|
177
|
+
.classList.add("small-sidebar");
|
|
178
|
+
clearInterval(iTimerSmlBar);
|
|
179
|
+
}
|
|
180
|
+
}, 300);
|
|
181
|
+
let iTimerFengrossment = setInterval(() => {
|
|
182
|
+
indexFengrossment++;
|
|
183
|
+
if (indexFengrossment > 10) {
|
|
184
|
+
clearInterval(iTimerFengrossment);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (getFengrossmentBtn()) {
|
|
188
|
+
getFengrossmentBtn().style.display = "none";
|
|
189
|
+
clearInterval(iTimerFengrossment);
|
|
190
|
+
}
|
|
191
|
+
}, 300);
|
|
192
|
+
},
|
|
101
193
|
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// 统一的配置加载器 - 合并 model.js 和 media.js 的配置请求
|
|
2
|
+
// 只发送一次 API 请求,同时获取 weight_load_nodes 和 media_load_nodes
|
|
3
|
+
|
|
4
|
+
// 统一的配置缓存
|
|
5
|
+
let fullConfigCache = null;
|
|
6
|
+
let configLoadPromise = null;
|
|
7
|
+
|
|
8
|
+
// API配置(统一使用一个域名,根据实际需要调整)
|
|
9
|
+
const CONFIG_API_URL =
|
|
10
|
+
"https://bizyair.cn/api/special/comfyagent_node_config?t=" +
|
|
11
|
+
Math.floor(Date.now() / 60000);
|
|
12
|
+
|
|
13
|
+
// 获取完整配置的API函数(返回包含 weight_load_nodes 和 media_load_nodes 的完整对象)
|
|
14
|
+
export async function fetchFullConfig() {
|
|
15
|
+
if (fullConfigCache) {
|
|
16
|
+
return fullConfigCache;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (configLoadPromise) {
|
|
20
|
+
return configLoadPromise;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
configLoadPromise = (async () => {
|
|
24
|
+
try {
|
|
25
|
+
console.log("正在从API获取完整节点配置...");
|
|
26
|
+
const response = await fetch(CONFIG_API_URL, { credentials: "include" });
|
|
27
|
+
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const result = await response.json();
|
|
33
|
+
|
|
34
|
+
if (result.code === 20000 && result.data) {
|
|
35
|
+
fullConfigCache = {
|
|
36
|
+
weight_load_nodes: result.data.weight_load_nodes || {},
|
|
37
|
+
media_load_nodes: result.data.media_load_nodes || {},
|
|
38
|
+
};
|
|
39
|
+
console.log("完整配置加载成功:", {
|
|
40
|
+
weight_nodes: Object.keys(fullConfigCache.weight_load_nodes).length,
|
|
41
|
+
media_nodes: Object.keys(fullConfigCache.media_load_nodes).length,
|
|
42
|
+
});
|
|
43
|
+
return fullConfigCache;
|
|
44
|
+
} else {
|
|
45
|
+
throw new Error("API返回数据格式不正确");
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error("获取完整配置失败:", error);
|
|
49
|
+
fullConfigCache = null;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
53
|
+
|
|
54
|
+
return configLoadPromise;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 获取模型节点配置(从完整配置中提取 weight_load_nodes)
|
|
58
|
+
export async function fetchNodeConfig() {
|
|
59
|
+
const fullConfig = await fetchFullConfig();
|
|
60
|
+
return fullConfig ? fullConfig.weight_load_nodes : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 获取媒体节点配置(从完整配置中提取 media_load_nodes)
|
|
64
|
+
export async function fetchMediaConfig() {
|
|
65
|
+
const fullConfig = await fetchFullConfig();
|
|
66
|
+
return fullConfig ? fullConfig.media_load_nodes : null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 启动时后台预取(不阻塞后续逻辑)
|
|
70
|
+
try {
|
|
71
|
+
void fetchFullConfig();
|
|
72
|
+
} catch (e) {
|
|
73
|
+
/* noop */
|
|
74
|
+
}
|