add js file
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user