Download custom_nodes/rgthree-comfy/src_web/comfyui/utils_inputs_outputs.ts from fotographerai/Zen-Style-Shape: direct link, hf CLI and curl.
- Browser
- Download file 428 Bytes
-
https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/1e1fbeb6135765d0be77b04237eb90cd6ba0d1a0/custom_nodes/rgthree-comfy/src_web/comfyui/utils_inputs_outputs.ts
- Command line
-
hf download hf://spaces/fotographerai/Zen-Style-Shape@1e1fbeb6135765d0be77b04237eb90cd6ba0d1a0/custom_nodes/rgthree-comfy/src_web/comfyui/utils_inputs_outputs.ts
-
curl -L -o utils_inputs_outputs.ts https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/1e1fbeb6135765d0be77b04237eb90cd6ba0d1a0/custom_nodes/rgthree-comfy/src_web/comfyui/utils_inputs_outputs.ts
428 Bytes
| import type { LGraphNode } from "typings/litegraph.js"; | |
| /** Removes all inputs from the end. */ | |
| export function removeUnusedInputsFromEnd(node: LGraphNode, minNumber = 1, nameMatch?: RegExp) { | |
| for (let i = node.inputs.length - 1; i >= minNumber; i--) { | |
| if (!node.inputs[i]?.link) { | |
| if (!nameMatch || nameMatch.test(node.inputs[i]!.name)) { | |
| node.removeInput(i); | |
| } | |
| continue; | |
| } | |
| break; | |
| } | |
| } |