diff --git a/__init__.py b/__init__.py index e83e1af..edb0fa0 100644 --- a/__init__.py +++ b/__init__.py @@ -8,6 +8,8 @@ parent_dir = os.path.dirname(root_path) sys.path.append(root_path) from facechain.nodes import * from facechain.style_loader_node import * +WEB_DIRECTORY = "js" + NODE_CLASS_MAPPINGS = { "FC StyleLoraLoad": FCStyleLoraLoad, diff --git a/js/facechain-apperance.js b/js/facechain-apperance.js new file mode 100644 index 0000000..f0d5091 --- /dev/null +++ b/js/facechain-apperance.js @@ -0,0 +1,19 @@ +import {app} from "../../scripts/app.js"; + +const SPECIFIC_WIDTH = 400; // Set to desired width + +function setNodeWidthForMappedTitles(node) { + node.setSize([SPECIFIC_WIDTH, node.size[1]]); +} + + +app.registerExtension({ + name: "facechain.appearance", + async beforeRegisterNodeDef(nodeType, nodeData, _app) { + if (nodeData.name === "FC StyleLoraLoad") { + nodeType.prototype.onNodeCreated = function () { + setNodeWidthForMappedTitles(this) + }; + } + }, +}); \ No newline at end of file