create dummy node for publishing to work

This commit is contained in:
Josh Whaley
2025-03-09 14:42:00 -04:00
parent 5578943d94
commit b9d95f9110
5 changed files with 19 additions and 78 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Scroll Over Textarea
# ComfyUI Scroll Over Textarea
A ComfyUI extension to allow textarea elements to be scrolled over. Useful when using a trackpad in order to prevent accidental forward/back navigation (two fingers horizontally on a Mac) when scrolling around the UI.
+1 -1
View File
@@ -33,7 +33,7 @@ homepage = "https://github.com/joreyaesh/comfyui_scroll_over_textarea"
[tool.comfy]
PublisherId = "joreyaesh"
DisplayName = "Scroll Over Textarea"
DisplayName = "ComfyUI Scroll Over Textarea"
Icon = ""
[tool.setuptools.package-data]
+9 -68
View File
@@ -1,9 +1,9 @@
from inspect import cleandoc
class Example:
class ScrollOverTextareaDummyNode:
"""
A example node
An empty dummy node since this has changes only for the UI.
Class methods
-------------
@@ -50,42 +50,9 @@ class Example:
+ First value is a string indicate the type of field or a list for selection.
+ Secound value is a config for type "INT", "STRING" or "FLOAT".
"""
return {
"required": {
"image": ("Image", {"tooltip": "This is an image"}),
"int_field": (
"INT",
{
"default": 0,
"min": 0, # Minimum value
"max": 4096, # Maximum value
"step": 64, # Slider's step
"display": "number", # Cosmetic only: display as "number" or "slider"
},
),
"float_field": (
"FLOAT",
{
"default": 1.0,
"min": 0.0,
"max": 10.0,
"step": 0.01,
"round": 0.001, # The value represeting the precision to round to, will be set to the step value by default. Can be set to False to disable rounding.
"display": "number",
},
),
"print_to_screen": (["enable", "disable"],),
"string_field": (
"STRING",
{
"multiline": False, # True if you want the field to look like the one on the ClipTextEncode node
"default": "Hello World!",
},
),
},
}
return {}
RETURN_TYPES = ("IMAGE",)
RETURN_TYPES = ()
# RETURN_NAMES = ("image_output_name",)
DESCRIPTION = cleandoc(__doc__)
FUNCTION = "test"
@@ -93,41 +60,15 @@ class Example:
# OUTPUT_NODE = False
# OUTPUT_TOOLTIPS = ("",) # Tooltips for the output node
CATEGORY = "Example"
CATEGORY = "Dummy"
def test(self, image, string_field, int_field, float_field, print_to_screen):
if print_to_screen == "enable":
print(
f"""Your input contains:
string_field aka input text: {string_field}
int_field: {int_field}
float_field: {float_field}
"""
)
# do some processing on the image, in this example I just invert it
image = 1.0 - image
return (image,)
"""
The node will always be re executed if any of the inputs change but
this method can be used to force the node to execute again even when the inputs don't change.
You can make this node return a number or a string. This value will be compared to the one returned the last time the node was
executed, if it is different the node will be executed again.
This method is used in the core repo for the LoadImage node where they return the image hash as a string, if the image hash
changes between executions the LoadImage node is executed again.
"""
# @classmethod
# def IS_CHANGED(s, image, string_field, int_field, float_field, print_to_screen):
# return ""
def test(self):
return ()
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
# "Example": Example
}
NODE_CLASS_MAPPINGS = {"ScrollOverTextareaDummyNode": ScrollOverTextareaDummyNode}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
# "Example": "Example Node"
}
NODE_DISPLAY_NAME_MAPPINGS = {"ScrollOverTextareaDummyNode": "Scroll Over Textarea"}
+6 -6
View File
@@ -3,22 +3,22 @@
"""Tests for `comfyui_scroll_over_textarea` package."""
import pytest
from src.comfyui_scroll_over_textarea.nodes import Example
from src.comfyui_scroll_over_textarea.nodes import ScrollOverTextareaDummyNode
@pytest.fixture
def example_node():
"""Fixture to create an Example node instance."""
return Example()
return ScrollOverTextareaDummyNode()
def test_example_node_initialization(example_node):
"""Test that the node can be instantiated."""
assert isinstance(example_node, Example)
assert isinstance(example_node, ScrollOverTextareaDummyNode)
def test_return_types():
"""Test the node's metadata."""
assert Example.RETURN_TYPES == ("IMAGE",)
assert Example.FUNCTION == "test"
assert Example.CATEGORY == "Example"
assert ScrollOverTextareaDummyNode.RETURN_TYPES == ("IMAGE",)
assert ScrollOverTextareaDummyNode.FUNCTION == "test"
assert ScrollOverTextareaDummyNode.CATEGORY == "Example"
+2 -2
View File
@@ -1,7 +1,7 @@
import { app } from '../../../scripts/app.js';
app.registerExtension({
name: 'Scroll Over Textarea',
name: 'ComfyUI Scroll Over Textarea',
settings: [
{
id: 'comfyui_scroll_over_textarea.enable',
@@ -14,7 +14,7 @@ app.registerExtension({
},
],
async setup() {
console.log('Scroll Over Textarea Extension Loaded');
console.log('ComfyUI Scroll Over Textarea Extension Loaded');
const cb = (event) => {
app.canvas.processMouseWheel(event);
event.preventDefault();