Bypass type validation

This commit is contained in:
pythongosssss
2024-08-15 19:47:17 +01:00
parent fd4fa5c4ce
commit a19d0cc4ad
2 changed files with 21 additions and 3 deletions
+9
View File
@@ -14,6 +14,15 @@ app.registerExtension({
beforeRegisterNodeDef(nodeType) {
if (nodeType.comfyClass === "MathExpression|pysssss") {
const onDrawForeground = nodeType.prototype.onDrawForeground;
nodeType.prototype.onNodeCreated = function() {
// These are typed as any to bypass backend validation
// update frontend to restrict types
for(const input of this.inputs) {
input.type = "INT,FLOAT,IMAGE,LATENT";
}
}
nodeType.prototype.onDrawForeground = function (ctx) {
const r = onDrawForeground?.apply?.(this, arguments);