Text-to-Image
Diffusers
lora
template:diffusion-lora
bobina
Bobina
Council
Ethereum
Base
bobina.moe
Bobina_Council
Instructions to use bobinamoe/bobinas with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bobinamoe/bobinas with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("fill-in-base-model", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("bobinamoe/bobinas") prompt = "Bobina in the trenches of Ukraine, she is holding a classic AK47. She is firing in the trenches at an unknown Ukrainian pig for Mother Russia! The rifle is visibly inscribed bobina.moe on the gun stock." image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 46,720 Bytes
baac5bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 | import { app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js";
const spinner = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/>
<path fill="currentColor" d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
<animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/>
</path>
</svg>`
const style = `
.cpack-tree-list {
max-height: 300px;
overflow-y: auto;
border: 1px solid #444;
border-radius: 4px;
padding: 5px;
}
.cpack-tree-item {
padding: 3px 0;
}
.cpack-tree-item label {
display: flex;
align-items: center;
gap: 5px;
min-height: 20px;
}
.cpack-tree-children {
margin-left: 12px;
}
.cpack-tree-toggle {
width: 12px;
height: 12px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
color: #888;
font-size: 0.8em;
min-width: 12px;
}
.cpack-tree-toggle:hover {
color: #fff;
}
.cpack-tree-toggle.empty {
visibility: hidden;
}
.cpack-modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #1a1a1a;
padding: 20px;
border-radius: 8px;
z-index: 1000;
color: white;
min-width: 360px;
}
.cpack-input {
width: 100%;
padding: 8px;
background: #333;
border: 1px solid #444;
border-radius: 4px;
color: white;
box-sizing: border-box;
}
.cpack-btn {
padding: 6px 12px;
background: #666;
border: none;
border-radius: 4px;
color: white;
cursor: pointer;
}
.cpack-btn.primary {
background: #00a67d;
}
.cpack-btn.primary:disabled {
background: #81a39b;
cursor: not-allowed;
}
.cpack-btn-container {
margin-top: 20px;
display: flex;
justify-content: flex-end;
gap: 10px;
}
.cpack-title {
margin-bottom: 15px;
font-size: 1.3em;
font-weight: bold;
}
.cpack-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
}
.cpack-input-row {
display: flex;
align-items: center;
gap: 5px;
margin-bottom: 5px;
}
.cpack-form-item {
margin-bottom: 15px;
}
.cpack-form-item:last-child {
margin-bottom: -5px;
}
.cpack-form-item label {
margin-bottom: 5px;
}
.cpack-form-item.required label::after {
content: "*";
color: #ff8383;
}
#build-info {
display: flex;
padding: 10px;
flex-direction: column;
align-items: center;
}
#build-error {
display: none;
color: #ff8383;
text-wrap: auto;
overflow-x: auto;
background: #333;
padding: 10px;
}
.cpack-copyable {
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
}
.cpack-copyable > span {
border: 1px solid #ccc;
padding: 3px 10px;
border-radius: 3px;
background: #606060;
}
.error-message {
color: #ff8383;
margin-top: 5px;
display: none;
font-size: 0.9em;
}
`
class TreeState {
constructor() {
this.selectedFiles = new Set();
this.subscribers = new Set();
}
subscribe(callback) {
this.subscribers.add(callback);
return () => this.subscribers.delete(callback);
}
notify() {
this.subscribers.forEach(callback => callback(this.selectedFiles));
}
toggle(path, checked) {
if (checked) {
this.selectedFiles.add(path);
} else {
this.selectedFiles.delete(path);
}
this.notify();
}
toggleMultiple(paths, checked) {
paths.forEach(path => {
if (checked) {
this.selectedFiles.add(path);
} else {
this.selectedFiles.delete(path);
}
});
this.notify();
}
isSelected(path) {
return this.selectedFiles.has(path);
}
clear() {
this.selectedFiles.clear();
this.notify();
}
getSelectedCount() {
return this.selectedFiles.size;
}
getSelectedFiles() {
return Array.from(this.selectedFiles);
}
}
class FileTreeList {
constructor(container, countId) {
this.container = container;
this.countId = countId;
this.state = new TreeState();
this.init();
}
init() {
this.container.classList.add('cpack-tree-list');
this.state.subscribe(() => this.updateCount());
}
async load() {
try {
const { workflow, output: workflow_api } = await app.graphToPrompt();
const files = await this.getInputFiles(workflow, workflow_api);
// 预先将默认选中的文件添加到选中列表
files.forEach(file => {
const path = file.path || file;
if (file.checked) {
this.state.toggle(path, true);
}
});
this.renderTree(this.buildTree(files));
// 更新所有父目录的状态
this.container.querySelectorAll("[data-action='check-dir']").forEach(checkbox => {
this.updateFolderState(checkbox);
});
// 更新总数
this.updateCount();
} catch(e) {
this.container.innerHTML = `<div style="color: #ff8383">Failed to load files: ${e.message}</div>`;
}
}
async getInputFiles(workflow, workflow_api) {
const resp = await api.fetchApi("/bentoml/file/query", {
method: "POST",
body: JSON.stringify({ workflow, workflow_api }),
headers: { "Content-Type": "application/json" }
});
const data = await resp.json();
return Array.isArray(data) ? data : (data.files || []);
}
buildTree(files) {
const root = { name: 'root', children: {}, files: [] };
for (const file of files) {
const filePath = file.path || file;
const parts = filePath.split(/[\/\\]/);
let current = root;
for (let i = 0; i < parts.length; i++) {
const part = parts[i];
if (i === parts.length - 1) {
// 这是文件
current.files.push({
name: part,
path: file.path || file,
badges: file.badges || [],
checked: file.checked || false
});
// 对文件按名称排序
current.files.sort((a, b) => a.name.localeCompare(b.name));
} else {
// 这是目录
if (!current.children[part]) {
current.children[part] = {
name: part,
children: {},
files: []
};
}
current = current.children[part];
}
}
}
// 对目录按名称排序
for (const dir in root.children) {
root.children[dir].files.sort((a, b) => a.name.localeCompare(b.name));
}
return root;
}
renderTree(node, level = 0) {
const dirs = Object.values(node.children);
const hasChildren = dirs.length > 0 || node.files.length > 0;
this.container.innerHTML = this.renderNode(node, true);
this.setupEventListeners();
this.updateCount();
}
renderNode(node, isRoot = false) {
const dirs = Object.values(node.children);
const hasChildren = dirs.length > 0 || node.files.length > 0;
let html = '';
if (!isRoot) {
html += `
<div class="cpack-tree-item">
<label>
<span class="cpack-tree-toggle ${hasChildren ? '' : 'empty'}" data-action="toggle">
${hasChildren ? '▶' : '▶'}
</span>
<input type="checkbox" data-action="check-dir" data-path="${node.name}" />
<span>${node.name}/</span>
</label>
</div>
`;
}
if (hasChildren) {
html += `<div class="cpack-tree-children" style="display: ${isRoot ? '' : 'none'}">`;
// 渲染子目录
for (const dir of dirs) {
html += this.renderNode(dir);
}
// 渲染文件
for (const file of node.files) {
html += `
<div class="cpack-tree-item">
<label style="padding-left: 17px">
<input type="checkbox" name="files" value="${file.path}"
${this.state.isSelected(file.path) || file.checked ? 'checked' : ''} />
<span>${file.name}</span>
${file.badges ? file.badges.map(badge =>
`<span style="background: ${badge.color || '#00a67d33'};
color: ${badge.textColor || '#00a67d'};
padding: 2px 6px;
border-radius: 4px;
font-size: 0.8em;
cursor: help;
white-space: nowrap;"
title="${badge.tooltip || ''}">${badge.text}</span>`
).join('') : ''}
</label>
</div>
`;
}
html += '</div>';
}
return html;
}
updateFolderState(folderCheckbox) {
const treeItem = folderCheckbox.closest('.cpack-tree-item');
const children = treeItem.nextElementSibling;
if (!children) return;
const childFiles = children.querySelectorAll("input[name='files']");
const checkedCount = Array.from(childFiles).filter(cb => cb.checked).length;
if (checkedCount === 0) {
folderCheckbox.checked = false;
folderCheckbox.indeterminate = false;
} else if (checkedCount === childFiles.length) {
folderCheckbox.checked = true;
folderCheckbox.indeterminate = false;
} else {
folderCheckbox.checked = false;
folderCheckbox.indeterminate = true;
}
// 递归更新父文件夹状态
const parentFolder = treeItem.parentElement.closest('.cpack-tree-item');
if (parentFolder) {
const parentCheckbox = parentFolder.querySelector("[data-action='check-dir']");
if (parentCheckbox) {
this.updateFolderState(parentCheckbox);
}
}
// 更新选中文件总数
this.updateCount();
}
setupEventListeners() {
// 目录选择功能
this.container.querySelectorAll("[data-action='check-dir']").forEach(checkbox => {
checkbox.addEventListener('change', (e) => {
const treeItem = e.target.closest('.cpack-tree-item');
const children = treeItem.nextElementSibling;
if (children) {
const childFiles = Array.from(children.querySelectorAll("input[name='files']"))
.map(input => input.value);
this.state.toggleMultiple(childFiles, e.target.checked);
// 更新UI
children.querySelectorAll("input[type='checkbox']").forEach(child => {
child.checked = e.target.checked;
if (child.hasAttribute('data-action')) {
child.indeterminate = false;
}
});
}
});
});
// 折叠功能
this.container.querySelectorAll("[data-action='toggle']").forEach(toggle => {
toggle.addEventListener('click', (e) => {
e.preventDefault();
e.stopPropagation();
const treeItem = e.target.closest('.cpack-tree-item');
const children = treeItem.nextElementSibling;
if (children) {
children.style.display = children.style.display === 'none' ? '' : 'none';
e.target.textContent = children.style.display === 'none' ? '▶' : '▼';
}
});
});
// 文件选择功能
this.container.querySelectorAll("input[name='files']").forEach(checkbox => {
checkbox.addEventListener('change', (e) => {
this.state.toggle(e.target.value, e.target.checked);
// 更新父文件夹状态
const parentFolder = checkbox.closest('.cpack-tree-children')
?.previousElementSibling
?.querySelector("[data-action='check-dir']");
if (parentFolder) {
this.updateFolderState(parentFolder);
}
});
});
}
updateCount() {
const countSpan = document.querySelector(`[data-files-count='${this.countId}']`);
if (countSpan) {
countSpan.textContent = this.state.getSelectedCount();
}
}
getSelectedFiles() {
return this.state.getSelectedFiles();
}
}
class ModelList {
constructor(container, countId) {
this.container = container;
this.countId = countId;
this.selectedModels = new Set();
this.init();
}
init() {
this.container.style.cssText = `
max-height: 300px;
overflow-y: auto;
border: 1px solid #444;
border-radius: 4px;
padding: 5px;
`;
}
async load() {
try {
const { workflow, output: workflow_api } = await app.graphToPrompt();
const resp = await api.fetchApi("/bentoml/model/query", {
method: "POST",
body: JSON.stringify({ workflow, workflow_api }),
headers: { "Content-Type": "application/json" }
});
const data = await resp.json();
const models = Array.isArray(data) ? data : (data.models || []);
this.renderModels(this.sortModels(models));
} catch(e) {
this.container.innerHTML = `<div style="color: #ff8383">Failed to load models: ${e.message}</div>`;
}
}
sortModels(models) {
return models.sort((a, b) => {
if (a.refered && !b.refered) return -1;
if (!a.refered && b.refered) return 1;
const timeA = Math.max(a.atime || 0, a.ctime || 0);
const timeB = Math.max(b.atime || 0, b.ctime || 0);
return timeB - timeA;
});
}
renderModels(models) {
const now = Date.now() / 1000;
const ONE_DAY = 24 * 60 * 60;
this.container.innerHTML = this.getSelectAllHtml() +
models.map(model => this.getModelItemHtml(model, now, ONE_DAY)).join('');
this.setupEventListeners();
this.updateCount();
}
getSelectAllHtml() {
return `
<div style="padding: 6px 0; border-bottom: 1px solid #444; margin-bottom: 5px;">
<label style="display: flex; align-items: center;">
<input type="checkbox" id="select-all-models" style="margin-right: 8px;" />
<span>Select All</span>
</label>
</div>
`;
}
getModelItemHtml(model, now, ONE_DAY) {
const size = (model.size / (1024 * 1024)).toFixed(2);
const path = String(model.filename || '');
const name = path ? path.split('/').pop() : 'Unknown';
const isRecentlyAccessed = (now - (model.atime || 0)) < ONE_DAY;
return `
<div style="padding: 6px 0; border-bottom: 1px solid #333;">
<label style="display: flex; align-items: flex-start;">
<input type="checkbox" name="models" value="${path}"
style="margin-top: 4px;"
${isRecentlyAccessed || model.refered ? 'checked' : ''} />
<div style="margin-left: 8px;">
<div style="display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto;">
<div style="font-weight: bold; white-space: nowrap;">${name}</div>
${isRecentlyAccessed ? `<span style="background: #00a67d33; color: #00a67d; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; cursor: help; white-space: nowrap;" title="Accessed in ${Math.round((now - (model.atime || 0)) / 3600)} hours">Recent</span>` : ''}
${model.refered ? `<span style="background: #a67d0033; color: #a67d00; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; cursor: help; white-space: nowrap;" title="Mentioned in node inputs">Referenced</span>` : ''}
</div>
<div style="display: flex; align-items: center; gap: 8px; margin-top: 4px;">
<div style="color: #888; font-size: 0.9em; flex: 1; overflow-x: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px;">
<span style="background: #333; padding: 2px 6px; border-radius: 4px; display: flex; align-items: center; gap: 4px; white-space: nowrap;">
<svg style="width: 14px; height: 14px; min-width: 14px;" viewBox="0 0 24 24">
<path fill="currentColor" d="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z" />
</svg>
${model.size ? `${size} MB` : 'Unknown size'}
</span>
<span style="overflow: hidden; text-overflow: ellipsis;" title="${path}">${path.substring(0, path.lastIndexOf('/') + 1)}</span>
</div>
</div>
</div>
</label>
</div>
`;
}
setupEventListeners() {
this.container.querySelectorAll("input[name='models']").forEach(checkbox => {
checkbox.addEventListener('change', () => this.updateCount());
});
const selectAllCheckbox = this.container.querySelector("#select-all-models");
selectAllCheckbox?.addEventListener('change', (e) => {
this.container.querySelectorAll("input[name='models']").forEach(checkbox => {
checkbox.checked = e.target.checked;
});
this.updateCount();
});
}
updateCount() {
const count = this.container.querySelectorAll("input[name='models']:checked").length;
const countSpan = document.querySelector(`[data-models-count='${this.countId}']`);
if (countSpan) {
countSpan.textContent = count;
}
}
getSelectedModels() {
// 只返回用户选中的模型
return Array.from(this.container.querySelectorAll("input[name='models']:checked"))
.map(input => input.value);
}
}
function createModal(modal) {
const overlay = document.createElement("div");
overlay.className = "cpack-overlay";
document.body.appendChild(overlay);
document.body.appendChild(modal);
return {
close: () => {
modal.remove();
overlay.remove();
}
};
}
async function createPackModal() {
return new Promise((resolve) => {
const modal = document.createElement("div");
modal.className = "cpack-modal";
modal.id = "input-modal";
const title = document.createElement("div");
title.textContent = "Package Workflow";
title.className = "cpack-title";
const form = document.createElement("form");
form.innerHTML = `
<div class="cpack-form-item">
<label for="filename">Name</label>
<input type="text" class="cpack-input" name="filename" value="${localStorage.getItem('cpack-bento-name') || 'comfy-pack-pkg'}" />
</div>
<div id="package-options-container"></div>
`;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const confirmButton = document.createElement("button");
confirmButton.textContent = "Pack";
confirmButton.className = "cpack-btn primary";
confirmButton.disabled = true;
const cancelButton = document.createElement("button");
cancelButton.textContent = "Cancel";
cancelButton.className = "cpack-btn";
buttonContainer.appendChild(cancelButton);
buttonContainer.appendChild(confirmButton);
modal.appendChild(title);
modal.appendChild(form);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
const packageOptionsContainer = form.querySelector("#package-options-container");
const packageOptions = new PackageOptions(form, "pack-models-list", "pack-files-list", true);
packageOptionsContainer.innerHTML = packageOptions.getHtml();
packageOptions.init().then(() => {
confirmButton.disabled = false;
});
confirmButton.onclick = () => {
const filename = form.querySelector("input[name='filename']").value.trim();
if (filename) {
// Save filename to localStorage
localStorage.setItem('cpack-bento-name', filename);
const selectedData = packageOptions.getSelectedData();
close();
resolve({
filename,
models: selectedData.models,
files: selectedData.files,
systemPackages: selectedData.systemPackages
});
}
};
cancelButton.onclick = () => {
close();
resolve(null);
};
const filenameInput = form.querySelector("input[name='filename']");
filenameInput.addEventListener("keyup", (e) => {
if (e.key === "Enter") {
confirmButton.click();
}
});
filenameInput.select();
});
}
function createDownloadModal() {
const modal = document.createElement("div");
modal.className = "cpack-modal";
modal.id = "download-modal";
const title = document.createElement("div");
title.textContent = "Packaging...";
title.style.marginBottom = "15px";
title.style.color = "#fff";
const hint = document.createElement("div");
hint.textContent = "First run may take a few minutes to compute model checksums, depending on the number of models.";
hint.style.cssText = "color: #888; font-size: 0.9em; margin-bottom: 15px;";
const progress = document.createElement("div");
progress.style.cssText = `
width: 100%;
height: 20px;
background: #333;
border-radius: 10px;
overflow: hidden;
`;
const progressBar = document.createElement("div");
progressBar.style.cssText = `
width: 0%;
height: 100%;
background: #00a67d;
transition: width 0.3s ease;
`;
progress.appendChild(progressBar);
modal.appendChild(title);
modal.appendChild(hint);
modal.appendChild(progress);
const { close } = createModal(modal);
return {
updateProgress: (percent) => {
progressBar.style.width = `${percent}%`;
},
close
};
}
async function unpackAction() {
const modal = document.createElement("div");
modal.className = "cpack-modal";
modal.style.width = "500px";
const title = document.createElement("div");
title.textContent = "Unpack Instructions";
title.className = "cpack-title";
const content = document.createElement("div");
content.innerHTML = `
<div style="margin-bottom: 20px;">
<p style="margin-bottom: 15px;">To unpack a workflow package, follow these steps:</p>
<div style="margin-bottom: 15px;">
<p style="margin-bottom: 10px;">1. Install comfy-pack CLI:</p>
<div class="cpack-copyable" style="margin: 10px 0;">
<span style="font-family: monospace;">pip install comfy-pack</span>
<button class="cpack-btn" onclick="navigator.clipboard.writeText('pip install comfy-pack')" style="padding: 2px 8px;">
Copy
</button>
</div>
</div>
<div>
<p style="margin-bottom: 10px;">2. Run the unpack command:</p>
<div class="cpack-copyable" style="margin: 10px 0;">
<span style="font-family: monospace;">comfy-pack unpack <your-app>.cpack.zip</span>
<button class="cpack-btn" onclick="navigator.clipboard.writeText('comfy-pack unpack')" style="padding: 2px 8px;">
Copy
</button>
</div>
</div>
</div>
`;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const closeButton = document.createElement("button");
closeButton.textContent = "Close";
closeButton.className = "cpack-btn";
buttonContainer.appendChild(closeButton);
modal.appendChild(title);
modal.appendChild(content);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
closeButton.onclick = close;
}
async function packageAction() {
if (document.getElementById("input-modal")) return;
if (document.getElementById("download-modal")) return;
const result = await createPackModal();
if (!result) return;
const downloadModal = createDownloadModal();
try {
downloadModal.updateProgress(20);
const { workflow, output: workflow_api } = await app.graphToPrompt();
downloadModal.updateProgress(40);
const body = JSON.stringify({
workflow,
workflow_api,
models: result.models,
files: result.files,
system_packages: result.systemPackages
});
downloadModal.updateProgress(60);
const resp = await api.fetchApi("/bentoml/pack", { method: "POST", body, headers: { "Content-Type": "application/json" } });
downloadModal.updateProgress(80);
const downloadUrl = (await resp.json())["download_url"];
downloadModal.updateProgress(100);
const link = document.createElement("a");
link.href = downloadUrl;
link.download = result.filename + ".cpack.zip";
link.click();
setTimeout(() => {
downloadModal.close();
}, 1000);
} catch (error) {
console.error("Package failed:", error);
downloadModal.close();
}
}
async function serveAction() {
if (document.getElementById("serve-modal")) return;
const modal = document.createElement("div");
modal.id = "serve-modal";
modal.className = "cpack-modal";
modal.style.width = "400px";
const title = document.createElement("div");
title.textContent = "Serve Workflow as REST API";
title.className = "cpack-title";
const form = document.createElement("form");
form.innerHTML = serveForm;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const confirmButton = document.createElement("button");
confirmButton.textContent = "Start";
confirmButton.className = "cpack-btn primary";
const cancelButton = document.createElement("button");
cancelButton.textContent = "Cancel";
cancelButton.className = "cpack-btn";
buttonContainer.appendChild(cancelButton);
buttonContainer.appendChild(confirmButton);
modal.appendChild(title);
modal.appendChild(form);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
cancelButton.onclick = close;
form.querySelector("input[name='port']").select();
confirmButton.onclick = async (e) => {
e.preventDefault();
const formData = new FormData(form);
const { workflow, output: workflow_api } = await app.graphToPrompt();
const data = {
host: formData.get("allowExternal") === "on" ? "0.0.0.0" : "localhost",
port: formData.get("port"),
workflow,
workflow_api
};
try {
confirmButton.disabled = true;
const resp = await api.fetchApi("/bentoml/serve", {
method: "POST",
body: JSON.stringify(data),
headers: { "Content-Type": "application/json" }
});
const result = await resp.json();
if (result.error) {
const errorDiv = form.querySelector('.error-message');
errorDiv.textContent = result.error;
errorDiv.style.display = 'block';
} else {
close();
createServeStatusModal(result.url);
}
} catch(e) {
const errorDiv = form.querySelector('.error-message');
errorDiv.textContent = e.message;
errorDiv.style.display = 'block';
} finally {
confirmButton.disabled = false;
}
};
}
async function deployAction() {
if (document.getElementById("build-modal")) return;
if (document.getElementById("building-modal")) return;
const data = await createBuildModal();
console.log(data);
await createBuildingModal(data);
};
const serveForm = `
<div class="cpack-form-item">
<label>
<input type="checkbox" name="allowExternal" />
Allow External Access
</label>
</div>
<div class="cpack-form-item">
<label for="port">Port</label>
<input type="number" class="cpack-input" name="port" value="3000" />
<div class="error-message"></div>
</div>
`
class PackageOptions {
constructor(container, modelsListId, filesListId, defaultOpen = true) {
this.container = container;
this.modelsListId = modelsListId;
this.filesListId = filesListId;
this.modelListComponent = null;
this.fileListComponent = null;
this.defaultOpen = defaultOpen;
}
getHtml() {
return `
<div class="cpack-form-item">
<details ${this.defaultOpen ? 'open' : ''}>
<summary style="cursor: pointer; margin-bottom: 10px;">Package Options</summary>
<div style="padding: 10px; background: #1d1d1d; border-radius: 4px;">
<div class="cpack-form-item">
<details>
<summary style="cursor: pointer; margin-bottom: 10px;">Models (<span data-models-count="${this.modelsListId}">0</span> selected)</summary>
<div id="${this.modelsListId}">
${spinner}
</div>
</details>
</div>
<div class="cpack-form-item">
<details>
<summary style="cursor: pointer; margin-bottom: 10px;">Input Files (<span data-files-count="${this.filesListId}">0</span> selected)</summary>
<div id="${this.filesListId}">
${spinner}
</div>
</details>
</div>
<div class="cpack-form-item">
<details>
<summary style="cursor: pointer; margin-bottom: 10px;">System Packages</summary>
<div id="system-packages-array" style="padding: 10px;">
<button class="cpack-btn" id="add-button" style="margin: 5px 0px">Add Package</button>
</div>
</details>
</div>
</div>
</details>
</div>
`;
}
async init() {
const modelsList = this.container.querySelector(`#${this.modelsListId}`);
const filesList = this.container.querySelector(`#${this.filesListId}`);
this.modelListComponent = new ModelList(modelsList, this.modelsListId);
this.fileListComponent = new FileTreeList(filesList, this.filesListId);
const addButton = this.container.querySelector("#add-button");
const systemPackagesArray = this.container.querySelector("#system-packages-array");
addButton.addEventListener("click", (e) => {
e.preventDefault();
const row = document.createElement("div");
row.className = "cpack-input-row";
row.innerHTML = `
<div style="flex: 1"><input type="text" class="cpack-input" name="systemPackages" placeholder="package name in Ubuntu" /></div>
<button class="cpack-btn" style="margin-left: 10px">Remove</button>
`
systemPackagesArray.appendChild(row);
row.querySelector("button").onclick = (e) => {
e.preventDefault();
row.remove();
}
});
await Promise.all([
this.modelListComponent.load(),
this.fileListComponent.load()
]);
}
getSelectedData() {
return {
models: this.modelListComponent.getSelectedModels(),
files: this.fileListComponent.getSelectedFiles(),
systemPackages: Array.from(this.container.querySelectorAll("input[name='systemPackages']"))
.map(input => input.value)
.filter(Boolean)
};
}
}
const buildForm = `
<p style="font-size: 0.85em; color: #888; margin-top: 5px;">
This feature is powered by <a href="https://www.bentoml.com/?from=comfy-pack" target="_blank" style="color: #00a67d;">BentoCloud</a>, a platform for deploying <br>and managing ML services in customizable clusters
</p>
<div class="cpack-form-item required">
<label for="bentoName">Name</label>
<input type="text" class="cpack-input" name="bentoName" placeholder="comfy-pack-app" />
<div class="error-message">Name is required</div>
</div>
<div class="cpack-form-item required">
<label>BentoCloud API</label>
<div id="credentials-group" style="margin-top: 10px;">
<div class="cpack-form-item">
<input type="text" class="cpack-input" name="endpoint" placeholder="https://<your_org>.cloud.bentoml.com" value="${localStorage.getItem('cpack-endpoint') || ''}" required />
<div class="error-message">Endpoint is required</div>
</div>
<div class="cpack-form-item">
<input type="password" class="cpack-input" name="apiKey" placeholder="<your_token>" value="${localStorage.getItem('cpack-api-key') || ''}" required />
<div class="error-message">API Key is required</div>
</div>
<p style="font-size: 0.85em; color: #888; margin-top: 5px;">
Get your API Token at <a href="https://cloud.bentoml.com/signup?from=comfy-pack" target="_blank" style="color: #00a67d;">cloud.bentoml.com</a>
</p>
</div>
</div>
<div id="package-options-container"></div>
`
function createBuildModal() {
const modal = document.createElement("div");
modal.id = "build-modal";
modal.className = "cpack-modal";
const title = document.createElement("div");
title.textContent = "Deploy Workflow to Cloud";
title.className = "cpack-title";
const form = document.createElement("form");
form.innerHTML = buildForm;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const confirmButton = document.createElement("button");
confirmButton.innerHTML = `Push to Cloud`;
confirmButton.className = "cpack-btn primary";
confirmButton.style.fontWeight = "bold";
confirmButton.disabled = true;
const cancelButton = document.createElement("button");
cancelButton.textContent = "Cancel";
cancelButton.className = "cpack-btn";
cancelButton.className = "cpack-btn";
buttonContainer.appendChild(cancelButton);
buttonContainer.appendChild(confirmButton);
modal.appendChild(title);
modal.appendChild(form);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
cancelButton.onclick = close;
return new Promise((resolve) => {
form.querySelector("input[name='bentoName']").select();
const packageOptionsContainer = form.querySelector("#package-options-container");
const packageOptions = new PackageOptions(form, "build-models-list", "build-files-list", false);
packageOptionsContainer.innerHTML = packageOptions.getHtml();
packageOptions.init().then(() => {
confirmButton.disabled = false;
});
confirmButton.onclick = async (e) => {
e.preventDefault();
const formData = new FormData(form);
const bentoName = formData.get("bentoName");
const endpoint = formData.get("endpoint");
const apiKey = formData.get("apiKey");
// Reset error messages
form.querySelectorAll('.error-message').forEach(el => el.style.display = 'none');
// Validate required fields
let hasError = false;
if (!bentoName.trim()) {
form.querySelector('input[name="bentoName"]').nextElementSibling.style.display = 'block';
hasError = true;
}
if (!endpoint.trim()) {
form.querySelector('input[name="endpoint"]').nextElementSibling.style.display = 'block';
hasError = true;
}
if (!apiKey.trim()) {
form.querySelector('input[name="apiKey"]').nextElementSibling.style.display = 'block';
hasError = true;
}
if (hasError) {
return;
}
// Save values to localStorage
localStorage.setItem('cpack-endpoint', endpoint);
localStorage.setItem('cpack-api-key', apiKey);
const { workflow, output: workflow_api } = await app.graphToPrompt();
const selectedData = packageOptions.getSelectedData();
const data = {
bento_name: bentoName,
system_packages: selectedData.systemPackages,
push: true,
api_key: apiKey,
endpoint: endpoint,
models: selectedData.models,
files: selectedData.files,
workflow,
workflow_api
};
close();
resolve(data);
}
});
}
async function createServeStatusModal(url) {
const modal = document.createElement("div");
modal.className = "cpack-modal";
modal.style.width = "400px";
const title = document.createElement("div");
title.textContent = "Serve Workflow as REST API";
title.className = "cpack-title";
const info = document.createElement("div");
const urlObj = new URL(url);
const currentHost = window.location.hostname;
const port = urlObj.port;
const displayUrl = `${currentHost}:${port}`;
info.innerHTML = `
<div style="margin-bottom: 15px">
<div style="text-align: center; margin-bottom: 15px; color: #00a67d">
🎉 Service is online! Click below to open:
</div>
<div style="text-align: center; margin-top: 15px">
<a href="http://${displayUrl}" target="_blank" style="color:#00a67d;text-decoration:none;font-weight:bold;font-size:1.2em">
${displayUrl}
<span style="color:#00a67d;font-size:1em">↗</span>
</a>
</div>
</div>
<div id="status-info" style="display:flex;justify-content:center;align-items:center">
${spinner}
</div>
`;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const cancelButton = document.createElement("button");
cancelButton.textContent = "Stop Server";
cancelButton.className = "cpack-btn";
cancelButton.style.cssText = "background: #a63d3d; color: white; font-weight: bold";
buttonContainer.appendChild(cancelButton);
modal.appendChild(title);
modal.appendChild(info);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
cancelButton.onclick = async () => {
cancelButton.disabled = true;
cancelButton.style.background = "#666";
try {
await api.fetchApi("/bentoml/serve/terminate", { method: "POST" });
} catch(e) {
console.error("Failed to stop server:", e);
}
clearInterval(checkInterval);
close();
};
const statusInfo = info.querySelector("#status-info");
// Start status checking
const checkInterval = setInterval(async () => {
try {
const resp = await api.fetchApi("/bentoml/serve/heartbeat");
const status = await resp.json();
if (status.error) {
title.textContent = "Server Error";
statusInfo.innerHTML = `<div style="color:#ff8383">${status.error}</div>`;
clearInterval(checkInterval);
}
} catch(e) {
title.textContent = "Status Check Error";
statusInfo.innerHTML = `<div style="color:#ff8383">${e.message}</div>`;
clearInterval(checkInterval);
}
}, 1000);
}
async function createBuildingModal(data) {
const modal = document.createElement("div");
modal.className = "cpack-modal";
modal.id = "building-modal";
const title = document.createElement("div");
title.textContent = "Pushing...";
title.className = "cpack-title";
const body = document.createElement("div");
body.innerHTML = `
<div id="build-info"></div>
<pre id="build-error"></pre>
<p style="font-size: 0.85em; color: #888; margin-top: 5px;">
First run may take several minutes to calculate model checksums, depending on the number of models.
</p>
`;
const buttonContainer = document.createElement("div");
buttonContainer.className = "cpack-btn-container";
const closeButton = document.createElement("button");
closeButton.textContent = "Close";
closeButton.className = "cpack-btn";
buttonContainer.appendChild(closeButton);
modal.appendChild(title);
modal.appendChild(body);
modal.appendChild(buttonContainer);
const { close } = createModal(modal);
closeButton.onclick = close;
closeButton.disabled = true;
const info = body.querySelector("#build-info");
const setError = (error) => {
title.textContent = "Build Failed";
info.style.display = "none";
const pre = body.querySelector("#build-error");
pre.textContent = error;
pre.style.display = "block";
}
info.innerHTML = spinner;
try {
const resp = await api.fetchApi("/bentoml/build", {
method: "POST",
body: JSON.stringify(data),
headers: { "Content-Type": "application/json" }
});
const respData = await resp.json();
if (respData.error) {
setError(respData.error);
} else {
title.textContent = "Push Completed";
// Extract org name from endpoint
const endpointUrl = new URL(data.endpoint);
// Extract bento repo and version from bento tag
const [repoName, version] = respData.bento.split(':');
// Construct status URL
const statusUrl = `${endpointUrl.origin}/bento_repositories/${repoName}/bentos/${version}`;
info.innerHTML = `
<div style="text-align: center; padding: 20px 0;">
<div style="font-size: 48px; margin-bottom: 15px;">✨</div>
<div style="color: #888; margin-bottom: 20px">
Your workflow has been pushed to BentoCloud and is ready for deployment
</div>
<div style="background: #1d1d1d; padding: 15px; border-radius: 8px; margin-bottom: 20px">
<div class="cpack-copyable">
<span>${repoName}:${version}</span>
<a href="${statusUrl}" target="_blank"
style="background: #00a67d; color: white; padding: 4px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 0.9em"
title="View pushed Bento">
<span>Deploy Now</span>
<svg style="width:16px;height:16px" viewBox="0 0 24 24">
<path fill="currentColor" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
</svg>
</a>
</div>
</div>
<div style="display: flex; justify-content: center; gap: 10px">
<a href="https://docs.bentoml.com/en/latest/scale-with-bentocloud/deployment/index.html?from=comfy-pack" target="_blank"
style="color:#00a67d; text-decoration:none; display:flex; align-items:center; gap:5px">
<span>Deployment Guide</span>
<svg style="width:16px;height:16px" viewBox="0 0 24 24">
<path fill="currentColor" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
</svg>
</a>
<a href="https://cloud.bentoml.com" target="_blank"
style="color:#00a67d; text-decoration:none; display:flex; align-items:center; gap:5px">
<span>BentoCloud Console Home</span>
<svg style="width:16px;height:16px" viewBox="0 0 24 24">
<path fill="currentColor" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
</svg>
</a>
</div>
</div>
`;
}
} catch(e) {
setError(e.message);
} finally {
closeButton.disabled = false;
}
}
app.registerExtension({
name: "Comfy.CPackExtension",
async setup() {
const styleTag = document.createElement("style");
styleTag.innerHTML = style;
document.head.appendChild(styleTag);
const menu = document.querySelector(".comfy-menu");
const separator = document.createElement("hr");
separator.style.margin = "20px 0";
separator.style.width = "100%";
menu.append(separator);
const packButton = document.createElement("button");
packButton.textContent = "Package";
packButton.onclick = packageAction;
menu.append(packButton);
const unpackButton = document.createElement("button");
unpackButton.textContent = "Unpack";
unpackButton.onclick = unpackAction;
menu.append(unpackButton);
const serveButton = document.createElement("button");
serveButton.textContent = "Serve";
serveButton.onclick = serveAction;
menu.append(serveButton);
const buildButton = document.createElement("button");
buildButton.textContent = "Deploy";
buildButton.onclick = deployAction;
menu.append(buildButton);
try {
// new style Manager buttons
// unload models button into new style Manager button
let cmGroup1 = new (await import("../../scripts/ui/components/buttonGroup.js")).ComfyButtonGroup(
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "package-variant-closed",
action: packageAction,
tooltip: "Comfy-Pack",
content: "Package",
classList: "comfyui-button comfyui-menu-mobile-collapse primary"
}).element,
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "package-variant",
action: unpackAction,
tooltip: "Comfy-Pack",
content: "Unpack",
classList: "comfyui-button comfyui-menu-mobile-collapse"
}).element,
);
app.menu?.settingsGroup.element.before(cmGroup1.element);
let cmGroup2 = new (await import("../../scripts/ui/components/buttonGroup.js")).ComfyButtonGroup(
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "api",
action: serveAction,
tooltip: "Comfy-Pack",
content: "Serve",
classList: "comfyui-button comfyui-menu-mobile-collapse primary"
}).element,
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "cloud-upload",
action: deployAction,
tooltip: "Comfy-Pack",
content: "Deploy",
classList: "comfyui-button comfyui-menu-mobile-collapse"
}).element,
);
app.menu?.settingsGroup.element.before(cmGroup2.element);
}
catch(exception) {
console.log('ComfyUI is outdated. New style menu based features are disabled.');
}
}
});
|