remove FL_CodeNode from node pack (v2.3.8)
Remove the FL Code Node utility node entirely — Python backend, JS frontend, init registration, and node description entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3d71d2cfc1
commit
3a6598f247
@@ -172,7 +172,6 @@ from .nodes.prompting.FL_PromptSelectorBasic import FL_PromptSelectorBasic
|
||||
|
||||
# UTILITY NODES
|
||||
from .nodes.utility.FL_ClipScanner import FL_ClipScanner
|
||||
from .nodes.utility.FL_Code_Node import FL_CodeNode
|
||||
from .nodes.utility.FL_DirectoryCrawl import FL_DirectoryCrawl
|
||||
from .nodes.utility.FL_Float import FL_Float
|
||||
from .nodes.utility.FL_InpaintCrop import FL_InpaintCrop
|
||||
@@ -249,7 +248,6 @@ NODE_CLASS_MAPPINGS = {
|
||||
"FL_ImageDimensionDisplay": FL_ImageDimensionDisplay,
|
||||
"FL_GeminiVideoCaptioner": FL_GeminiVideoCaptioner,
|
||||
"FL_GPT_Image1": FL_GPT_Image1,
|
||||
"FL_CodeNode": FL_CodeNode,
|
||||
"FL_ImagePixelator": FL_ImagePixelator,
|
||||
"FL_ImageAddToBatch": FL_ImageAddToBatch,
|
||||
"FL_DirectoryCrawl": FL_DirectoryCrawl,
|
||||
@@ -439,7 +437,6 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"FL_ImageDimensionDisplay": "FL Image Size",
|
||||
"FL_GeminiVideoCaptioner": "FL Gemini Video Captioner",
|
||||
"FL_GPT_Image1": "FL GPT Image-1",
|
||||
"FL_CodeNode": "FL Code Node",
|
||||
"FL_ImagePixelator": "FL Image Pixelator",
|
||||
"FL_ImageAddToBatch": "FL Image Add To Batch",
|
||||
"FL_DirectoryCrawl": "FL Directory Crawl",
|
||||
|
||||
@@ -746,12 +746,6 @@
|
||||
"description": null,
|
||||
"category": "utility"
|
||||
},
|
||||
{
|
||||
"class": "FL_CodeNode",
|
||||
"file": "FL_Code_Node.py",
|
||||
"description": null,
|
||||
"category": "utility"
|
||||
},
|
||||
{
|
||||
"class": "FL_DirectoryCrawl",
|
||||
"file": "FL_DirectoryCrawl.py",
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
from pathlib import Path
|
||||
from ..sup import ROOT, AlwaysEqualProxy, parse_dynamic
|
||||
|
||||
|
||||
class FL_CodeNode:
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"code_input": (
|
||||
"STRING", {"default": "outputs[0] = 'hello, world!'", "multiline": True, "dynamicPrompts": False}),
|
||||
"file": ("STRING", {"default": "", "multiline": False, "dynamicPrompts": False}),
|
||||
"use_file": ("BOOLEAN", {"default": False}),
|
||||
"run_always": ("BOOLEAN", {"default": False})
|
||||
}}
|
||||
|
||||
CATEGORY = "🏵️Fill Nodes/Utility"
|
||||
RETURN_TYPES = tuple(AlwaysEqualProxy("*") for _ in range(4))
|
||||
RETURN_NAMES = tuple(f"output_{i}" for i in range(4))
|
||||
DESCRIPTION = """
|
||||
FL_CodeNode is designed to execute custom user-provided Python code. The code can be directly entered as a string input or loaded from a specified file. This class processes dynamic inputs and provides four generic output slots. The execution environment includes predefined 'inputs' and 'outputs' dictionaries to facilitate interaction with the code. Proper error handling is included to ensure informative feedback in case of execution failures. This node is ideal for users needing to integrate custom logic or algorithms into their workflows.
|
||||
"""
|
||||
FUNCTION = "execute"
|
||||
|
||||
@classmethod
|
||||
def IS_CHANGED(self, code_input, file, use_file, run_always, **kwargs):
|
||||
if run_always:
|
||||
return float('nan')
|
||||
hash = '$$' + str(kwargs) + '$$' + self.get_exec_string(self, code_input, file, use_file) + '$$'
|
||||
# print(hash)
|
||||
return hash
|
||||
|
||||
def execute(self, code_input, file, use_file, run_always, **kwargs):
|
||||
outputs = {i: None for i in range(4)}
|
||||
inputs = kwargs.copy()
|
||||
inputs.update({i: v for i, v in enumerate(kwargs.values())})
|
||||
code = self.get_exec_string(code_input, file, use_file)
|
||||
|
||||
try:
|
||||
exec(code, {"inputs": inputs, "outputs": outputs})
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Error executing user code: {e}")
|
||||
|
||||
return tuple(outputs[i] for i in range(4))
|
||||
|
||||
def get_exec_string(self, code_input, file, use_file):
|
||||
if use_file:
|
||||
# load the referenced file
|
||||
code_input = ""
|
||||
if not (fname := Path(ROOT / file)).is_file():
|
||||
# print(fname)
|
||||
if not (fname := Path(file)).is_file():
|
||||
# print(fname)
|
||||
fname = None
|
||||
if fname is not None:
|
||||
try:
|
||||
with open(str(fname), 'r') as f:
|
||||
code_input = f.read()
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"[FL_CodeNode] error loading code file: {e}")
|
||||
# print(code_input)
|
||||
return code_input
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui_fill-nodes"
|
||||
description = "Fill-Nodes is a versatile collection of custom nodes for ComfyUI that extends functionality across multiple domains. Features include advanced image processing (pixelation, slicing, masking), visual effects generation (glitch, halftone, pixel art), comprehensive file handling (PDF creation/extraction, Google Drive integration), AI model interfaces (GPT, DALL-E, Hugging Face), utility nodes for workflow enhancement, and specialized tools for video processing, captioning, and batch operations. The pack provides both practical workflow solutions and creative tools within a unified node collection."
|
||||
version = "2.3.7"
|
||||
version = "2.3.8"
|
||||
license = "LICENSE"
|
||||
dependencies = ["librosa", "sounddevice", "glitch_this", "PyOpenGL", "glfw", "scipy>=1.13.1", "requests", "aiohttp", "moviepy", "matplotlib", "reportlab", "openai", "PyPDF2", "pdf2image", "PyMuPDF", "reportlab", "PyPDF2", "ollama", "kornia", "opencv-python", "gdown", "open_clip_torch", "google-genai"]
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
File: fl_code_node.js
|
||||
File: betterCombos.js
|
||||
Project: ComfyUI_Fill-Nodes
|
||||
|
||||
pythongossss to the rescue again
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* File: fl_code_node.js
|
||||
* Project: ComfyUI_Fill-Nodes
|
||||
*
|
||||
*/
|
||||
|
||||
import { app } from "../../../../scripts/app.js"
|
||||
import { node_add_dynamic } from "../../widget.js"
|
||||
|
||||
const _id = "FL_CodeNode"
|
||||
const _prefix = 'input'
|
||||
|
||||
app.registerExtension({
|
||||
name: 'fl.node.' + _id,
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
if (nodeData.name !== _id) {
|
||||
return;
|
||||
}
|
||||
nodeType = node_add_dynamic(nodeType, _prefix);
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user