Files
Sucial 8ec2738e5f feat: add audio processing and model management features
- Introduced `paths.py` for handling model directory resolution and registration.
- Created `catalog.py` to manage model metadata and stem extraction.
- Implemented `routes.py` for handling audio uploads and model retrieval via HTTP.
- Added utility functions in `audio.py` for audio conversion, loading, and saving.
- Developed ensemble functions in `ensemble.py` for combining audio inputs.
- Enhanced web interface with new JavaScript files for audio loading, separation, and ensemble node management.
- Defined constants for audio types and node configurations in `constants.js`.
- Improved user experience with dynamic input/output management in audio processing nodes.
2026-05-31 18:55:27 +08:00

34 lines
880 B
JavaScript

export function getWidget(node, name) {
return node.widgets?.find((widget) => widget.name === name);
}
export function disconnectOutput(node, index) {
try {
if (typeof node.disconnectOutput === "function") {
node.disconnectOutput(index);
return;
}
const output = node.outputs?.[index];
for (const linkId of output?.links ?? []) {
node.graph?.removeLink?.(linkId);
}
} catch (error) {
console.warn("[comfy-mss] failed to disconnect output", error);
}
}
export function disconnectInput(node, index) {
try {
if (typeof node.disconnectInput === "function") {
node.disconnectInput(index);
return;
}
const linkId = node.inputs?.[index]?.link;
if (linkId != null) {
node.graph?.removeLink?.(linkId);
}
} catch (error) {
console.warn("[comfy-mss] failed to disconnect input", error);
}
}