MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / getAllModelPathes

Function getAllModelPathes

ui/media/js/main.js:717–735  ·  view source on GitHub ↗
(type, filter = "")

Source from the content-addressed store, hash-verified

715// gets a flattened list of all models of a certain type. e.g. "path/subpath/modelname"
716// use the filter to search for all models having a certain name.
717function getAllModelPathes(type, filter = "") {
718 function f(tree, prefix) {
719 if (tree == undefined) {
720 return []
721 }
722 let result = []
723 tree.forEach((e) => {
724 if (typeof e == "object") {
725 result = result.concat(f(e[1], prefix + e[0] + "/"))
726 } else {
727 if (filter == "" || e == filter) {
728 result.push(prefix + e)
729 }
730 }
731 })
732 return result
733 }
734 return f(modelsOptions[type], "")
735}
736
737function onUseAsThumbnailClick(req, img) {
738 let scale = 1

Callers 1

extractLoraTagsFunction · 0.85

Calls 1

fFunction · 0.70

Tested by

no test coverage detected