Split monolithic 1400-line comfy_shared.js into focused TypeScript modules in web_source/src/comfy_shared/: - api.ts: server API utilities (runAction, getServerInfo, setServerInfo) - colors.ts: color brightness utilities - documentation.ts: node documentation widget system - dom.ts: DOM and HTML utilities - dynamic-connections.ts: dynamic input/output management - logger.ts: logging utilities with toast notifications - node-extensions.ts: node type extension helpers - storage.ts: namespaced localStorage management - types.ts: comprehensive type definitions - utils.ts: base utilities (UUID, debounce, deep merge) - widgets.ts: LiteGraph widget utilities Benefits: - ~200 LOC reduction through proper typing and elimination of redundant code - Better code organization with single-responsibility modules - Full TypeScript type safety with proper generics - Improved documentation and maintainability - Easier to tree-shake unused utilities Updated vite.config.ts to build comfy_shared as separate entry point and marked external dependencies (/mtb_async modules). Modified InspectorItem.svelte to use extracted item.value instead of always pulling from widgets[0]. Renamed panel.ts to panel.svelte.ts to enable Svelte 5 runes and made APIPanel reactive using $state instead of $$set.
Core
These 3 scripts cannot be used independently and must all be present to work, they are mostly enhancing the frontend of python nodes
comfy_shared: library of methods used inmtb_widgetsanddebug
mtb_widgets define ui callbacks, and various widgets like the COLOR type:
There is also Debug which is a node that should be able to display any data input, it handle a few cases and fallback to the string representation of the
data otherwise:
note +
A basic HTML note mainly to add better looking notes/instructions for workflow makers:
Standalone
These scripts can be taken and placed independently of comfy_mtb or any other files, mimicking what pythongosss did for their
- imageFeed: a fork of @pythongosssss ' s image feed, it adds support for: a lightbox to see images bigger, a way to load the current session history (in case of a web page reload), and different icons, most of the work come from the original script.
Note
The original imagefeed got updated since and offer more options, ideally I would clean my lightbox thing and PR it to pythongoss later but in the meantime the script will detect if you already use the original one and not load this fork