bizydraft 0.1.6__py3-none-any.whl → 0.1.8__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.

@@ -31,9 +31,6 @@ const styleMenus = `
31
31
  #comfyui-body-bottom{
32
32
  display: none;
33
33
  }
34
- // .p-dialog-mask.p-overlay-mask.p-overlay-mask-enter{
35
- // display: none !important;
36
- // }
37
34
  `
38
35
  app.registerExtension({
39
36
  name: "comfy.BizyAir.Style",
@@ -1,9 +1,4 @@
1
1
  import { app } from "../../scripts/app.js";
2
- // import { $el } from "../../scripts/ui.js";
3
-
4
- // import { WebSocketClient } from './socket.js';
5
-
6
-
7
2
 
8
3
  app.registerExtension({
9
4
  name: "comfy.BizyAir.Socket",
@@ -14,11 +9,7 @@ app.registerExtension({
14
9
 
15
10
  customSocket(callback, customUrl) {
16
11
  const url = customUrl || app.api.socket.url;
17
- // const clientId = 'e07abdf5f465462f8dc43ca0812e9284';
18
- // const socket = new WebSocket(url + "?clientId=" + sessionStorage.getItem("clientId"));
19
- // const socket = new WebSocket(url + "?clientId=" + clientId);
20
12
  const socket = new WebSocket(url);
21
-
22
13
  const dispatchCustomEvent = this.dispatchCustomEvent;
23
14
 
24
15
  socket.onmessage = function (event) {
@@ -62,18 +53,22 @@ app.registerExtension({
62
53
  }
63
54
  } else {
64
55
  const msg = JSON.parse(event.data);
56
+ window.parent.postMessage({
57
+ type: 'functionResult',
58
+ method: 'progress_info_change',
59
+ result: msg.progress_info
60
+ }, '*');
65
61
  switch (msg.type) {
66
62
  case 'status':
67
63
  if (msg.data.sid) {
68
64
  const clientId = msg.data.sid;
69
- window.name = clientId; // use window name so it isnt reused when duplicating tabs
70
- sessionStorage.setItem('clientId', clientId); // store in session storage so duplicate tab can load correct workflow
65
+ window.name = clientId;
66
+ sessionStorage.setItem('clientId', clientId);
71
67
  socket.clientId = clientId;
72
68
  }
73
69
  dispatchCustomEvent('status', msg.data.status ?? null);
74
70
  break;
75
71
  case 'executing':
76
- // msg.data.prompt_id && (msg.data.prompt_id = '');
77
72
 
78
73
  dispatchCustomEvent(
79
74
  'executing',
@@ -180,46 +175,19 @@ app.registerExtension({
180
175
  const parts = value.split(`; ${name}=`);
181
176
  if (parts.length === 2) return parts.pop().split(';').shift();
182
177
  },
183
- // doSendSocket() {
184
- // const socket = new WebSocketClient(`/w/v1/comfy/draft/ws?clientId=${sessionStorage.getItem("clientId")
185
- // }&userId=${this.getCookie("user_id")
186
- // }`);
187
- // const customSocket = this.customSocket.bind(this);
188
- // socket.on('message', (message) => {
189
- // let data = JSON.parse(message.data);
190
- // if (data.status == "Running") {
191
- // customSocket(() => {}, data.wsUrl);
192
- // }
193
- // });
194
- // },
195
178
 
196
179
 
197
180
  async setup() {
181
+
182
+
198
183
  const customSocket = this.customSocket.bind(this);
199
184
  const startSocket = this.startSocket.bind(this);
200
185
  const closeSocket = this.closeSocket.bind(this);
201
186
  const changeSocketUrl = this.changeSocketUrl.bind(this);
202
187
  const sendSocketMessage = this.sendSocketMessage.bind(this);
203
- // let iTimer = null;
204
-
205
- // // 直接检查一次
206
- // const initialUserId = this.getCookie("user_id");
207
- // if (initialUserId) {
208
- // // 初始检查到 userId
209
- // this.doSendSocket();
210
- // }
211
-
212
- // // 使用定时器监听cookie变化
213
- // let lastCookieValue = this.getCookie("user_id");
214
- // iTimer = setInterval(() => {
215
- // const currentCookieValue = this.getCookie("user_id");
216
- // if (currentCookieValue && currentCookieValue !== lastCookieValue) {
217
- // // 检测到 cookie user_id 变化
218
- // lastCookieValue = currentCookieValue;
219
- // this.doSendSocket();
220
- // clearInterval(iTimer);
221
- // }
222
- // }, 300); // 每秒检查一次
188
+
189
+ // 设置节点事件
190
+ // setupNodeEvents();
223
191
 
224
192
  const methods = {
225
193
  customSocket: function (params) {
@@ -373,17 +341,11 @@ app.registerExtension({
373
341
  };
374
342
  console.log("-----------setCookie-----------", params)
375
343
  setCookie(params.name, params.value, params.days);
376
- // window.parent.postMessage({
377
- // type: 'functionResult',
378
- // method: 'setCookie',
379
- // result: true
380
- // }, '*');
344
+
381
345
  return true;
382
346
  },
383
347
  fitView: function () {
384
- // window.app.canvas.ds.offset = [0, 0];
385
- // window.app.canvas.ds.scale = 1;
386
- // window.app.canvas.setDirty(true, true);
348
+
387
349
  app.canvas.fitViewToSelectionAnimated()
388
350
 
389
351
  window.parent.postMessage({
@@ -392,6 +354,55 @@ app.registerExtension({
392
354
  result: true
393
355
  }, '*');
394
356
  return true;
357
+ },
358
+ clickAssistant: function () {
359
+ const assistantBtn = document.querySelector('.btn-assistant');
360
+ if (assistantBtn) {
361
+ assistantBtn.click();
362
+ window.parent.postMessage({
363
+ type: 'functionResult',
364
+ method: 'clickAssistant',
365
+ result: true
366
+ }, '*');
367
+ return true;
368
+ } else {
369
+ console.warn('Assistant button not found');
370
+ window.parent.postMessage({
371
+ type: 'functionResult',
372
+ method: 'clickAssistant',
373
+ result: false
374
+ }, '*');
375
+ return false;
376
+ }
377
+ },
378
+ clickCommunity: function () {
379
+ const communityBtn = document.querySelectorAll('.bizyair-menu-content .cursor-pointer.relative.px-3.rounded-sm')[1];
380
+ if (communityBtn) {
381
+ communityBtn.click();
382
+ window.parent.postMessage({
383
+ type: 'functionResult',
384
+ method: 'clickCommunity',
385
+ result: true
386
+ }, '*');
387
+ return true;
388
+ } else {
389
+ window.parent.postMessage({
390
+ type: 'functionResult',
391
+ method: 'clickCommunity',
392
+ result: false
393
+ }, '*');
394
+ return false;
395
+ }
396
+ },
397
+ toPublish: async function () {
398
+ const graph = await app.graphToPrompt();
399
+ window.parent.postMessage({
400
+ type: 'functionResult',
401
+ method: 'toPublish',
402
+ result: graph.workflow
403
+ }, '*');
404
+ return graph.workflow;
405
+
395
406
  }
396
407
  };
397
408
 
@@ -400,10 +411,17 @@ app.registerExtension({
400
411
  const methodName = event.data.method;
401
412
  const params = event.data.params || {};
402
413
 
414
+
403
415
  if (methods[methodName]) {
404
416
  methods[methodName](params);
405
417
  } else {
406
418
  console.error('方法不存在:', methodName);
419
+ window.parent.postMessage({
420
+ type: 'functionResult',
421
+ method: methodName,
422
+ error: `方法 ${methodName} 不存在`,
423
+ success: false
424
+ }, '*');
407
425
  }
408
426
  }
409
427
  });
@@ -76,15 +76,6 @@ export class WebSocketClient {
76
76
  this.startKeepAlive()
77
77
  }
78
78
 
79
- onMessage(message) {
80
- message
81
- // const data = JSON.parse(message.data);
82
- // if (data === 'pong') {
83
- // // Do nothing
84
- // } else {
85
- // console.log('message:', data);
86
- // }
87
- }
88
79
 
89
80
  onError(error) {
90
81
  console.error('WebSocket Error: ', error)
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bizydraft
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: bizydraft
@@ -3,14 +3,14 @@ bizydraft/hijack_nodes.py,sha256=xPVLBBnRiJaI8ZbR80O8W4C9SlNAp7MxP7dKj_pRlYs,869
3
3
  bizydraft/hijack_routes.py,sha256=tzSIY-3wLiwoHALf7MswjAF5FqDSmXynGjpfTgRdkxE,6138
4
4
  bizydraft/resp.py,sha256=8INvKOe5Dgai3peKfqKjrhUoYeuXWXn358w30-_cY-A,369
5
5
  bizydraft/server.py,sha256=ES1fBYr_Ufv_YWsynLck1ln9bXTGjK3KXas1CK9WBqM,1358
6
- bizydraft/static/js/handleStyle.js,sha256=rfw5G_RfENNnwQOaGQyT8vLSMRt51JcPbsGd6itAv1Y,1272
6
+ bizydraft/static/js/handleStyle.js,sha256=WDaMQSaZrij10pyXbQ3jinWjhb6iTt_6iQclgbnr3qc,1167
7
7
  bizydraft/static/js/hookLoadImage.js,sha256=cEaqedTnngieI-Kb0PVgLor1nVDkFQx1_7AiurwtRwI,3878
8
8
  bizydraft/static/js/main.js,sha256=cZ-7wR9T8aNLzIrTjc-g9xVZf7z6TXWl1zhP_wXSSVo,150
9
- bizydraft/static/js/postEvent.js,sha256=4PVl929jU1m3ooKA1lFXNWgv62mtKAFnhqbsHVBUYi8,16488
10
- bizydraft/static/js/socket.js,sha256=iNxbUPSQluIlx1x0MIVL7UJ35BXqLH7Z2s8vmfmbyyc,2643
9
+ bizydraft/static/js/postEvent.js,sha256=cmwycxslbbvRAvzT0Vp_rVZh46WNrskcQydcmTrsnw8,16809
10
+ bizydraft/static/js/socket.js,sha256=q_SWsySJdVV7ZTH-3Pdr09pkWGQj08C9xVAQES7eJaU,2440
11
11
  bizydraft/static/js/tool.js,sha256=IlDVjddodT9DtfdIGiIzSIKdxbUMztDLQ4jI0uFJCwk,206
12
12
  bizydraft/static/js/uploadFile.js,sha256=7PXMYRlgxgDWFFbsaasjf3TelsW6r9mD1TFTjQI6X0E,4957
13
- bizydraft-0.1.6.dist-info/METADATA,sha256=cjpKUrIR9Pt-pvxP6yb94TgtyQqhFKJtVJ2FF_UMXWc,72
14
- bizydraft-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- bizydraft-0.1.6.dist-info/top_level.txt,sha256=XtoBq6hjZhXIM7aas4GtPDtAiKo8FdLzMABXW8qqQ8M,10
16
- bizydraft-0.1.6.dist-info/RECORD,,
13
+ bizydraft-0.1.8.dist-info/METADATA,sha256=0V9HmiDXuwHhrmxQO0vqlTz5cL6JRzxriV-vhERD5uQ,72
14
+ bizydraft-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ bizydraft-0.1.8.dist-info/top_level.txt,sha256=XtoBq6hjZhXIM7aas4GtPDtAiKo8FdLzMABXW8qqQ8M,10
16
+ bizydraft-0.1.8.dist-info/RECORD,,